[Libwebsockets] a bug?

klervi - Alex Rhatushnyak a.rhatushnyak at klervi.com
Thu Mar 7 05:41:16 CET 2013


Andy, thank you for the response!

I tried the latest version.
On the client side, with -u:
[1362630790:6815] INFO: closing connection due to 0 length read
[1362630790:6815] DEBUG: close: just_kill_connection

At the same time on the server side:
[1362630790:4034] PARSER: written 8194 bytes to client
[1362630790:4035] PARSER: written 8194 bytes to client
[1362630790:4035] PARSER: written 8194 bytes to client
[1]    73334 segmentation fault  ./libwebsockets-test-server

As before, no problems without '-u'.
The modified test-client.c & test-server.c are attached.
Regards,
Alex



On Wed, Mar 6, 2013 at 7:37 PM, "Andy Green (林安廸)" <andy at warmcat.com> wrote:

> On 07/03/13 04:07, the mail apparently from klervi - Alex Rhatushnyak
> included:
>
>> Hi Andy!
>> Please find attached slightly modified test-server.c and test-client.c
>> from libwebsockets 1.22.
>> When you run them like this:
>>
>> *> ./libwebsockets-test-server*
>> *> ./libwebsockets-test-client* localhost
>>
>>
>> there is no problem, but if deflate is disabled, an error will be
>> reported almost immediately:
>>
>> *> ./libwebsockets-test-client* localhost -u
>>
>>  > ...
>>  > ERROR!!! Only the first 7686 of 8190 bytes are 'a'.  The remainder:
>>  > ...
>>
>> The following appears on the server side:
>>  > [1362599624:3931] DEBUG: ERROR writing len 8194 to skt 7682
>>
>> (log level defaults to (1<<LLL_COUNT)-1  in the attached code).
>> At least, that's what I observe on Mac OSX 10.8.2.
>> Please advise whether you can reproduce the issue, and whether you think
>> it's really caused by a bug.
>> Thank you!
>>
>> Doesn't it look a bit odd that if send() was unable to send all bytes,
>> function lws_issue_raw() doesn't care how many were actually sent:
>>
>>          n = send(wsi->sock, buf, len, MSG_NOSIGNAL);
>>          lws_latency(context, wsi, "send lws_issue_raw", n, n == len);
>>          if (n != len) {
>>              lwsl_debug("ERROR writing len %d to skt %d\n", len, n);
>>              return -1;
>>          }
>>
>
> Please make sure you're running the latest version from
>
> http://git.libwebsockets.org/**cgi-bin/cgit/libwebsockets/<http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/>
>
> looking at the diff with the files you sent, it seems you started from an
> older version.  We did work on this recently, eg
>
> http://git.libwebsockets.org/**cgi-bin/cgit/libwebsockets/**commit/?id=**
> fc7c5e453920ad8ce163f618cd8d65**abc78c9901<http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/commit/?id=fc7c5e453920ad8ce163f618cd8d65abc78c9901>
>
> We have more to do, eg, force the send buffer size by socket options, but
> the current version should hopefully remove the symptom.
>
> -Andy
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20130306/70c78668/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-client.c
Type: text/x-csrc
Size: 9025 bytes
Desc: not available
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20130306/70c78668/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-server.c
Type: text/x-csrc
Size: 19950 bytes
Desc: not available
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20130306/70c78668/attachment-0001.bin>


More information about the Libwebsockets mailing list