willem4ever/mod_websocket_mosquitto

Error when connected from mosquitto-1.1.js

Closed this issue · 2 comments

Hi,
Thank you for the great code!
I have tried to use the mod_websocket_mosquitto by using newest mosquitto-1.1.js, but it received error when it calls connect().

It seems the mosquitto-1.1.js uses string "mqttv3.1" instead of "mqtt".
It works fine when I changed the mod_websocket_mosquitto.c as follow:

if ((protocol != NULL) &&
-            (strcmp(protocol, "mqtt") == 0)) {
+            (strncmp(protocol, "mqtt", 4) == 0)) {
           /* If the client can speak the protocol, set it in the response */
           server->protocol_set(server, protocol);

Thank you!

Hi Ron,

Thanks for the report, heard of this change in mosquitto-1.1.js will make the changes at my earliest (traveling right now)

Cheers, Willem.

On 24 Mar 2013, at 09:18, Ron Tajima notifications@github.com wrote:

Hi,
Thank you for the great code!
I have tried to use the mod_websocket_mosquitto by using newest mosquitto-1.1.js, but it received error when it calls connect().

It seems the mosquitto-1.1.js uses string "mqttvv3.1" instead of "mqtt".
It works fine when I changed the mod_websocket_mosquitto.c as follow:

if ((protocol != NULL) &&

  •        (strcmp(protocol, "mqtt") == 0)) {
    
  •        (strncmp(protocol, "mqtt", 4) == 0)) {
       /\* If the client can speak the protocol, set it in the response */
       server->protocol_set(server, protocol);
    
    Thank you!


Reply to this email directly or view it on GitHub.

committed the requested change