[Libwebsockets] Odd "ERR: Ran out of header data space" error?
Bent Bisballe Nyeng
deva at aasimon.org
Fri Jun 19 19:58:17 CEST 2020
Thank you very much for you reply :-)
On 06/19/20 18:01, andy at warmcat.com wrote:
> On June 19, 2020 3:20:47 PM UTC, Bent Bisballe Nyeng <deva at aasimon.org> wrote:
>> Hi List
>> I am making a server based on libwebsockets which serves textual
>> to all connected user based on user input, akin to the drawing example
>> application; ie. everybody gets notificed about all changes.
>> My application uses a textual protocol and these messages can sometimes
>> be ~16kb and above.
>> The system on which I am developing is based on libwebsocket 2.1 and
>> everything seem to be working fine.
>> Recently, however, I deployed the service on a debian server for
>> use, which has libwebsocket 2.0 installed and then I started seeing the
> 2.0... it's very old.
Yes I thought so as well - but this is for some reason the version that
Debian is currently shipping... ;)
>> error: "ERR: Ran out of header data space" a lot.
>> I traced it to the max_http_header_data parameter which in my
>> application was unset (ie. 0) and increasing it to 16kb seemed to
>> somewhat mitigate the issue.
>> I do not, however, understand why I am seeing that error in the first
>> place, shouldn't that parameter only affect http connections?
> I assume it's websockets... all ws connections start off as http. And the server catches and stores any headers it understands, but it is not in control of, eg, how big the cookies are a browser will send it. At some point I set the default size to 4KB it'd make sense if before v2.1 it was smaller.
So what you are saying is that it might be the size of my cookies which
is causing my problem and not as I initially thought the payload size of
my protocol ...
It does make sense since the number of cookies are growing linearly with
the size of my payload.
Are there any limitations to how much data can be transmitted in one
lws_write call to a client?
>> I am also not sure why I am seeing the error only on the debian server
>> and not on my developent PC. Is this perhaps really a bug in 2.0 which
>> has been fixed in 2.1?
> This is all literally many years old. We're on v4.0 now.
>> Any advice on the matter will be very much appreciated :-)
> It's better to build later stuff yourself. Later lws supports cpack, you can create a .deb actually.
I will try to reduce the number fo cookies and see if that fixes the
issue. If it persists I will try to compile lws myself :-)
Thank you for your help - and thank you for this great library :-)
Bent Bisballe Nyeng
>> Kind regards
>> Bent Bisballe Nyeng
>> Libwebsockets mailing list
>> Libwebsockets at ml.libwebsockets.org
More information about the Libwebsockets