Changeset 7c912b6 in mainline
- Timestamp:
- 2012-05-12T09:39:20Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0d67e16
- Parents:
- 01a7aa1
- Location:
- uspace
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/nterm/conn.c
r01a7aa1 r7c912b6 38 38 #include <net/socket.h> 39 39 #include <stdio.h> 40 #include <str_error.h> 40 41 #include <sys/types.h> 41 42 … … 46 47 static fid_t rcv_fid; 47 48 48 #define RECV_BUF_SIZE 1 49 #define RECV_BUF_SIZE 1024 49 50 static uint8_t recv_buf[RECV_BUF_SIZE]; 50 51 … … 61 62 } 62 63 63 printf("Recv fibril terminated.\n"); 64 if (nr == ENOTCONN) 65 printf("\n[Other side has closed the connection]\n"); 66 else 67 printf("'\n[Receive errror (%s)]\n", str_error(nr)); 64 68 65 69 return 0; -
uspace/app/nterm/nterm.c
r01a7aa1 r7c912b6 68 68 rc = conn_send(cbuf, offs); 69 69 if (rc != EOK) { 70 printf(" Failed sending data.\n");70 printf("[Failed sending data]\n"); 71 71 } 72 72 } … … 106 106 putchar(dp[i]); 107 107 } 108 109 fflush(stdout); 108 110 } 109 111 -
uspace/srv/net/tcp/conn.c
r01a7aa1 r7c912b6 184 184 void tcp_conn_addref(tcp_conn_t *conn) 185 185 { 186 log_msg(LVL_DEBUG , "%s: tcp_conn_addref(%p)", conn->name, conn);186 log_msg(LVL_DEBUG2, "%s: tcp_conn_addref(%p)", conn->name, conn); 187 187 atomic_inc(&conn->refcnt); 188 188 } … … 196 196 void tcp_conn_delref(tcp_conn_t *conn) 197 197 { 198 log_msg(LVL_DEBUG , "%s: tcp_conn_delref(%p)", conn->name, conn);198 log_msg(LVL_DEBUG2, "%s: tcp_conn_delref(%p)", conn->name, conn); 199 199 200 200 if (atomic_predec(&conn->refcnt) == 0) … … 312 312 static bool tcp_socket_match(tcp_sock_t *sock, tcp_sock_t *patt) 313 313 { 314 log_msg(LVL_DEBUG , "tcp_socket_match(sock=(%x,%u), pat=(%x,%u))",314 log_msg(LVL_DEBUG2, "tcp_socket_match(sock=(%x,%u), pat=(%x,%u))", 315 315 sock->addr.ipv4, sock->port, patt->addr.ipv4, patt->port); 316 316 … … 323 323 return false; 324 324 325 log_msg(LVL_DEBUG , " -> match");325 log_msg(LVL_DEBUG2, " -> match"); 326 326 327 327 return true; … … 331 331 static bool tcp_sockpair_match(tcp_sockpair_t *sp, tcp_sockpair_t *pattern) 332 332 { 333 log_msg(LVL_DEBUG , "tcp_sockpair_match(%p, %p)", sp, pattern);333 log_msg(LVL_DEBUG2, "tcp_sockpair_match(%p, %p)", sp, pattern); 334 334 335 335 if (!tcp_socket_match(&sp->local, &pattern->local)) … … 360 360 tcp_conn_t *conn = list_get_instance(link, tcp_conn_t, link); 361 361 tcp_sockpair_t *csp = &conn->ident; 362 log_msg(LVL_DEBUG , "compare with conn (f:(%x,%u), l:(%x,%u))",362 log_msg(LVL_DEBUG2, "compare with conn (f:(%x,%u), l:(%x,%u))", 363 363 csp->foreign.addr.ipv4, csp->foreign.port, 364 364 csp->local.addr.ipv4, csp->local.port); -
uspace/srv/net/tcp/segment.c
r01a7aa1 r7c912b6 248 248 void tcp_segment_dump(tcp_segment_t *seg) 249 249 { 250 log_msg(LVL_DEBUG , "Segment dump:");251 log_msg(LVL_DEBUG , " - ctrl = %u", (unsigned)seg->ctrl);252 log_msg(LVL_DEBUG , " - seq = % " PRIu32, seg->seq);253 log_msg(LVL_DEBUG , " - ack = % " PRIu32, seg->ack);254 log_msg(LVL_DEBUG , " - len = % " PRIu32, seg->len);255 log_msg(LVL_DEBUG , " - wnd = % " PRIu32, seg->wnd);256 log_msg(LVL_DEBUG , " - up = % " PRIu32, seg->up);250 log_msg(LVL_DEBUG2, "Segment dump:"); 251 log_msg(LVL_DEBUG2, " - ctrl = %u", (unsigned)seg->ctrl); 252 log_msg(LVL_DEBUG2, " - seq = % " PRIu32, seg->seq); 253 log_msg(LVL_DEBUG2, " - ack = % " PRIu32, seg->ack); 254 log_msg(LVL_DEBUG2, " - len = % " PRIu32, seg->len); 255 log_msg(LVL_DEBUG2, " - wnd = % " PRIu32, seg->wnd); 256 log_msg(LVL_DEBUG2, " - up = % " PRIu32, seg->up); 257 257 } 258 258 -
uspace/srv/net/tcp/sock.c
r01a7aa1 r7c912b6 652 652 log_msg(LVL_DEBUG, "tcp_sock_recvfrom(): lock recv_buffer_lock"); 653 653 fibril_mutex_lock(&socket->recv_buffer_lock); 654 while (socket->recv_buffer_used == 0 ) {654 while (socket->recv_buffer_used == 0 && socket->recv_error == TCP_EOK) { 655 655 log_msg(LVL_DEBUG, "wait for recv_buffer_cv + recv_buffer_used != 0"); 656 656 fibril_condvar_wait(&socket->recv_buffer_cv, … … 850 850 if (trc != TCP_EOK) { 851 851 sock->recv_error = trc; 852 fibril_condvar_broadcast(&sock->recv_buffer_cv); 852 853 fibril_mutex_unlock(&sock->recv_buffer_lock); 854 tcp_sock_notify_data(sock->sock_core); 853 855 break; 854 856 } … … 857 859 858 860 sock->recv_buffer_used = data_len; 861 fibril_condvar_broadcast(&sock->recv_buffer_cv); 859 862 fibril_mutex_unlock(&sock->recv_buffer_lock); 860 fibril_condvar_broadcast(&sock->recv_buffer_cv);861 863 tcp_sock_notify_data(sock->sock_core); 862 864 }
Note:
See TracChangeset
for help on using the changeset viewer.