mirror of
https://github.com/emqx/neuron.git
synced 2026-10-22 01:05:56 +08:00
Merge pull request #1572 from fengzeroz/main
fix(connection): server consume
This commit is contained in:
@@ -1295,15 +1295,13 @@ int neu_conn_stream_tcp_server_consume(neu_conn_t *conn, int fd, void *context,
|
||||
} else if (used == -1) {
|
||||
neu_conn_tcp_server_close_client(conn, fd);
|
||||
break;
|
||||
} else {
|
||||
conn->offset -= used;
|
||||
memmove(conn->buf, conn->buf + used, conn->offset);
|
||||
neu_protocol_unpack_buf_init(&protocol_buf, conn->buf,
|
||||
conn->offset);
|
||||
}
|
||||
}
|
||||
if (conn->offset != 0) {
|
||||
conn->offset -= neu_protocol_unpack_buf_used_size(&protocol_buf);
|
||||
memmove(conn->buf,
|
||||
conn->buf +
|
||||
neu_protocol_unpack_buf_used_size(&protocol_buf),
|
||||
conn->offset);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user