mirror of
https://github.com/emqx/neuron.git
synced 2026-10-20 16:05:10 +08:00
fix conn stream consume
This commit is contained in:
@@ -688,12 +688,14 @@ void neu_conn_stream_consume(neu_conn_t *conn, void *context,
|
||||
memset(recv_buf, 0, sizeof(recv_buf));
|
||||
offset = 0;
|
||||
break;
|
||||
} else {
|
||||
assert(used > 0);
|
||||
offset -= used;
|
||||
memmove(recv_buf, recv_buf + used, offset);
|
||||
}
|
||||
}
|
||||
if (offset != 0) {
|
||||
offset -= neu_protocol_unpack_buf_used_size(&protocol_buf);
|
||||
memmove(recv_buf,
|
||||
recv_buf + neu_protocol_unpack_buf_used_size(&protocol_buf),
|
||||
offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -717,11 +719,13 @@ void neu_conn_stream_tcp_server_consume(neu_conn_t *conn, int fd, void *context,
|
||||
memset(recv_buf, 0, sizeof(recv_buf));
|
||||
offset = 0;
|
||||
break;
|
||||
} else {
|
||||
assert(used > 0);
|
||||
offset -= used;
|
||||
memmove(recv_buf, recv_buf + used, offset);
|
||||
}
|
||||
}
|
||||
if (offset != 0) {
|
||||
offset -= neu_protocol_unpack_buf_used_size(&protocol_buf);
|
||||
memmove(recv_buf,
|
||||
recv_buf + neu_protocol_unpack_buf_used_size(&protocol_buf),
|
||||
offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user