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

Trac trac at libwebsockets.org
Fri Feb 22 19:54:28 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:
 Keywords:                         |
-----------------------------------+--------------------
 I can reproduce this problem by:
 - compiling with the `WS_LATENCY` symbol defined
 - running the test-server

 and then either:

 - getting http://127.0.0.1:7681/leaf.jpg from Chrome
 - fetching leaf.jpg using curl with a limited rate like this:
 {{{
 curl --limit-rate 64K http://127.0.0.1:7681/leaf.jpg > leaf.jpg
 }}}

 //(note that using the rate limited curl is the most reliable way to
 reproduce the problem)//

 The problem can be seen in the `test-server` log:
 {{{
 ...
 ...
 Feb 22 19:50:40 arrakis.local lwsts[2968] <Debug>: Completion first try
 lat 4us: 0x7fe069c05b10: ret 4096: send lws_issue_raw
 Feb 22 19:50:40 arrakis.local lwsts[2968] <Debug>: Completion first try
 lat 5us: 0x7fe069c05b10: ret 4096: send lws_issue_raw
 Feb 22 19:50:40 arrakis.local lwsts[2968] <Debug>: lat 4us:
 0x7fe069c05b10: ret 3628: send lws_issue_raw
 Feb 22 19:50:40 arrakis.local lwsts[2968] <Debug>: ERROR writing len 4096
 to skt 3628
 Feb 22 19:50:44 arrakis.local lwsts[2968] <Debug>: Completion 3998093us:
 lat 41us: 0x7fe069c05b10: ret 4096: send lws_issue_raw
 Feb 22 19:50:44 arrakis.local lwsts[2968] <Debug>: Completion first try
 lat 23us: 0x7fe069c05b10: ret 4096: send lws_issue_raw
 Feb 22 19:50:44 arrakis.local lwsts[2968] <Debug>: Completion first try
 lat 18us: 0x7fe069c05b10: ret 4096: send lws_issue_raw
 ...
 ...
 }}}

 My guess is that the pipe is getting choked, the buffer is not fully
 written and the remainder bytes are then discarded instead of being re-
 injected in the pipe causing the image to be incomplete.

-- 
Ticket URL: <http://libwebsockets.org/trac/ticket/20>
libwebsockets <http://libwebsockets.org>
libwebsockets C library



More information about the Libwebsockets mailing list