• Home
  • Raw
  • Download

Lines Matching refs:pub

459 lws_mqtt_is_topic_matched(const char* sub, const char* pub)  in lws_mqtt_is_topic_matched()  argument
461 const char *ppos = pub, *spos = sub; in lws_mqtt_is_topic_matched()
471 __func__, pub); in lws_mqtt_is_topic_matched()
838 lws_mqtt_publish_param_t *pub = NULL; in _lws_mqtt_rx_parser() local
868 pub = (lws_mqtt_publish_param_t *)wsi->mqtt->rx_cpkt_param; in _lws_mqtt_rx_parser()
870 pub->topic_len = (uint16_t)par->n; in _lws_mqtt_rx_parser()
873 pub->topic = (char *)lws_zalloc((size_t)pub->topic_len + 1, in _lws_mqtt_rx_parser()
875 if (!pub->topic) in _lws_mqtt_rx_parser()
877 lws_strncpy(pub->topic, (const char *)buf, in _lws_mqtt_rx_parser()
878 (size_t)pub->topic_len + 1); in _lws_mqtt_rx_parser()
879 buf += pub->topic_len; in _lws_mqtt_rx_parser()
880 len -= pub->topic_len; in _lws_mqtt_rx_parser()
883 pub->qos = (lws_mqtt_qos_levels_t) in _lws_mqtt_rx_parser()
886 pub->payload_pos = 0; in _lws_mqtt_rx_parser()
888 pub->payload_len = par->cpkt_remlen - in _lws_mqtt_rx_parser()
889 (unsigned int)(2 + pub->topic_len + ((pub->qos) ? 2 : 0)); in _lws_mqtt_rx_parser()
891 switch (pub->qos) { in _lws_mqtt_rx_parser()
894 if (pub->payload_len == 0) in _lws_mqtt_rx_parser()
904 lws_free_set_NULL(pub->topic); in _lws_mqtt_rx_parser()
912 lws_mqtt_publish_param_t *pub = in _lws_mqtt_rx_parser() local
927 pub->payload_pos = 0; in _lws_mqtt_rx_parser()
928 pub->payload_len = par->cpkt_remlen - in _lws_mqtt_rx_parser()
929 (unsigned int)(2 + pub->topic_len + ((pub->qos) ? 2 : 0)); in _lws_mqtt_rx_parser()
930 if (pub->payload_len == 0) in _lws_mqtt_rx_parser()
937 lws_mqtt_publish_param_t *pub = in _lws_mqtt_rx_parser() local
939 if (pub == NULL) { in _lws_mqtt_rx_parser()
945 pub->payload = buf; in _lws_mqtt_rx_parser()
1626 lws_mqtt_publish_param_t *pub = in _lws_mqtt_rx_parser() local
1631 if (pub == NULL) { in _lws_mqtt_rx_parser()
1643 chunk = pub->payload_len - pub->payload_pos; in _lws_mqtt_rx_parser()
1650 pub->topic)) in _lws_mqtt_rx_parser()
1654 (void *)pub, in _lws_mqtt_rx_parser()
1657 lws_free_set_NULL(pub->topic); in _lws_mqtt_rx_parser()
1664 pub->payload_pos += (uint32_t)chunk; in _lws_mqtt_rx_parser()
1669 __func__, (int)pub->payload_pos, in _lws_mqtt_rx_parser()
1670 (int)pub->payload_len, (int)len); in _lws_mqtt_rx_parser()
1672 if (pub->payload_pos != pub->payload_len) { in _lws_mqtt_rx_parser()
1682 if (pub->qos == 1) { in _lws_mqtt_rx_parser()
1686 } else if (pub->qos == 2) { in _lws_mqtt_rx_parser()
1693 lws_free_set_NULL(pub->topic); in _lws_mqtt_rx_parser()
1957 lws_mqtt_client_send_publish(struct lws *wsi, lws_mqtt_publish_param_t *pub, in lws_mqtt_client_send_publish() argument
1966 assert(pub->topic); in lws_mqtt_client_send_publish()
1998 pub->dup, pub->qos, pub->retain)) { in lws_mqtt_client_send_publish()
2007 vh_len = (unsigned int)(2 + pub->topic_len + ((pub->qos) ? 2 : 0)); in lws_mqtt_client_send_publish()
2008 rem_len = vh_len + pub->payload_len; in lws_mqtt_client_send_publish()
2021 lws_ser_wu16be(p, pub->topic_len); in lws_mqtt_client_send_publish()
2030 (uint16_t)(unsigned int)(pub->topic_len + ((pub->qos) ? 2u : 0u) + len), in lws_mqtt_client_send_publish()
2034 lws_strncpy((char *)p, pub->topic, (size_t)pub->topic_len+1); in lws_mqtt_client_send_publish()
2035 if (lws_mqtt_str_advance(&mqtt_vh_payload, pub->topic_len)) { in lws_mqtt_client_send_publish()
2041 if (pub->qos != QOS0) { in lws_mqtt_client_send_publish()
2043 if (!pub->dup) in lws_mqtt_client_send_publish()
2045 wsi->mqtt->ack_pkt_id = pub->packet_id = nwsi->mqtt->pkt_id; in lws_mqtt_client_send_publish()
2048 lws_ser_wu16be(p, pub->packet_id); in lws_mqtt_client_send_publish()
2083 if (pub->qos != QOS0) in lws_mqtt_client_send_publish()
2088 if (pub->qos == QOS0) { in lws_mqtt_client_send_publish()
2099 } else if (pub->qos == QOS1 || pub->qos == QOS2) { in lws_mqtt_client_send_publish()