Lines Matching refs:mqtt
32 if (h->u.mqtt.heap_baggage) { in secstream_mqtt_cleanup()
33 lws_free(h->u.mqtt.heap_baggage); in secstream_mqtt_cleanup()
34 h->u.mqtt.heap_baggage = NULL; in secstream_mqtt_cleanup()
37 if (h->u.mqtt.sub_info.topic) { in secstream_mqtt_cleanup()
38 for (i = 0; i < h->u.mqtt.sub_info.num_topics; i++) { in secstream_mqtt_cleanup()
39 if (h->u.mqtt.sub_info.topic[i].name) { in secstream_mqtt_cleanup()
40 lws_free((void*)h->u.mqtt.sub_info.topic[i].name); in secstream_mqtt_cleanup()
41 h->u.mqtt.sub_info.topic[i].name = NULL; in secstream_mqtt_cleanup()
44 lws_free(h->u.mqtt.sub_info.topic); in secstream_mqtt_cleanup()
45 h->u.mqtt.sub_info.topic = NULL; in secstream_mqtt_cleanup()
60 if (h->policy->u.mqtt.aws_iot) in secstream_mqtt_subscribe()
65 if (!h->policy->u.mqtt.subscribe || wsi->mqtt->done_subscribe) in secstream_mqtt_subscribe()
75 if (lws_strexp_expand(&exp, h->policy->u.mqtt.subscribe, in secstream_mqtt_subscribe()
76 strlen(h->policy->u.mqtt.subscribe), &used_in, in secstream_mqtt_subscribe()
97 if (lws_strexp_expand(&exp, h->policy->u.mqtt.subscribe, in secstream_mqtt_subscribe()
98 strlen(h->policy->u.mqtt.subscribe), &used_in, in secstream_mqtt_subscribe()
106 h->u.mqtt.sub_top.name = expbuf; in secstream_mqtt_subscribe()
115 h->u.mqtt.sub_top.name); in secstream_mqtt_subscribe()
117 h->u.mqtt.sub_top.qos = h->policy->u.mqtt.qos; in secstream_mqtt_subscribe()
118 memset(&h->u.mqtt.sub_info, 0, sizeof(h->u.mqtt.sub_info)); in secstream_mqtt_subscribe()
119 h->u.mqtt.sub_info.num_topics = 1; in secstream_mqtt_subscribe()
120 h->u.mqtt.sub_info.topic = &h->u.mqtt.sub_top; in secstream_mqtt_subscribe()
121 h->u.mqtt.sub_info.topic = in secstream_mqtt_subscribe()
123 h->u.mqtt.sub_info.topic[0].name = lws_strdup(expbuf); in secstream_mqtt_subscribe()
124 h->u.mqtt.sub_info.topic[0].qos = h->policy->u.mqtt.qos; in secstream_mqtt_subscribe()
126 if (lws_mqtt_client_send_subcribe(wsi, &h->u.mqtt.sub_info)) { in secstream_mqtt_subscribe()
129 h->u.mqtt.sub_top.name = NULL; in secstream_mqtt_subscribe()
133 h->u.mqtt.sub_top.name = NULL; in secstream_mqtt_subscribe()
154 if (h->policy->u.mqtt.aws_iot) in secstream_mqtt_publish()
199 mqpp.qos = h->policy->u.mqtt.qos; in secstream_mqtt_publish()
288 if (!h->policy->u.mqtt.subscribe || in secstream_mqtt()
289 !h->policy->u.mqtt.subscribe[0]) { in secstream_mqtt()
295 wsi->mqtt->done_subscribe = 1; in secstream_mqtt()
296 } else if (!h->policy->u.mqtt.clean_start && in secstream_mqtt()
297 wsi->mqtt->session_resumed) { in secstream_mqtt()
298 wsi->mqtt->inside_resume_session = 1; in secstream_mqtt()
304 wsi->mqtt->done_subscribe = 1; in secstream_mqtt()
305 wsi->mqtt->inside_resume_session = 0; in secstream_mqtt()
306 } else if (h->policy->u.mqtt.subscribe && in secstream_mqtt()
307 !wsi->mqtt->done_subscribe) { in secstream_mqtt()
326 if (h->policy->u.mqtt.topic) in secstream_mqtt()
357 if (wsi->mqtt->done_subscribe == 0) { in secstream_mqtt()
363 wsi->mqtt->done_subscribe = 1; in secstream_mqtt()
369 if (wsi->mqtt->inside_birth) { in secstream_mqtt()
373 wsi->mqtt->inside_birth = 0; in secstream_mqtt()
374 wsi->mqtt->done_birth = 1; in secstream_mqtt()
393 if (!wsi->mqtt->done_subscribe && h->policy->u.mqtt.subscribe) in secstream_mqtt()
396 if (!wsi->mqtt->done_birth && h->policy->u.mqtt.birth_topic) { in secstream_mqtt()
399 if (h->policy->u.mqtt.birth_message) { in secstream_mqtt()
402 if (lws_strexp_expand(&exp, h->policy->u.mqtt.birth_message, in secstream_mqtt()
403 strlen(h->policy->u.mqtt.birth_message), in secstream_mqtt()
408 wsi->mqtt->inside_birth = 1; in secstream_mqtt()
410 used_out, h->policy->u.mqtt.birth_topic, in secstream_mqtt()
411 h->policy->u.mqtt.birth_qos, LWSSS_FLAG_EOM); in secstream_mqtt()
420 if (h->u.mqtt.sub_info.num_topics) { in secstream_mqtt()
421 lmsp.num_topics = h->u.mqtt.sub_info.num_topics; in secstream_mqtt()
422 lmsp.topic = h->u.mqtt.sub_info.topic; in secstream_mqtt()
438 h->policy->u.mqtt.topic, in secstream_mqtt()
439 h->policy->u.mqtt.qos, f); in secstream_mqtt()
451 if (wsi->mqtt->inside_unsubscribe) { in secstream_mqtt()
497 h->policy->u.mqtt.will_topic, in secstream_connect_munge_mqtt()
498 h->policy->u.mqtt.will_message, in secstream_connect_munge_mqtt()
499 h->policy->u.mqtt.subscribe, in secstream_connect_munge_mqtt()
500 h->policy->u.mqtt.topic, in secstream_connect_munge_mqtt()
501 h->policy->u.mqtt.birth_topic, in secstream_connect_munge_mqtt()
502 h->policy->u.mqtt.birth_message in secstream_connect_munge_mqtt()
575 ct->ccp.keep_alive = h->policy->u.mqtt.keep_alive; in secstream_connect_munge_mqtt()
576 ct->ccp.clean_start = (h->policy->u.mqtt.clean_start & 1u); in secstream_connect_munge_mqtt()
577 ct->ccp.will_param.qos = h->policy->u.mqtt.will_qos; in secstream_connect_munge_mqtt()
578 ct->ccp.will_param.retain = h->policy->u.mqtt.will_retain; in secstream_connect_munge_mqtt()
579 ct->ccp.birth_param.qos = h->policy->u.mqtt.birth_qos; in secstream_connect_munge_mqtt()
580 ct->ccp.birth_param.retain = h->policy->u.mqtt.birth_retain; in secstream_connect_munge_mqtt()
581 ct->ccp.aws_iot = h->policy->u.mqtt.aws_iot; in secstream_connect_munge_mqtt()
582 h->u.mqtt.topic_qos.qos = h->policy->u.mqtt.qos; in secstream_connect_munge_mqtt()
620 h->u.mqtt.heap_baggage = lws_malloc(tot, __func__); in secstream_connect_munge_mqtt()
621 if (!h->u.mqtt.heap_baggage) in secstream_connect_munge_mqtt()
629 p = h->u.mqtt.heap_baggage; in secstream_connect_munge_mqtt()
652 h->u.mqtt.subscribe_to = ps[SSCMM_STRSUB_SUBSCRIBE]; in secstream_connect_munge_mqtt()
653 h->u.mqtt.subscribe_to_len = olen[SSCMM_STRSUB_SUBSCRIBE]; in secstream_connect_munge_mqtt()
654 h->u.mqtt.topic_qos.name = ps[SSCMM_STRSUB_TOPIC]; in secstream_connect_munge_mqtt()