Skip to content

WebServer: handle initial read/close timeouts asynchronously #1401

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

Merged
merged 1 commit into from
Jan 18, 2016

Conversation

nomis
Copy link
Contributor

@nomis nomis commented Jan 10, 2016

If there is a delay before data becomes available on a new connection
then the handler function blocks for up to 1 second, and there's another
wait on connection close for up to 2 seconds.

This doesn't make the whole server process asynchronous (there is another
delay between headers/data) but it helps when there are other events
that need attention while handling web requests.

If there is a delay before data becomes available on a new connection
then the handler function blocks for up to 1 second, and there's another
wait on connection close for up to 2 seconds.

This doesn't make the whole server process asynchronous (there is another
delay between headers/data) but it helps when there are other events
that need attention while handling web requests.
@igrr
Copy link
Member

igrr commented Jan 10, 2016

I've done a few tests and this seems to work fine. However I would ask more people to test this change and report feedback here, as there might be some potential edge cases depending on client behaviour.
Just do a git clone https://github.com/lp0/esp8266-Arduino.git esp8266 && git checkout webserver-async1 in your Arduino/hardware/esp8266com directory.

@FWeinb
Copy link

FWeinb commented Jan 11, 2016

I tested it and can confirm that the web server runs stable for me.

@andig
Copy link
Contributor

andig commented Jan 17, 2016

Can't say if its faster but no (additional) problems observed.

igrr added a commit that referenced this pull request Jan 18, 2016
WebServer: handle initial read/close timeouts asynchronously
@igrr igrr merged commit ecdbda8 into esp8266:master Jan 18, 2016
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

Successfully merging this pull request may close these issues.

4 participants