Changeset a438de4 in mainline for uspace/srv/net/tl/tcp/sock.c


Ignore:
Timestamp:
2011-12-19T18:50:17Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1440eae, d9cf684a
Parents:
58f6229 (diff), 522a4f9 (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 TCP improvements.

File:
1 edited

Legend:

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

    r58f6229 ra438de4  
    603603
    604604        socket = (tcp_sockdata_t *)sock_core->specific_data;
    605         rc = tcp_uc_close(socket->conn);
    606         if (rc != EOK) {
    607                 async_answer_0(callid, rc);
    608                 return;
    609         }
    610 
    611         /* Drain incoming data. This should really be done in the background. */
    612         do {
    613                 trc = tcp_uc_receive(socket->conn, buffer, FRAGMENT_SIZE,
    614                     &data_len, &xflags);
    615         } while (trc == TCP_EOK);
     605
     606        if (socket->conn != NULL) {
     607                trc = tcp_uc_close(socket->conn);
     608                if (trc != TCP_EOK && trc != TCP_ENOTEXIST) {
     609                        async_answer_0(callid, EBADF);
     610                        return;
     611                }
     612
     613                /* Drain incoming data. This should really be done in the background. */
     614                do {
     615                        trc = tcp_uc_receive(socket->conn, buffer,
     616                            FRAGMENT_SIZE, &data_len, &xflags);
     617                } while (trc == TCP_EOK);
     618
     619                tcp_uc_delete(socket->conn);
     620        }
    616621
    617622        rc = socket_destroy(net_sess, socket_id, &client->sockets, &gsock,
Note: See TracChangeset for help on using the changeset viewer.