Skip to content

Commit 0cd901d

Browse files
committed
* FIX [nmq_websocket] put valid msg into msg_vec
Signed-off-by: Jaylin <jaylin@emqx.io>
1 parent 53cd0d7 commit 0cd901d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/sp/transport/mqttws/nmq_websocket.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,6 @@ wstran_pipe_recv_cb(void *arg)
311311
goto skip;
312312
}
313313
p->count++;
314-
log_error("count %d", p->count);
315314
// parse fixed header (safe because pkt_len bytes are present)
316315
ws_msg_adaptor(baseptr + index, new);
317316
nni_msg_set_conn_param(new, p->ws_param);
@@ -321,9 +320,12 @@ wstran_pipe_recv_cb(void *arg)
321320
if (nni_lmq_put(&p->recvlmq, new) != 0) {
322321
log_warn(" WebSocket msg drop due to full lmq");
323322
nni_msg_free(new);
323+
new = NULL;
324324
}
325325
}
326-
cvector_push_back(msg_vec, new);
326+
if (msg_vec != NULL) {
327+
cvector_push_back(msg_vec, new);
328+
}
327329
index += pkt_len;
328330
}
329331

0 commit comments

Comments
 (0)