mirror of
https://github.com/emqx/neuron.git
synced 2026-10-28 22:59:34 +08:00
fix(conn): lock conn buf
This commit is contained in:
@@ -1289,10 +1289,12 @@ int neu_conn_stream_consume(neu_conn_t *conn, void *context,
|
||||
neu_conn_disconnect(conn);
|
||||
break;
|
||||
} else {
|
||||
pthread_mutex_lock(&conn->mtx);
|
||||
conn->offset -= used;
|
||||
memmove(conn->buf, conn->buf + used, conn->offset);
|
||||
neu_protocol_unpack_buf_init(&protocol_buf, conn->buf,
|
||||
conn->offset);
|
||||
pthread_mutex_unlock(&conn->mtx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user