Using the char* passed by Mosquitto in a GoString struct is unsafe.
The memory it points to is managed by Mosquitto, but Go will keep the
pointer around for an indefinite duration, even when Mosquitto might
free the memory.
By passing the actual char* to Go, we can use C.GoString to convert it,
which copies the bytes into a buffer managed by Go. That way we can use
it safely at any time in the future.
* Add default 'mosquitto' user-agent to http/jwt requests
* Add libmosquitto version ofr http and jwt remote user agent.
Add more room for extended versions.
Co-authored-by: Ignacio Gómez <iegomez@uc.cl>
* No longer cache response from backend when the backend fail.
* Reply to Mosquitto using "MOSQ_ERR_UNKNOWN" which will disconnect
client and avoid silent data loss when the error occure for ACL
checks.