[Libwebsockets] Assert in output.c
roger at atchoo.org
Mon May 12 00:54:34 CEST 2014
Replacing the "assert(0)" with "return 0" at least gets me some
output, but I don't know if it is the correct thing to do or not. I do
end up with very frequent "ERR: ****** 935de10 Sending new, pending
truncated ..." messages.
Any hint on whether I'm doing something wrong would be appreciated.
On Wed, May 7, 2014 at 11:19 AM, Roger Light <roger at atchoo.org> wrote:
> Hi there,
> I'm trying to integrate libwebsockets into an existing application.
> I'm using libwebsockets master as of yesterday, on ubuntu 14.04. I'm
> not using SSL.
> I've defined a callback for my protocol that implements the
> LWS_ESTABLISHED, CLOSED, SERVER_WRITEABLE and RECEIVE reasons. My http
> callback only returns 0, nothing else. I haven't yet integrated the
> poll handling with my existing poll loop properly. I'm calling
> libwebsocket_service(ws_context, 0) after my own poll, which I realise
> isn't great but should be fine for testing purposes at the moment.
> Buffer size is set to 0, which means 4096, right? In testing I
> wouldn't expect them to exceed that number.
> I already need to cope with partial writes, so I have code to deal
> with that so I'm watching the output of libwebsockets_write() to shift
> along my buffer, or not. The buffer has the appropriate padding, so I
> presume that on a partial write I can just shift my position along a
> bit and retry in the future.
> It's also possible/likely that I'll be calling
> libwebsocket_callback_on_writable() for a single client multiple times
> before the service function is called, and possibly from within the
> websockets callback itself.
> I haven't been able to pin it down reliably, but I'm occasionally
> getting a failed assertion in lws_issue_raw() on line 112 - assert(0).
> Am I likely to be doing something stupid, or should this "never
> happen"? I can provide more details if needed.
More information about the Libwebsockets