[Libwebsockets] Truncated send handled by user not working as expected

nil100 at ig.com.br nil100 at ig.com.br
Mon Aug 18 01:34:47 CEST 2014


Hello everybody, 

I'm using the library and in my case I want to handle truncated send
myself but I ran into a situation. Linux's send function is returning -2
which in turn is causing libwebsockets to disregard my wish to handle
truncated sends and consequently causes an assert failure later on. 

Everything is happening in file output.c at line 130 which is the return
from linux's native send (I'm not using SSL so lws_ssl_capable_write is
actually lws_ssl_capable_write_no_ssl). Now when this returns
LWS_SSL_CAPABLE_MORE_SERVICE (value -2) then the value of variable "n"
is set to 0 which causes the condition at line 172 (n &&
wsi->u.ws.clean_buffer) to be false and continue execution as if
libwebsockets was handling truncates and consequent calls to fail
assertion at line 112. 

I'm a new libwebsockets user and wasn't sure how to proceed in getting
this fixed. 

I'm using version 1.3 on a Kubuntu 12.04 VirtualBox VM but I'm also
using the same version cross compiled to an ARM (beaglebone black)
running Ubuntu 13.10 and having the same behavior. 

Anyone else running into this situation? 


Nilson N. da Silva 

nil100 at ig.com.br 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libwebsockets.org/pipermail/libwebsockets/attachments/20140817/440fd76a/attachment.html>

More information about the Libwebsockets mailing list