Skip to content
Snippets Groups Projects
Commit 6760103c authored by deuce's avatar deuce
Browse files

Fix recv_upto()

parent 5901cf70
No related branches found
No related tags found
No related merge requests found
......@@ -245,12 +245,11 @@ BOOL conn_connected(void)
int conn_recv_upto(char *buffer, size_t buflen, unsigned timeout)
{
size_t found;
size_t found;
pthread_mutex_lock(&(conn_inbuf.mutex));
found=conn_buf_wait_bytes(&conn_inbuf, 1, timeout);
if(found)
found=conn_buf_get(&conn_inbuf, buffer, found);
if(conn_buf_wait_bytes(&conn_inbuf, 1, timeout))
found=conn_buf_get(&conn_inbuf, buffer, buflen);
pthread_mutex_unlock(&(conn_inbuf.mutex));
return(found);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment