Changes in uspace/srv/net/tcp/sock.c [1038a9c:798105ca] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tcp/sock.c
r1038a9c r798105ca 151 151 sock, sock_id); 152 152 153 if (rc != EOK) 153 if (rc != EOK) { 154 fibril_destroy(sock->recv_fibril); 155 sock->recv_fibril = 0; 154 156 return rc; 157 } 155 158 156 159 sock_core = socket_cores_find(&sock->client->sockets, *sock_id); … … 776 779 } 777 780 781 /* Grab recv_buffer_lock because of CV wait in tcp_sock_recv_fibril() */ 782 fibril_mutex_lock(&socket->recv_buffer_lock); 783 socket->sock_core = NULL; 784 fibril_mutex_unlock(&socket->recv_buffer_lock); 785 778 786 rc = socket_destroy(NULL, socket_id, &client->sockets, &gsock, 779 787 tcp_free_sock_data); … … 836 844 log_msg(LVL_DEBUG, "tcp_sock_recv_fibril()"); 837 845 846 fibril_mutex_lock(&sock->recv_buffer_lock); 847 838 848 while (true) { 839 849 log_msg(LVL_DEBUG, "call tcp_uc_receive()"); 840 fibril_mutex_lock(&sock->recv_buffer_lock); 841 while (sock->recv_buffer_used != 0) 850 while (sock->recv_buffer_used != 0 && sock->sock_core != NULL) 842 851 fibril_condvar_wait(&sock->recv_buffer_cv, 843 852 &sock->recv_buffer_lock); … … 849 858 sock->recv_error = trc; 850 859 fibril_condvar_broadcast(&sock->recv_buffer_cv); 851 fibril_mutex_unlock(&sock->recv_buffer_lock);852 tcp_sock_notify_data(sock->sock_core);860 if (sock->sock_core != NULL) 861 tcp_sock_notify_data(sock->sock_core); 853 862 break; 854 863 } … … 858 867 sock->recv_buffer_used = data_len; 859 868 fibril_condvar_broadcast(&sock->recv_buffer_cv); 860 fibril_mutex_unlock(&sock->recv_buffer_lock); 861 tcp_sock_notify_data(sock->sock_core); 862 } 869 if (sock->sock_core != NULL) 870 tcp_sock_notify_data(sock->sock_core); 871 } 872 873 fibril_mutex_unlock(&sock->recv_buffer_lock); 863 874 864 875 tcp_uc_delete(sock->conn);
Note:
See TracChangeset
for help on using the changeset viewer.