[Libwebsockets] lws_serve_http_file

Srikar Vadlamani SrikarVadlamani at trafficware.com
Mon Jan 30 23:51:13 CET 2017

It is the same file, I tried to give an example, didn’t prune the files names correctly.

Since it works on one computer/instance I don’t think it is permissions issue.

Developer tool, shows that it received good response headers, but no data itself and it times out.

-----Original Message-----
From: Andy Green [mailto:andy at warmcat.com] 
Sent: Monday, January 30, 2017 4:38 PM
To: libwebsockets at ml.libwebsockets.org; Srikar Vadlamani <SrikarVadlamani at trafficware.com>
Subject: Re: [Libwebsockets] lws_serve_http_file

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 
>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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Capture.JPG
Type: image/jpeg
Size: 61373 bytes
Desc: Capture.JPG
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20170130/bde243a8/attachment-0002.jpe>

More information about the Libwebsockets mailing list