Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 204ba47 in mainline


Ignore:
Timestamp:
2015-06-08T13:16:48Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
1f2b07a
Parents:
048cd69
Message:

Fix data_avail callback. Fix tcp_conn_recv(). Do not generate spurious data_avail callbacks.

Location:
uspace
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/nterm/conn.c

    r048cd69 r204ba47  
    7575                rc = tcp_conn_recv(conn, recv_buf, RECV_BUF_SIZE, &nrecv);
    7676                if (rc != EOK) {
    77                         printf("\n[Receive error]\n");
     77                        printf("\n[Receive error %d]\n", rc);
    7878                        break;
    7979                }
  • uspace/lib/c/generic/inet/tcp.c

    r048cd69 r204ba47  
    525525        fibril_condvar_broadcast(&conn->cv);
    526526
     527        if (conn->cb != NULL && conn->cb->data_avail != NULL)
     528                conn->cb->data_avail(conn);
     529
    527530        async_answer_0(iid, EOK);
    528531}
  • uspace/srv/net/tcp/conn.c

    r048cd69 r204ba47  
    10111011
    10121012        /* Signal to the receive function that new data has arrived */
    1013         fibril_condvar_broadcast(&conn->rcv_buf_cv);
    1014         if (conn->cb != NULL && conn->cb->recv_data != NULL)
    1015                 conn->cb->recv_data(conn, conn->cb_arg);
     1013        if (xfer_size > 0) {
     1014                fibril_condvar_broadcast(&conn->rcv_buf_cv);
     1015                if (conn->cb != NULL && conn->cb->recv_data != NULL)
     1016                        conn->cb->recv_data(conn, conn->cb_arg);
     1017        }
    10161018
    10171019        log_msg(LOG_DEFAULT, LVL_DEBUG, "Received %zu bytes of data.", xfer_size);
  • uspace/srv/net/tcp/service.c

    r048cd69 r204ba47  
    769769        }
    770770
    771         size = max(size, 16384);
     771        size = min(size, 16384);
    772772        data = malloc(size);
    773773        if (data == NULL) {
Note: See TracChangeset for help on using the changeset viewer.