fixed the rc parameter MQTT_ERR_CONN_LOST to be passed instead of 1 t…#441
fixed the rc parameter MQTT_ERR_CONN_LOST to be passed instead of 1 t…#441nawab36085 wants to merge 1 commit intoeclipse-paho:masterfrom
Conversation
…o user callback function on_disonncect
|
Is there a reason why this is still open, or why there has been no reaction to it for 4 months? |
|
The documentation states that it's "0 for explicit disconnect, non-zero for unexpected disconnect" you're not meant to be trying to decode it further. |
In that case I'd argue that both the documentation and the implementation are wrong. |
|
The documentation matches the implementation. Should the implementation be made more like other functions where rc can be decoded with mosq_errstr()? sure, that sounds perfectly reasonable, but that's an enhancement. |
|
Depending on if it's a conscious decision or not to use a hard coded 1 here you can view it as either a bug or a change request. Either way, it would be handy if the return codes are used consistently, especially when the function in question does use the provided define for positive outcomes. |
The `rc` parameter in the `on_disconnect` callback now has meaningful values in the case of an error. Closes #441. Thanks to Nawab.
|
This is now fixed - I've done it in a slightly different and more comprehensive way than this PR, so I'm going to close this. Thanks for the request. |
…o user callback function on_disonncect