Changeset 6e88fea in mainline for uspace/srv/net/tl/tcp/conn.c


Ignore:
Timestamp:
2011-10-24T05:28:31Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2a3214e
Parents:
6df418c4
Message:

Transition to CLOSED state.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/tl/tcp/conn.c

    r6df418c4 r6e88fea  
    120120}
    121121
     122/** Delist connection.
     123 *
     124 * Remove connection from the connection map.
     125 */
     126void tcp_conn_remove(tcp_conn_t *conn)
     127{
     128        list_remove(&conn->link);
     129}
     130
    122131/** Synchronize connection.
    123132 *
     
    150159                break;
    151160        case st_close_wait:
    152                 log_msg(LVL_DEBUG, "FIN sent -> Close-Wait");
     161                log_msg(LVL_DEBUG, "FIN sent -> Last-Ack");
    153162                conn->cstate = st_last_ack;
    154163                break;
     
    596605                return cp_done;
    597606
    598         /* TODO */
     607        if (conn->fin_is_acked) {
     608                log_msg(LVL_DEBUG, " FIN acked -> Closed");
     609                tcp_conn_remove(conn);
     610                conn->cstate = st_closed;
     611                return cp_done;
     612        }
     613
    599614        return cp_continue;
    600615}
     
    762777        if (tcp_segment_text_size(seg) == 0 && (seg->ctrl & CTL_FIN) != 0) {
    763778                log_msg(LVL_DEBUG, " - FIN found in segment.");
     779
     780                /* Send ACK */
     781                tcp_tqueue_ctrl_seg(conn, CTL_ACK);
    764782
    765783                conn->rcv_nxt++;
Note: See TracChangeset for help on using the changeset viewer.