GNOME Bugzilla – Bug 770022
Too low payload safety value on websockets
Last modified: 2016-08-22 17:06:19 UTC
libsoup sets a value of 128 * 1024 for the websocket. This is too low if you are i.e sending frames on the transport. Can we avoid this?
Actually I wonder if the problem is the server that in some case it sends more bytes than it should (this is with both server and client being libsoup). This is the message that I am getting: (niceviewer:17519): libsoup-DEBUG: client is trying to frame of size 131155 or greater, but max supported size is 128KiB 131155 (128.08) looks suspicious.
Actually I do not see anywhere where sending binary data libsoup ensures that the frames is of a max 128KiB. If sending binary data is supported we should definitely remove this check I guess.
Created attachment 333450 [details] [review] websocket-test: add unit test for bigger packets than supported
You can run the unit test above to reproduce the issue: G_MESSAGES_DEBUG=all ./websocket-test
Created attachment 333694 [details] [review] patch (posting on behalf of Nacho) This patch adds a property to set the max (default value is the same as before). The patch adds a unit test as well
Comment on attachment 333694 [details] [review] patch 1. add soup_websocket_connection_get/set_max_payload_size() please (with Since tags and SOUP_AVAILABLE_IN_...) 2. rename MAX_PAYLOAD to MAX_PAYLOAD_SIZE_DEFAULT 3. clarify in the docs that this is for incoming packets only and the code doesn't limit outgoing packet size
Created attachment 333905 [details] [review] Add max-payload-size property to the websocket connection. This allows to change the limit for the payload of websocket packets. Also add the corresponding unit test.
Comment on attachment 333905 [details] [review] Add max-payload-size property to the websocket connection. looks good. if you want to rename it as per IRC, I think "max-incoming-payload-size" is probably better than "max-incoming-packet-size", since the payload may be made up of many tcp packets
Created attachment 333930 [details] [review] Add max-incoming-payload-size property to the websocket connection. This allows to change the limit for the payload of websocket packets. Also add the corresponding unit test.
Attachment 333930 [details] pushed as d4c6819 - Add max-incoming-payload-size property to the websocket connection.