Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serving multiple files over https #3136

Open
Somritag opened this issue May 10, 2024 · 1 comment
Open

Serving multiple files over https #3136

Somritag opened this issue May 10, 2024 · 1 comment

Comments

@Somritag
Copy link

Hi,

I am using version of libwebsocket: 4.3.2
Ported the library to work with MBEDTLS 3.4.1 + LWIP 2.1.2 for STM32H5 series processor for Websocket + webserver services
As per the environment setup, FREERTOS is being used.

Has taken the reference for setting up the config file from (https://github.com/tushartp/STM32H7-Webserver)
Not using any other libraries for external polling, using internal polling. Using port 443 for https and wss

context_settings

Issue :
The web communication is happening using Role HTTP2
Was referring minimal-http-server-form-post.c, for loading a webpage for our webUI implementation, observed the file size > 1kb often getting timed out while serving the page. It hits lws_service_adjust_timeout() ---> __lws_sul_service_ripe()---->lws_sul_wsitimeout_cb()
For testing was using leaf.jpg (size 2.5 MB ). Most of the times after 120Bytes transfer its timing out. I have not set any timeout while setting the context or creating the lws_service ().

Observation: If we open the socket on the same port then query the page, it doesn't get time out but loading speed is very slow. (takes around 29.19s at times to load 2.5 Mb leaf image, bigger file takes much more longer duration)

Is there some additional configuration am missing out , while serving the pages without establishing the socket connection which lead to timeouts.

Kindly guide for the best practice to serve multiple files back to back for the webserver.

Thanks,
s

@lws-team
Copy link
Member

You shouldn't need any sleeps (5 what... seconds, ms...) around the service loop. It will stick in the service wait until something happens.

Timeouts can only happen by that calling pattern.

You should look at the verbose lws logs and see how it feels stuff is happening.

There are more suspicious characters than usual since its your own-built lwip. The logs might help give a clue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants