flukso / lua-mosquitto

Lua bindings to the libmosquitto MQTT client library.
https://github.com/flukso/lua-mosquitto
Other
63 stars 42 forks source link

refactor with mqtt_protocol.h #35

Closed fperrad closed 2 years ago

fperrad commented 2 years ago

refactor with mqtt_protocol.h which comes with recent libmosquitto

I don't know where CONN_REF_BAD_TLS (= 6) comes from, others values from connect_return_codes match with mqtt31_connack_codes

mqtt31_connack_codes are aligned with http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718035

all the range 6-255 is "Reserved for future use".

maybe the value 6 (with this meaning) comes from a specific broker implementation ?

karlp commented 2 years ago

I'm not convinced this change provides any value. There's nothing doing anything with mqtt_protocol, so you've just got a new include, but you've still got a renamed version of the existing code. This is just churn.

fperrad commented 2 years ago

the remaining question is :

where CONN_REF_BAD_TLS (= 6) comes from ?

karlp commented 2 years ago

Looks to have been dead code introduced in f6fbb5d758391b1e88d I can't see anywhere that libmosquitto can ever supply code 6, (even back in v1.4 era when that tls_set was added) so while it is indeed dead, it cannot ever be reached.

fperrad commented 2 years ago

so, this dead code must be removed.