Changeset b800b0e in mainline for uspace/srv/net/udp/sock.c
- Timestamp:
- 2012-10-23T13:16:49Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6ecf5b8
- Parents:
- 32b3a12 (diff), b2ac3998 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/udp/sock.c
r32b3a12 rb800b0e 88 88 static void udp_sock_notify_data(socket_core_t *sock_core) 89 89 { 90 log_msg(L VL_DEBUG, "udp_sock_notify_data(%d)", sock_core->socket_id);90 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_notify_data(%d)", sock_core->socket_id); 91 91 async_exch_t *exch = async_exchange_begin(sock_core->sess); 92 92 async_msg_5(exch, NET_SOCKET_RECEIVED, (sysarg_t)sock_core->socket_id, … … 103 103 ipc_call_t answer; 104 104 105 log_msg(L VL_DEBUG, "udp_sock_socket()");105 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_socket()"); 106 106 sock = calloc(1, sizeof(udp_sockdata_t)); 107 107 if (sock == NULL) { … … 167 167 udp_error_t urc; 168 168 169 log_msg(L VL_DEBUG, "udp_sock_bind()");170 log_msg(L VL_DEBUG, " - async_data_write_accept");169 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_bind()"); 170 log_msg(LOG_DEFAULT, LVL_DEBUG, " - async_data_write_accept"); 171 171 172 172 addr = NULL; … … 178 178 } 179 179 180 log_msg(L VL_DEBUG, " - call socket_bind");180 log_msg(LOG_DEFAULT, LVL_DEBUG, " - call socket_bind"); 181 181 rc = socket_bind(&client->sockets, &gsock, SOCKET_GET_SOCKET_ID(call), 182 182 addr, addr_size, UDP_FREE_PORTS_START, UDP_FREE_PORTS_END, … … 192 192 } 193 193 194 log_msg(L VL_DEBUG, " - call socket_cores_find");194 log_msg(LOG_DEFAULT, LVL_DEBUG, " - call socket_cores_find"); 195 195 sock_core = socket_cores_find(&client->sockets, SOCKET_GET_SOCKET_ID(call)); 196 196 if (sock_core == NULL) { … … 222 222 } 223 223 224 log_msg(L VL_DEBUG, " - success");224 log_msg(LOG_DEFAULT, LVL_DEBUG, " - success"); 225 225 async_answer_0(callid, rc); 226 226 out: … … 231 231 static void udp_sock_listen(udp_client_t *client, ipc_callid_t callid, ipc_call_t call) 232 232 { 233 log_msg(L VL_DEBUG, "udp_sock_listen()");233 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_listen()"); 234 234 async_answer_0(callid, ENOTSUP); 235 235 } … … 237 237 static void udp_sock_connect(udp_client_t *client, ipc_callid_t callid, ipc_call_t call) 238 238 { 239 log_msg(L VL_DEBUG, "udp_sock_connect()");239 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_connect()"); 240 240 async_answer_0(callid, ENOTSUP); 241 241 } … … 243 243 static void udp_sock_accept(udp_client_t *client, ipc_callid_t callid, ipc_call_t call) 244 244 { 245 log_msg(L VL_DEBUG, "udp_sock_accept()");245 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_accept()"); 246 246 async_answer_0(callid, ENOTSUP); 247 247 } … … 264 264 int rc; 265 265 266 log_msg(L VL_DEBUG, "udp_sock_send()");266 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_send()"); 267 267 268 268 addr = NULL; … … 323 323 fibril_mutex_unlock(&socket->lock); 324 324 async_answer_0(callid, rc); 325 log_msg(L VL_DEBUG, "udp_sock_sendto: Failed to "325 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_sendto: Failed to " 326 326 "determine local address."); 327 327 return; … … 329 329 330 330 socket->assoc->ident.local.addr.ipv4 = loc_addr.ipv4; 331 log_msg(L VL_DEBUG, "Local IP address is %x",331 log_msg(LOG_DEFAULT, LVL_DEBUG, "Local IP address is %x", 332 332 socket->assoc->ident.local.addr.ipv4); 333 333 } … … 405 405 int rc; 406 406 407 log_msg(L VL_DEBUG, "%p: udp_sock_recv[from]()", client);407 log_msg(LOG_DEFAULT, LVL_DEBUG, "%p: udp_sock_recv[from]()", client); 408 408 409 409 socket_id = SOCKET_GET_SOCKET_ID(call); … … 427 427 (void)flags; 428 428 429 log_msg(L VL_DEBUG, "udp_sock_recvfrom(): lock recv_buffer lock");429 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_recvfrom(): lock recv_buffer lock"); 430 430 fibril_mutex_lock(&socket->recv_buffer_lock); 431 431 while (socket->recv_buffer_used == 0 && socket->recv_error == UDP_EOK) { 432 log_msg(L VL_DEBUG, "udp_sock_recvfrom(): wait for cv");432 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_recvfrom(): wait for cv"); 433 433 fibril_condvar_wait(&socket->recv_buffer_cv, 434 434 &socket->recv_buffer_lock); 435 435 } 436 436 437 log_msg(L VL_DEBUG, "Got data in sock recv_buffer");437 log_msg(LOG_DEFAULT, LVL_DEBUG, "Got data in sock recv_buffer"); 438 438 439 439 rsock = socket->recv_fsock; … … 441 441 urc = socket->recv_error; 442 442 443 log_msg(L VL_DEBUG, "**** recv data_len=%zu", data_len);443 log_msg(LOG_DEFAULT, LVL_DEBUG, "**** recv data_len=%zu", data_len); 444 444 445 445 switch (urc) { … … 458 458 } 459 459 460 log_msg(L VL_DEBUG, "**** udp_uc_receive -> %d", rc);460 log_msg(LOG_DEFAULT, LVL_DEBUG, "**** udp_uc_receive -> %d", rc); 461 461 if (rc != EOK) { 462 462 fibril_mutex_unlock(&socket->recv_buffer_lock); … … 472 472 addr.sin_port = host2uint16_t_be(rsock.port); 473 473 474 log_msg(L VL_DEBUG, "addr read receive");474 log_msg(LOG_DEFAULT, LVL_DEBUG, "addr read receive"); 475 475 if (!async_data_read_receive(&rcallid, &addr_length)) { 476 476 fibril_mutex_unlock(&socket->recv_buffer_lock); … … 483 483 addr_length = sizeof(addr); 484 484 485 log_msg(L VL_DEBUG, "addr read finalize");485 log_msg(LOG_DEFAULT, LVL_DEBUG, "addr read finalize"); 486 486 rc = async_data_read_finalize(rcallid, &addr, addr_length); 487 487 if (rc != EOK) { … … 493 493 } 494 494 495 log_msg(L VL_DEBUG, "data read receive");495 log_msg(LOG_DEFAULT, LVL_DEBUG, "data read receive"); 496 496 if (!async_data_read_receive(&rcallid, &length)) { 497 497 fibril_mutex_unlock(&socket->recv_buffer_lock); … … 504 504 length = data_len; 505 505 506 log_msg(L VL_DEBUG, "data read finalize");506 log_msg(LOG_DEFAULT, LVL_DEBUG, "data read finalize"); 507 507 rc = async_data_read_finalize(rcallid, socket->recv_buffer, length); 508 508 … … 510 510 rc = EOVERFLOW; 511 511 512 log_msg(L VL_DEBUG, "read_data_length <- %zu", length);512 log_msg(LOG_DEFAULT, LVL_DEBUG, "read_data_length <- %zu", length); 513 513 IPC_SET_ARG2(answer, 0); 514 514 SOCKET_SET_READ_DATA_LENGTH(answer, length); … … 531 531 int rc; 532 532 533 log_msg(L VL_DEBUG, "tcp_sock_close()");533 log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_sock_close()"); 534 534 socket_id = SOCKET_GET_SOCKET_ID(call); 535 535 … … 557 557 static void udp_sock_getsockopt(udp_client_t *client, ipc_callid_t callid, ipc_call_t call) 558 558 { 559 log_msg(L VL_DEBUG, "udp_sock_getsockopt()");559 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_getsockopt()"); 560 560 async_answer_0(callid, ENOTSUP); 561 561 } … … 563 563 static void udp_sock_setsockopt(udp_client_t *client, ipc_callid_t callid, ipc_call_t call) 564 564 { 565 log_msg(L VL_DEBUG, "udp_sock_setsockopt()");565 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_setsockopt()"); 566 566 async_answer_0(callid, ENOTSUP); 567 567 } … … 574 574 size_t rcvd; 575 575 576 log_msg(L VL_DEBUG, "udp_sock_recv_fibril()");576 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_recv_fibril()"); 577 577 578 578 while (true) { 579 log_msg(L VL_DEBUG, "[] wait for rcv buffer empty()");579 log_msg(LOG_DEFAULT, LVL_DEBUG, "[] wait for rcv buffer empty()"); 580 580 fibril_mutex_lock(&sock->recv_buffer_lock); 581 581 while (sock->recv_buffer_used != 0) { … … 584 584 } 585 585 586 log_msg(L VL_DEBUG, "[] call udp_uc_receive()");586 log_msg(LOG_DEFAULT, LVL_DEBUG, "[] call udp_uc_receive()"); 587 587 urc = udp_uc_receive(sock->assoc, sock->recv_buffer, 588 588 UDP_FRAGMENT_SIZE, &rcvd, &xflags, &sock->recv_fsock); … … 597 597 } 598 598 599 log_msg(L VL_DEBUG, "[] got data - broadcast recv_buffer_cv");599 log_msg(LOG_DEFAULT, LVL_DEBUG, "[] got data - broadcast recv_buffer_cv"); 600 600 601 601 sock->recv_buffer_used = rcvd; … … 622 622 623 623 while (true) { 624 log_msg(L VL_DEBUG, "udp_sock_connection: wait");624 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_connection: wait"); 625 625 callid = async_get_call(&call); 626 626 if (!IPC_GET_IMETHOD(call)) 627 627 break; 628 628 629 log_msg(L VL_DEBUG, "udp_sock_connection: METHOD=%d",629 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_connection: METHOD=%d", 630 630 (int)IPC_GET_IMETHOD(call)); 631 631 … … 670 670 671 671 /* Clean up */ 672 log_msg(L VL_DEBUG, "udp_sock_connection: Clean up");672 log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_sock_connection: Clean up"); 673 673 async_hangup(client.sess); 674 674 socket_cores_release(NULL, &client.sockets, &gsock, udp_free_sock_data);
Note:
See TracChangeset
for help on using the changeset viewer.