Skip to content

Commit 2fa6e44

Browse files
committed
* MDF [mqtt/protocol/transport] use new nng api to eliminate warnings
Signed-off-by: Jaylin <jaylin@emqx.io>
1 parent a27c595 commit 2fa6e44

File tree

5 files changed

+3
-10
lines changed

5 files changed

+3
-10
lines changed

src/nng.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2424,12 +2424,6 @@ nng_msg_set_cmd_type(nng_msg *m, uint8_t cmd)
24242424
nni_msg_set_cmd_type(m, cmd);
24252425
}
24262426

2427-
uint8_t
2428-
nng_msg_get_cmd_type(nng_msg *m)
2429-
{
2430-
return nni_msg_get_cmd_type(m);
2431-
}
2432-
24332427
const char *
24342428
conn_param_get_clientid(conn_param *cparam)
24352429
{

src/sp/protocol/mqtt/nmq_mqtt.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ nano_pipe_timer_cb(void *arg)
212212
nni_qos_db_remove_unused_msg(
213213
is_sqlite, old->nano_qos_db);
214214
#endif
215-
log_error("remove pipe %ld", p->pipe->p_id);
216215
nni_id_remove(
217216
&s->cached_sessions, p->pipe->p_id);
218217
}

src/sp/transport/mqtt/broker_tcp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ tcptran_pipe_init(void *arg, nni_pipe *npipe)
192192

193193
nni_pipe_set_conn_param(npipe, p->tcp_cparam);
194194
cid = (char *) conn_param_get_clientid(p->tcp_cparam);
195-
clientid_key = DJBHashn(cid, strlen(cid));
195+
clientid_key = DJBHashn(cid, conn_param_get_clientid_len(p->tcp_cparam));
196196
rv = nni_pipe_set_pid(npipe, clientid_key);
197197
log_debug("change p_id by hashing %d rv %d", clientid_key, rv);
198198
p->npipe = npipe;

src/sp/transport/mqtts/broker_tls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ tlstran_pipe_init(void *arg, nni_pipe *npipe)
195195

196196
nni_pipe_set_conn_param(npipe, p->tcp_cparam);
197197
cid = (char *) conn_param_get_clientid(p->tcp_cparam);
198-
clientid_key = DJBHashn(cid, strlen(cid));
198+
clientid_key = DJBHashn(cid, conn_param_get_clientid_len(p->tcp_cparam));
199199
rv = nni_pipe_set_pid(npipe, clientid_key);
200200
log_debug("change p_id by hashing %d rv %d", clientid_key, rv);
201201
p->npipe = npipe;

src/sp/transport/mqttws/nmq_websocket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ wstran_pipe_init(void *arg, nni_pipe *pipe)
11681168
char *cid;
11691169
uint32_t clientid_key = 0;
11701170
cid = (char *) conn_param_get_clientid(p->ws_param);
1171-
clientid_key = DJBHashn(cid, strlen(cid));
1171+
clientid_key = DJBHashn(cid, conn_param_get_clientid_len(p->ws_param));
11721172
id = nni_pipe_id(pipe);
11731173
rv = nni_pipe_set_pid(pipe, clientid_key);
11741174
log_debug("change p_id by hashing from %d to %d rv %d",

0 commit comments

Comments
 (0)