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

Changeset 415578ef in mainline


Ignore:
Timestamp:
2011-12-16T18:55:14Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
522a4f9
Parents:
e1c6dde9
Message:

Not all sockets are connected.

Location:
uspace
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/websrv/websrv.c

    re1c6dde9 r415578ef  
    304304                if (rc != EOK) {
    305305                        printf("Error closing connection socket: %d\n", rc);
     306                        closesocket(listen_sd);
    306307                        return 1;
    307308                }
  • uspace/srv/net/tl/tcp/sock.c

    re1c6dde9 r415578ef  
    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);
    616 
    617         tcp_uc_delete(socket->conn);
     605
     606        if (socket->conn != NULL) {
     607                rc = tcp_uc_close(socket->conn);
     608                if (rc != EOK) {
     609                        async_answer_0(callid, rc);
     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        }
    618621
    619622        rc = socket_destroy(net_sess, socket_id, &client->sockets, &gsock,
Note: See TracChangeset for help on using the changeset viewer.