Fix for partial read operations.
This commit is contained in:
parent
1b56adb8c0
commit
5e6879dffb
@ -58,7 +58,11 @@ int handle_net_read(struct hub_user* user)
|
|||||||
static char buf[MAX_RECV_BUF];
|
static char buf[MAX_RECV_BUF];
|
||||||
struct hub_recvq* q = user->recv_queue;
|
struct hub_recvq* q = user->recv_queue;
|
||||||
size_t buf_size = hub_recvq_get(q, buf, MAX_RECV_BUF);
|
size_t buf_size = hub_recvq_get(q, buf, MAX_RECV_BUF);
|
||||||
ssize_t size = net_con_recv(user->connection, buf, MAX_RECV_BUF);
|
ssize_t size;
|
||||||
|
|
||||||
|
if (user_flag_get(user, flag_maxbuf))
|
||||||
|
buf_size = 0;
|
||||||
|
size = net_con_recv(user->connection, buf + buf_size, MAX_RECV_BUF - buf_size);
|
||||||
|
|
||||||
if (size > 0)
|
if (size > 0)
|
||||||
buf_size += size;
|
buf_size += size;
|
||||||
|
Loading…
Reference in New Issue
Block a user