Changeset e417b96 in mainline for uspace/srv/net/tl/tcp/tcp.c
- Timestamp:
- 2010-03-23T22:58:44Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5814ef7
- Parents:
- 76ca3f7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/tcp/tcp.c
r76ca3f7 re417b96 1062 1062 int socket_id; 1063 1063 size_t addrlen; 1064 size_t size; 1064 1065 fibril_rwlock_t lock; 1065 1066 ipc_call_t answer; … … 1107 1108 socket_id = SOCKET_GET_SOCKET_ID(call); 1108 1109 res = socket_create(&local_sockets, app_phone, socket_data, &socket_id); 1109 *SOCKET_SET_SOCKET_ID(answer) = socket_id;1110 SOCKET_SET_SOCKET_ID(answer, socket_id); 1110 1111 fibril_rwlock_write_unlock(&lock); 1111 1112 if(res == EOK){ 1112 1113 if(tl_get_ip_packet_dimension(tcp_globals.ip_phone, &tcp_globals.dimensions, DEVICE_INVALID_ID, &packet_dimension) == EOK){ 1113 *SOCKET_SET_DATA_FRAGMENT_SIZE(answer) = ((packet_dimension->content < socket_data->data_fragment_size) ? packet_dimension->content : socket_data->data_fragment_size);1114 SOCKET_SET_DATA_FRAGMENT_SIZE(answer, ((packet_dimension->content < socket_data->data_fragment_size) ? packet_dimension->content : socket_data->data_fragment_size)); 1114 1115 } 1115 // *SOCKET_SET_DATA_FRAGMENT_SIZE(answer) = MAX_TCP_FRAGMENT_SIZE;1116 *SOCKET_SET_HEADER_SIZE(answer) = TCP_HEADER_SIZE;1116 // SOCKET_SET_DATA_FRAGMENT_SIZE(answer, MAX_TCP_FRAGMENT_SIZE); 1117 SOCKET_SET_HEADER_SIZE(answer, TCP_HEADER_SIZE); 1117 1118 answer_count = 3; 1118 1119 }else{ … … 1166 1167 fibril_rwlock_read_lock(&tcp_globals.lock); 1167 1168 fibril_rwlock_write_lock(&lock); 1168 res = tcp_accept_message(&local_sockets, SOCKET_GET_SOCKET_ID(call), SOCKET_GET_NEW_SOCKET_ID(call), SOCKET_SET_DATA_FRAGMENT_SIZE(answer), &addrlen); 1169 res = tcp_accept_message(&local_sockets, SOCKET_GET_SOCKET_ID(call), SOCKET_GET_NEW_SOCKET_ID(call), &size, &addrlen); 1170 SOCKET_SET_DATA_FRAGMENT_SIZE(answer, size); 1169 1171 fibril_rwlock_write_unlock(&lock); 1170 1172 fibril_rwlock_read_unlock(&tcp_globals.lock); 1171 1173 if(res > 0){ 1172 *SOCKET_SET_SOCKET_ID(answer) = res;1173 *SOCKET_SET_ADDRESS_LENGTH(answer) = addrlen;1174 SOCKET_SET_SOCKET_ID(answer, res); 1175 SOCKET_SET_ADDRESS_LENGTH(answer, addrlen); 1174 1176 answer_count = 3; 1175 1177 } … … 1178 1180 fibril_rwlock_read_lock(&tcp_globals.lock); 1179 1181 fibril_rwlock_write_lock(&lock); 1180 res = tcp_send_message(&local_sockets, SOCKET_GET_SOCKET_ID(call), SOCKET_GET_DATA_FRAGMENTS(call), SOCKET_SET_DATA_FRAGMENT_SIZE(answer), SOCKET_GET_FLAGS(call)); 1182 res = tcp_send_message(&local_sockets, SOCKET_GET_SOCKET_ID(call), SOCKET_GET_DATA_FRAGMENTS(call), &size, SOCKET_GET_FLAGS(call)); 1183 SOCKET_SET_DATA_FRAGMENT_SIZE(answer, size); 1181 1184 if(res != EOK){ 1182 1185 fibril_rwlock_write_unlock(&lock); … … 1191 1194 fibril_rwlock_read_lock(&tcp_globals.lock); 1192 1195 fibril_rwlock_write_lock(&lock); 1193 res = tcp_send_message(&local_sockets, SOCKET_GET_SOCKET_ID(call), SOCKET_GET_DATA_FRAGMENTS(call), SOCKET_SET_DATA_FRAGMENT_SIZE(answer), SOCKET_GET_FLAGS(call)); 1196 res = tcp_send_message(&local_sockets, SOCKET_GET_SOCKET_ID(call), SOCKET_GET_DATA_FRAGMENTS(call), &size, SOCKET_GET_FLAGS(call)); 1197 SOCKET_SET_DATA_FRAGMENT_SIZE(answer, size); 1194 1198 if(res != EOK){ 1195 1199 fibril_rwlock_write_unlock(&lock); … … 1208 1212 fibril_rwlock_read_unlock(&tcp_globals.lock); 1209 1213 if(res > 0){ 1210 *SOCKET_SET_READ_DATA_LENGTH(answer) = res;1214 SOCKET_SET_READ_DATA_LENGTH(answer, res); 1211 1215 answer_count = 1; 1212 1216 res = EOK; … … 1220 1224 fibril_rwlock_read_unlock(&tcp_globals.lock); 1221 1225 if(res > 0){ 1222 *SOCKET_SET_READ_DATA_LENGTH(answer) = res;1223 *SOCKET_SET_ADDRESS_LENGTH(answer) = addrlen;1226 SOCKET_SET_READ_DATA_LENGTH(answer, res); 1227 SOCKET_SET_ADDRESS_LENGTH(answer, addrlen); 1224 1228 answer_count = 3; 1225 1229 res = EOK;
Note:
See TracChangeset
for help on using the changeset viewer.