|
|
|
@ -268,9 +268,8 @@ static int pub_stdin_line_loop(struct mosquitto *mosq)
|
|
|
|
|
line_buf[buf_len_actual-1] = '\0';
|
|
|
|
|
rc = my_publish(mosq, &mid_sent, cfg.topic, buf_len_actual-1, line_buf, cfg.qos, cfg.retain);
|
|
|
|
|
pos = 0;
|
|
|
|
|
if(rc){
|
|
|
|
|
err_printf(&cfg, "Error: Publish returned %d.\n", rc);
|
|
|
|
|
if(cfg.qos>0) return rc;
|
|
|
|
|
if(rc != MOSQ_ERR_SUCCESS && rc != MOSQ_ERR_NO_CONN){
|
|
|
|
|
return rc;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}else{
|
|
|
|
@ -288,7 +287,6 @@ static int pub_stdin_line_loop(struct mosquitto *mosq)
|
|
|
|
|
if(pos != 0){
|
|
|
|
|
rc = my_publish(mosq, &mid_sent, cfg.topic, buf_len_actual, line_buf, cfg.qos, cfg.retain);
|
|
|
|
|
if(rc){
|
|
|
|
|
err_printf(&cfg, "Error: Publish returned %d.\n", rc);
|
|
|
|
|
if(cfg.qos>0) return rc;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -357,7 +355,7 @@ static int pub_other_loop(struct mosquitto *mosq)
|
|
|
|
|
rc = my_publish(mosq, &mid_sent, cfg.topic, 0, NULL, cfg.qos, cfg.retain);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if(rc){
|
|
|
|
|
if(rc != MOSQ_ERR_SUCCESS && rc != MOSQ_ERR_NO_CONN){
|
|
|
|
|
err_printf(&cfg, "Error sending repeat publish: %s", mosquitto_strerror(rc));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|