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

Andy Green andy at warmcat.com
Mon Aug 18 16:59:43 CEST 2014

On 18 August 2014 22:48:00 GMT+08:00, Roger Light <roger at atchoo.org> wrote:
>Hi Andy,
>> For the return value, currently it's defined to tell how much it sent
>> buffered) or negative for something fatal.
>> Lws is 4 years old now there's a fair amount of user code and all of
>it uses
>> libwebsocket_write(), I think if it changed to, eg, returning a
>> code for 'I buffered it', which is not an error, it will cause a lot
>> reasonable existing code to break.
>> So I think the next best thing is add a cheap accessor to detect if
>> still possible to write on the wsi, ie, check if there's an active
>> buffer.
>That sounds ideal to me.

Okie I just pushed these, get rid of the confusing old flag


And add the accessor


I also changed the relevant part of the test server to use it.


>Libwebsockets mailing list
>Libwebsockets at ml.libwebsockets.org

More information about the Libwebsockets mailing list