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

Roger Light roger at atchoo.org
Mon Aug 18 16:48:00 CEST 2014


Hi Andy,

> For the return value, currently it's defined to tell how much it sent (or
> 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 negative
> code for 'I buffered it', which is not an error, it will cause a lot of
> reasonable existing code to break.
>
> So I think the next best thing is add a cheap accessor to detect if it's
> still possible to write on the wsi, ie, check if there's an active partial
> buffer.

That sounds ideal to me.

Cheers,

Roger



More information about the Libwebsockets mailing list