Changeset 704586fb in mainline for uspace/srv/net/tl/tcp/conn.c
- Timestamp:
- 2011-12-01T19:28:49Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3aa2642a
- Parents:
- 26ec91c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tl/tcp/conn.c
r26ec91c r704586fb 59 59 static void tcp_conn_seg_process(tcp_conn_t *conn, tcp_segment_t *seg); 60 60 static void tcp_conn_tw_timer_set(tcp_conn_t *conn); 61 static void tcp_conn_tw_timer_clear(tcp_conn_t *conn); 61 62 62 63 /** Create new segment structure. … … 255 256 list_foreach(conn_list, link) { 256 257 tcp_conn_t *conn = list_get_instance(link, tcp_conn_t, link); 257 if (tcp_sockpair_match(sp, &conn->ident)) { 258 tcp_sockpair_t *csp = &conn->ident; 259 log_msg(LVL_DEBUG, "compare with conn (f:(%x,%u), l:(%x,%u))", 260 csp->foreign.addr.ipv4, csp->foreign.port, 261 csp->local.addr.ipv4, csp->local.port); 262 if (tcp_sockpair_match(sp, csp)) { 258 263 return conn; 259 264 } … … 261 266 262 267 return NULL; 268 } 269 270 /** Reset connection. 271 * 272 * @param conn Connection 273 */ 274 static void tcp_conn_reset(tcp_conn_t *conn) 275 { 276 log_msg(LVL_DEBUG, "%s: tcp_conn_reset()", conn->name); 277 tcp_conn_state_set(conn, st_closed); 278 tcp_conn_tw_timer_clear(conn); 279 tcp_tqueue_clear(&conn->retransmit); 263 280 } 264 281 … … 370 387 log_msg(LVL_DEBUG, "%s: Connection reset. -> Closed", 371 388 conn->name); 372 /* XXX Signal user error*/373 tcp_conn_ state_set(conn, st_closed);389 /* Reset connection */ 390 tcp_conn_reset(conn); 374 391 /* XXX delete connection */ 375 392 return; … … 1003 1020 1004 1021 log_msg(LVL_DEBUG, "tw_timeout_func(%p)", conn); 1022 1023 if (conn->cstate == st_closed) { 1024 log_msg(LVL_DEBUG, "Connection already closed."); 1025 return; 1026 } 1027 1005 1028 log_msg(LVL_DEBUG, "%s: TW Timeout -> Closed", conn->name); 1006 1007 1029 tcp_conn_remove(conn); 1008 1030 tcp_conn_state_set(conn, st_closed); … … 1019 1041 } 1020 1042 1043 /** Clear the Time-Wait timeout. 1044 * 1045 * @param conn Connection 1046 */ 1047 void tcp_conn_tw_timer_clear(tcp_conn_t *conn) 1048 { 1049 fibril_timer_clear(conn->tw_timer); 1050 } 1051 1021 1052 /** Trim segment to the receive window. 1022 1053 * … … 1067 1098 void tcp_reply_rst(tcp_sockpair_t *sp, tcp_segment_t *seg) 1068 1099 { 1069 tcp_sockpair_t rsp;1070 1100 tcp_segment_t *rseg; 1071 1101 1072 1102 log_msg(LVL_DEBUG, "tcp_reply_rst(%p, %p)", sp, seg); 1073 1103 1074 tcp_sockpair_flipped(sp, &rsp);1075 1104 rseg = tcp_segment_make_rst(seg); 1076 tcp_transmit_segment( &rsp, rseg);1105 tcp_transmit_segment(sp, rseg); 1077 1106 } 1078 1107
Note:
See TracChangeset
for help on using the changeset viewer.