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