|
|
|
@ -46,9 +46,9 @@ int send__pingreq(struct mosquitto *mosq)
|
|
|
|
|
int rc;
|
|
|
|
|
assert(mosq);
|
|
|
|
|
#ifdef WITH_BROKER
|
|
|
|
|
log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PINGREQ to %s", mosq->id);
|
|
|
|
|
log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PINGREQ to %s", SAFE_PRINT(mosq->id));
|
|
|
|
|
#else
|
|
|
|
|
log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PINGREQ", mosq->id);
|
|
|
|
|
log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PINGREQ", SAFE_PRINT(mosq->id));
|
|
|
|
|
#endif
|
|
|
|
|
rc = send__simple_command(mosq, CMD_PINGREQ);
|
|
|
|
|
if(rc == MOSQ_ERR_SUCCESS){
|
|
|
|
@ -60,9 +60,9 @@ int send__pingreq(struct mosquitto *mosq)
|
|
|
|
|
int send__pingresp(struct mosquitto *mosq)
|
|
|
|
|
{
|
|
|
|
|
#ifdef WITH_BROKER
|
|
|
|
|
log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PINGRESP to %s", mosq->id);
|
|
|
|
|
log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PINGRESP to %s", SAFE_PRINT(mosq->id));
|
|
|
|
|
#else
|
|
|
|
|
log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PINGRESP", mosq->id);
|
|
|
|
|
log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PINGRESP", SAFE_PRINT(mosq->id));
|
|
|
|
|
#endif
|
|
|
|
|
return send__simple_command(mosq, CMD_PINGRESP);
|
|
|
|
|
}
|
|
|
|
@ -70,9 +70,9 @@ int send__pingresp(struct mosquitto *mosq)
|
|
|
|
|
int send__puback(struct mosquitto *mosq, uint16_t mid, uint8_t reason_code, const mosquitto_property *properties)
|
|
|
|
|
{
|
|
|
|
|
#ifdef WITH_BROKER
|
|
|
|
|
log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBACK to %s (m%d, rc%d)", mosq->id, mid, reason_code);
|
|
|
|
|
log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBACK to %s (m%d, rc%d)", SAFE_PRINT(mosq->id), mid, reason_code);
|
|
|
|
|
#else
|
|
|
|
|
log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBACK (m%d, rc%d)", mosq->id, mid, reason_code);
|
|
|
|
|
log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBACK (m%d, rc%d)", SAFE_PRINT(mosq->id), mid, reason_code);
|
|
|
|
|
#endif
|
|
|
|
|
util__increment_receive_quota(mosq);
|
|
|
|
|
/* We don't use Reason String or User Property yet. */
|
|
|
|
@ -82,9 +82,9 @@ int send__puback(struct mosquitto *mosq, uint16_t mid, uint8_t reason_code, cons
|
|
|
|
|
int send__pubcomp(struct mosquitto *mosq, uint16_t mid, const mosquitto_property *properties)
|
|
|
|
|
{
|
|
|
|
|
#ifdef WITH_BROKER
|
|
|
|
|
log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBCOMP to %s (m%d)", mosq->id, mid);
|
|
|
|
|
log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBCOMP to %s (m%d)", SAFE_PRINT(mosq->id), mid);
|
|
|
|
|
#else
|
|
|
|
|
log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBCOMP (m%d)", mosq->id, mid);
|
|
|
|
|
log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBCOMP (m%d)", SAFE_PRINT(mosq->id), mid);
|
|
|
|
|
#endif
|
|
|
|
|
util__increment_receive_quota(mosq);
|
|
|
|
|
/* We don't use Reason String or User Property yet. */
|
|
|
|
@ -95,9 +95,9 @@ int send__pubcomp(struct mosquitto *mosq, uint16_t mid, const mosquitto_property
|
|
|
|
|
int send__pubrec(struct mosquitto *mosq, uint16_t mid, uint8_t reason_code, const mosquitto_property *properties)
|
|
|
|
|
{
|
|
|
|
|
#ifdef WITH_BROKER
|
|
|
|
|
log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBREC to %s (m%d, rc%d)", mosq->id, mid, reason_code);
|
|
|
|
|
log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBREC to %s (m%d, rc%d)", SAFE_PRINT(mosq->id), mid, reason_code);
|
|
|
|
|
#else
|
|
|
|
|
log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBREC (m%d, rc%d)", mosq->id, mid, reason_code);
|
|
|
|
|
log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBREC (m%d, rc%d)", SAFE_PRINT(mosq->id), mid, reason_code);
|
|
|
|
|
#endif
|
|
|
|
|
if(reason_code >= 0x80 && mosq->protocol == mosq_p_mqtt5){
|
|
|
|
|
util__increment_receive_quota(mosq);
|
|
|
|
@ -109,9 +109,9 @@ int send__pubrec(struct mosquitto *mosq, uint16_t mid, uint8_t reason_code, cons
|
|
|
|
|
int send__pubrel(struct mosquitto *mosq, uint16_t mid, const mosquitto_property *properties)
|
|
|
|
|
{
|
|
|
|
|
#ifdef WITH_BROKER
|
|
|
|
|
log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBREL to %s (m%d)", mosq->id, mid);
|
|
|
|
|
log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBREL to %s (m%d)", SAFE_PRINT(mosq->id), mid);
|
|
|
|
|
#else
|
|
|
|
|
log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBREL (m%d)", mosq->id, mid);
|
|
|
|
|
log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBREL (m%d)", SAFE_PRINT(mosq->id), mid);
|
|
|
|
|
#endif
|
|
|
|
|
/* We don't use Reason String or User Property yet. */
|
|
|
|
|
return send__command_with_mid(mosq, CMD_PUBREL|2, mid, false, 0, properties);
|
|
|
|
|