[Libwebsockets] [libwebsockets] #111: Assertion `0' problem

Trac trac at libwebsockets.org
Fri Apr 17 01:23:49 CEST 2015


#111: Assertion `0' problem
------------------------------------+--------------------
  Reporter:  marcin                 |      Owner:  marcin
      Type:  defect                 |     Status:  new
  Priority:  major                  |  Milestone:
 Component:  libwebsockets library  |    Version:
Resolution:                         |   Keywords:
------------------------------------+--------------------

Comment (by agreen):

 To answer your last question first, you can check for partial pending send
 like this

 LWS_VISIBLE LWS_EXTERN int
 lws_partial_buffered(struct libwebsocket *wsi);

 But I think it's maybe unrelated.

 To explain what is going on... the kernel signals us when he feels he can
 take some more data on the connection, this is the 'writeable callback'
 stuff.

 But he doesn't make a promise about how much data he will take.  Depending
 on the rate the peer drains the packets, he might not feel he can accept
 much.  So this causes the "partial send", you asked to send 4244 bytes but
 the kernel only accepted, eg, 3072 bytes.

 The remaining bytes are buffered by lws -- copied into a malloc'd buffer -
 as a 'pending partial send' on the connection, and get priority to be
 automatically sent before any further writeable indications are given to
 the user code.

 Looking at your backtrace, is it possible the connection is closing at the
 time the problem is coming?

--
Ticket URL: <http://libwebsockets.org/trac/libwebsockets/ticket/111#comment:5>
libwebsockets <http://libwebsockets.org>
libwebsockets C library



More information about the Libwebsockets mailing list