-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Encountering ERR_CONNECTION_Closed to serve bigger file over https #3183
Comments
... could you perhaps spend more than two words in the title to describe your problem? |
Updated my issue, that was a hasty mistake. In summary Https-> server (tried with minimal http server tls example code with a bigger file to load)-> Getting time out every time while serving Is there any limitations in case of only https server? |
Is stuff transferring over tls? Eg, if you look with tcpdump, how far does it get? What do the logs say in the failing case? What is the platform? |
Log: After some fragments it times out -> The Time is not fixed mostly around We want to host a webserver on our stm32H5 controller |
Does this help? |
Hi Andy this did not fix my issue, I am attaching the log |
It doesn't seem to show why it wants to close when it does. Without a timestamp on the logs, it makes it impossible to understand what is happening close in time, or after some delay.
For a timeout there should be a TIMEOUT log before, for other problems they also should log. The question is how did we end up at closing |
https_serve_fail_leaf.txt Attached the logs with probable time stamp : Instance 2: |
Not sure why this log is different and mentions TIMEDOUT, it seems to be sending up to the end. Every time it sends, it resets the timeout for 15s. Time seems to go backwards 33 -> 32s on the https_serve_fail_leaf.txt is this because multiple things are pasted in the log? If the time isn't stable, timeouts won't act right. But not sure that's what happened (ntp happened partway through?) It says "lws_ssl_capable_write failed: 5" near the end, this seems to imply it was the client side that timed out and closed the tls connection, the server would close the tls connection as part of its general close handling later. It didn't stop because of a server side timeout. So I don't know what the timeout is at the end, the client's timeout? |
https_file_serve_sucess_case.txt Hi Andy , TIMEDOUT WAITING 15, dhdr 0, ah 20052630, wl 0 happened in between (line no 3143) but after closing it reconnects And continues .. But in other failed cases once it losses connection does not revive. This try was in mozilla though i dont think so its browser dependent . |
The mystery retry can be the browser deciding to have another go because from their pov, it failed partway through (or timed out). It's worth looking at Ctrl-Shift-C on firefox and the network tab to see what it thinks happens on each stream. All the protocol callbacks should call through to the dummy callback for stuff they didn't handle themselves. I dunno what "different behaviour" means. |
I see when we try https-> client is issuing a GOAWAY after a FIN set, and then a RST is happening. And No retry (close connection) But post opening a socket querying the same same page leads to a success Is there any difference the way the https request getting served while socket is open vs socket is not open ? At times I see retry automatically happens, is there a way to retry in such scenarios? |
Hi Andy, took some time. Indeed, it was a timing out due to improperly setting the lws_now_usecs() and lws_now_secs(). HTTPS server file querry is stable now. Thanks! |
Hello Andy,
I am referring libwebsocket minimal example for https server, trying to open leaf.jpg (appx 7 mb)
For SSL i am using Mbedtls
I see its always getting time out to serve this file or any file of large size, while the smaller files get served.
we always hit here :
/* 1: something requested a callback when it was OK to write */
And the __lws_sul_service_ripe() -> function
pt->inside_lws_service = 1;
hit->cb(hit); // here we are hitting lws_sul_wsitimeout_cb()
pt->inside_lws_service = 0;
Attaching the log:
![image](https://private-user-images.githubusercontent.com/169147734/347813034-22371d00-573e-487c-aa2a-abf443193099.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI4Mzg5OTEsIm5iZiI6MTcyMjgzODY5MSwicGF0aCI6Ii8xNjkxNDc3MzQvMzQ3ODEzMDM0LTIyMzcxZDAwLTU3M2UtNDg3Yy1hYTJhLWFiZjQ0MzE5MzA5OS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODA1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgwNVQwNjE4MTFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kYTQ0MzQ4N2QwZGU5MmVhYTg0MmJmOGJhZWViYjUzY2ZjYTE2N2RiMzkxMWY5MmJiOTllM2Y0NWU4MTRkYmRhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.e5N2X_7WK_msMwYNfBeq0iDUzO8rN05NOzNbV6VprT8)
The text was updated successfully, but these errors were encountered: