Fix inflight max behaviour and option setting.
This commit is contained in:
parent
096380fbdc
commit
4b6cc208e2
@ -6,6 +6,8 @@ Broker:
|
||||
|
||||
Client library:
|
||||
- Don't use `/` in autogenerated client ids, to avoid confusing with topics.
|
||||
- Fix `mosquitto_max_inflight_messages_set()` and `mosquitto_int_option(...,
|
||||
MOSQ_OPT_*_MAX, ...)` behaviour. Closes #1417.
|
||||
|
||||
Clients:
|
||||
- mosquitto_sub: Fix `-E` incorrectly not working unless `-d` was also
|
||||
|
@ -340,10 +340,6 @@ int message__out_update(struct mosquitto *mosq, uint16_t mid, enum mosquitto_msg
|
||||
|
||||
int mosquitto_max_inflight_messages_set(struct mosquitto *mosq, unsigned int max_inflight_messages)
|
||||
{
|
||||
if(!mosq) return MOSQ_ERR_INVAL;
|
||||
|
||||
mosq->send_maximum = max_inflight_messages;
|
||||
|
||||
return MOSQ_ERR_SUCCESS;
|
||||
return mosquitto_int_option(mosq, MOSQ_OPT_SEND_MAXIMUM, max_inflight_messages);
|
||||
}
|
||||
|
||||
|
@ -335,8 +335,6 @@ struct mosquitto {
|
||||
# ifdef WITH_SRV
|
||||
ares_channel achan;
|
||||
# endif
|
||||
uint16_t send_maximum;
|
||||
uint16_t receive_maximum;
|
||||
#endif
|
||||
uint8_t maximum_qos;
|
||||
|
||||
|
@ -409,14 +409,22 @@ int mosquitto_int_option(struct mosquitto *mosq, enum mosq_opt_t option, int val
|
||||
if(value < 0 || value > 65535){
|
||||
return MOSQ_ERR_INVAL;
|
||||
}
|
||||
mosq->receive_maximum = value;
|
||||
if(value == 0){
|
||||
mosq->msgs_in.inflight_maximum = 65535;
|
||||
}else{
|
||||
mosq->msgs_in.inflight_maximum = value;
|
||||
}
|
||||
break;
|
||||
|
||||
case MOSQ_OPT_SEND_MAXIMUM:
|
||||
if(value < 0 || value > 65535){
|
||||
return MOSQ_ERR_INVAL;
|
||||
}
|
||||
mosq->send_maximum = value;
|
||||
if(value == 0){
|
||||
mosq->msgs_out.inflight_maximum = 65535;
|
||||
}else{
|
||||
mosq->msgs_out.inflight_maximum = value;
|
||||
}
|
||||
break;
|
||||
|
||||
case MOSQ_OPT_SSL_CTX_WITH_DEFAULTS:
|
||||
|
Loading…
Reference in New Issue
Block a user