Changeset 4c14b88 in mainline for uspace/srv/net/tcp/sock.c


Ignore:
Timestamp:
2013-12-31T07:57:14Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1b973dc
Parents:
6297465 (diff), 208b5f5 (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:

mainline changes

File:
1 edited

Legend:

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

    r6297465 r4c14b88  
    882882        tcp_sockdata_t *socket;
    883883        tcp_error_t trc;
     884        int i;
    884885        int rc;
    885886
     
    897898
    898899        if (socket->conn != NULL) {
     900                /* Close connection */
    899901                trc = tcp_uc_close(socket->conn);
    900902                if (trc != TCP_EOK && trc != TCP_ENOTEXIST) {
     
    905907        }
    906908
     909        if (socket->lconn != NULL) {
     910                /* Close listening connections */
     911                for (i = 0; i < socket->backlog; i++) {
     912                        tcp_uc_set_cstate_cb(socket->lconn[i]->conn, NULL, NULL);
     913                        trc = tcp_uc_close(socket->lconn[i]->conn);
     914                        if (trc != TCP_EOK && trc != TCP_ENOTEXIST) {
     915                                fibril_mutex_unlock(&socket->lock);
     916                                async_answer_0(callid, EBADF);
     917                                return;
     918                        }
     919
     920                        free(socket->lconn[i]);
     921                        socket->lconn[i] = NULL;
     922                }
     923        }
     924
    907925        /* Grab recv_buffer_lock because of CV wait in tcp_sock_recv_fibril() */
    908926        fibril_mutex_lock(&socket->recv_buffer_lock);
Note: See TracChangeset for help on using the changeset viewer.