Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

socket error on client...disconnect when payload > 4096 under protocol websocket #59

Closed
ralight opened this issue Mar 15, 2016 · 0 comments

Comments

@ralight
Copy link
Contributor

ralight commented Mar 15, 2016

migrated from Bugzilla #464811
status RESOLVED severity normal in component Mosquitto for 1.4
Reported in version 1.4 on platform Other
Assigned to: Roger Light

Original attachment names and IDs:

On 2015-04-16 11:40:23 -0400, stephen zeng wrote:

I use paho.javascript-1.0.1 to test mosquitto-1.4.1. And i found that under ws protocol, when the packet > 4096, the broker disconnect client, but fine under tcp protocol.
More specific, i checked func callback_mtqq, this callback only get 4096 size data one time but not all data, then mqtt3_packet_handle return MOSQ_ERR_PROTOCOL err code.
Finally,i figure out that i can change the protocols.rx_buffer_size to fix it, but i prefer config it in mosquitto.conf file, hope you can add this configuration.
GOODLUCK,BYE.

On 2015-04-17 16:26:59 -0400, Roger Light wrote:

Thanks for the report, could you confirm what value you set rx_buffer_size to, and what version of libwebsockets you are using?

On 2015-05-01 09:16:05 -0400, Arjen van Elteren wrote:

Created attachment 253027
patch to fix message size problems for websockets

On 2015-05-01 09:20:45 -0400, Arjen van Elteren wrote:

I can confirm this biug, I used latests mosquitto from git (SHA: 11d0d88) and mqttws31.js.

Default configuration for mosquitto, except enabling the websockets listener.

Messages larger than 4096 get mangled.

I've attached a patch to fix this problem. Libwebsocket will split large messages into several blocks, and although mosquitto does have almost complete handling for this case, it seems to miss a small part.

Simply returning from the <callback_mqtt> function if the message reading is incomplete will fix the problem (see patch).

On 2015-05-04 16:16:39 -0400, Roger Light wrote:

Hi Arjen,

Thanks for the patch. I need some more things from you in order to be able to accept it. The details are here:

http:https://git.eclipse.org/c/mosquitto/org.eclipse.mosquitto.git/tree/CONTRIBUTING.md

The ideal scenario is that you sign the Eclipse CLA. This is described here: http:https://www.eclipse.org/legal/CLA.php

You then need to sign-off on the Certificate of Origin (i.e. state that you are able to make this submission), more details here: https://wiki.eclipse.org/Development_Resources/Contributing_via_Git#via_Bugzilla

I have been authorised to accept very small patches such as this one without a signed CLA being in place. If you would prefer you only need to sign-off on the Certificate of Origin in this bug report. Without this as a minimum I cannot accept the patch.

On 2015-05-06 07:07:07 -0400, Arjen van Elteren wrote:

Hi Roger,

I've signed off on CLA already (I have the CLA button next to my name).

As for the Cerficate of orgin, I don't think I can add the line to the patch,
but I can do so in this comment:

This contribution complies with http:https://www.eclipse.org/legal/CoO.php

Is this sufficient?

Kind regards,

Arjen

On 2015-05-06 07:32:59 -0400, Roger Light wrote:

Hi Arjen,

That's great, thanks very much. I must have looked in the wrong place when I was checking for the CLA tick.

This will be part of 1.4.2, thanks for your contribution.

On 2015-05-06 17:42:17 -0400, Roger Light wrote:

I've actually fixed this in a subtly different way rather than with your patch. It makes a bit more sense this way.

Thanks again for the patch though, it was still very important pointing out where the problem was!

@ralight ralight closed this as completed Mar 15, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Aug 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant