[Libwebsockets] lws_serve_http_file

Andy Green andy at warmcat.com
Mon Jan 30 23:37:59 CET 2017

On 31 January 2017 04:30:04 GMT+08:00, Srikar Vadlamani <SrikarVadlamani at trafficware.com> wrote:
>I have a lws http server trying to send a binary json data over http,
>it does work without any issues on couple of computers,
>And on some laptops/computers it consistently fails, what can be the
>possible reasons.
>Logs are attached below for both,
>Is there something obvious you guys see?
>iRetLen =
>: POST: Elapsed time:4332592 us
>: fd=12, revents=4
>: (10092890,10093b10}LWS_CALLBACK_HTTP_WRITEABLE:sending /home/Ret0
>lws_set_timeout: 0x10092890: 20 secs
>lws_set_timeout: 0x10092890: 20 secs
>----- lots of lws_ser_timeout --------
>: lws_set_timeout: 0x10092890: 20 secs
>lws_set_timeout: 0x10092890: 20 secs
>file completed
>lws_http_transaction_completed: wsi 0x10092890
>lws_ensure_user_space: 0x10092890 protocol 0x1001e224
>lws_set_timeout: 0x10092890: 5 secs
>lws_http_transaction_completed: wsi->more_rx_waiting=1

This is not the same file as the first case.

>lws_set_timeout: 0x1004a860: 20 secs
>lws_set_timeout: 0x1004a860: 20 secs
>lws_http_transaction_completed: wsi 0x1004a860

He doesn't say 'file completed' but he ends well... he thinks he has finished dealing with what the client asked for.

If you are opening the file yourself, how about it couldn't open the file due to permissions?

What does the other side of the connection think happened?  If a browser the 'developer view' on modern browsers is very handy.


>lws_ensure_user_space: 0x1004a860 protocol 0x1001e224
>lws_set_timeout: 0x1004a860: 5 secs
>lws_http_transaction_completed: wsi->more_rx_waiting=0
>lws_header_table_detach: wsi 0x1004a860: ah 0x100283d8 (tsi=0, count =
>lws_header_table_detach: wsi 0x1004a860: ah held 7s, ah.rxpos 611,
>ah.rxlen 611, mode/state 0 0,wsi->more_rx_waiting 0
>lws_header_table_detach: wsi 0x1004a860: ah 0x100283d8 (tsi=0, count =
>lws_http_transaction_completed: 0x1004a860: keep-alive await new
>_lws_rx_flow_control: no pending change

Sent from my Android device with K-9 Mail. Please excuse my brevity.

More information about the Libwebsockets mailing list