[Libwebsockets] [libwebsockets] #20: Sending HTTP content fails when pipe is choked

Trac trac at libwebsockets.org
Sat Feb 23 04:09:00 CET 2013

#20: Sending HTTP content fails when pipe is choked
  Reporter:  luc_h                  |      Owner:  agreen
      Type:  defect                 |     Status:  new
  Priority:  critical               |  Milestone:
 Component:  libwebsockets library  |    Version:
Resolution:                         |   Keywords:

Comment (by agreen):

 Yes I think I know what this is... under load, I recently realized that
 writing data to the socket may both signal that it is ready to be written,
 and accept the written data, but only accept some of it.

 I saw this happen last week with the system under load and trying to send
 big packets, the OS did not have the memory to buffer the whole thing and
 just took ~ 2K of it.  That's neither a fail nor a workable send.

 I added this patch


 to pass things up through libwebsocket_write if that happens, and adapted
 both http send implementations to back up their file pointer if they
 experience it.  Please see if that helps the situation.

Ticket URL: <http://libwebsockets.org/trac/ticket/20#comment:1>
libwebsockets <http://libwebsockets.org>
libwebsockets C library

More information about the Libwebsockets mailing list