Changeset 0c2d9bb in mainline for uspace/srv/net/tcp/ucall.c


Ignore:
Timestamp:
2013-12-25T22:54:29Z (10 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b51cf2c
Parents:
f7a33de (diff), ac36aed (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.
Message:

merge mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/tcp/ucall.c

    rf7a33de r0c2d9bb  
    8383
    8484        if (oflags == tcp_open_nonblock) {
     85                log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_open -> %p", nconn);
    8586                *conn = nconn;
    8687                return TCP_EOK;
     
    234235tcp_error_t tcp_uc_close(tcp_conn_t *conn)
    235236{
    236         log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_uc_close()", conn->name);
     237        log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_uc_close(%p)", conn->name,
     238            conn);
    237239
    238240        fibril_mutex_lock(&conn->lock);
    239241
    240242        if (conn->cstate == st_closed) {
     243                log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_close - ENOTEXIST");
    241244                fibril_mutex_unlock(&conn->lock);
    242245                return TCP_ENOTEXIST;
    243246        }
    244247
     248        if (conn->cstate == st_listen || conn->cstate == st_syn_sent) {
     249                log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_close - listen/syn_sent");
     250                tcp_conn_reset(conn);
     251                tcp_conn_remove(conn);
     252                return TCP_EOK;
     253        }
     254
    245255        if (conn->snd_buf_fin) {
     256                log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_close - ECLOSING");
    246257                fibril_mutex_unlock(&conn->lock);
    247258                return TCP_ECLOSING;
    248259        }
    249260
     261        log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_uc_close - set snd_buf_fin");
    250262        conn->snd_buf_fin = true;
    251263        tcp_tqueue_new_data(conn);
Note: See TracChangeset for help on using the changeset viewer.