Ignore:
Timestamp:
2010-12-27T19:16:47Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
727f04f
Parents:
58fe0aa
Message:

Fix incoming TCP FIN handling. Signal end of data on the socket. Do not ACK if no new data arrived.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/net/socket_client.c

    r58fe0aa rd493830e  
    10061006        // wait for a received packet
    10071007        ++socket->blocked;
    1008         while ((result = dyn_fifo_value(&socket->received)) <= 0) {
     1008        while ((result = dyn_fifo_value(&socket->received)) < 0) {
    10091009                fibril_rwlock_read_unlock(&socket_globals.lock);
    10101010                fibril_condvar_wait(&socket->receive_signal,
     
    10181018        --socket->blocked;
    10191019        fragments = (size_t) result;
     1020
     1021        if (fragments == 0) {
     1022                /* No more data, other side has closed the connection. */
     1023                return 0;
     1024        }
    10201025
    10211026        // prepare lengths if more fragments
     
    10571062
    10581063                free(lengths);
    1059         } else {
     1064        } else { /* fragments == 1 */
    10601065                // request packet data
    10611066                message_id = async_send_4(socket->phone, message,
Note: See TracChangeset for help on using the changeset viewer.