Changeset 004a5fe in mainline for uspace/srv/net/tl/tcp/state.c
- Timestamp:
- 2011-11-20T19:13:53Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- eea65f4
- Parents:
- 854e79a6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/tcp/state.c
r854e79a6 r004a5fe 58 58 * connection. 59 59 */ 60 voidtcp_uc_open(uint16_t lport, tcp_sock_t *fsock, acpass_t acpass,60 tcp_error_t tcp_uc_open(uint16_t lport, tcp_sock_t *fsock, acpass_t acpass, 61 61 tcp_conn_t **conn) 62 62 { … … 77 77 /* Synchronize (initiate) connection */ 78 78 tcp_conn_sync(nconn); 79 80 /* Wait for connection to be established or reset */ 81 log_msg(LVL_DEBUG, "tcp_uc_open: Wait for connection."); 82 fibril_mutex_lock(&nconn->cstate_lock); 83 while (nconn->cstate == st_syn_sent || 84 nconn->cstate == st_syn_received) { 85 fibril_condvar_wait(&nconn->cstate_cv, &nconn->cstate_lock); 86 } 87 if (nconn->cstate != st_established) { 88 log_msg(LVL_DEBUG, "tcp_uc_open: Connection was reset."); 89 assert(nconn->cstate == st_closed); 90 fibril_mutex_unlock(&nconn->cstate_lock); 91 return TCP_ERESET; 92 } 93 fibril_mutex_unlock(&nconn->cstate_lock); 94 log_msg(LVL_DEBUG, "tcp_uc_open: Connection was established."); 79 95 } 80 96 81 97 *conn = nconn; 98 return TCP_EOK; 82 99 } 83 100
Note:
See TracChangeset
for help on using the changeset viewer.