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

Fix Websocket timeout issues #393

Merged
merged 5 commits into from
Mar 15, 2019
Merged

Fix Websocket timeout issues #393

merged 5 commits into from
Mar 15, 2019

Conversation

HBaghdadi1995
Copy link
Contributor

@HBaghdadi1995 HBaghdadi1995 commented Mar 6, 2019

There was an issue where WebSockets would automatically timeout after a minute (#341)

Changes

ConnectionPool.jl

  • Added idle_timeout_enabled::Bool field to connection
  • Ensured connection doesn't timeout if idle_timeout_enabled::Bool == false

Servers.jl

  • Added idle_timeout_enabled = true keyword argument to Server.listen
  • Added idle_timeout_enabled = true argument to Server.listenloop

WebSockets.jl

  • WebSockets.listen opens up a websocket without causing it to crash after a minute.

Should resolve #341, #376 & #392

@HBaghdadi1995
Copy link
Contributor Author

if we're with #394 and then parts of this Pr should be migrated to websockets

@samoconnor
Copy link
Contributor

I don't think there should be any need for idle_timeout_enabled::Bool in ConnectionPool.jl. The only place it is used is in inactiveseconds, which is called by check_readtimeout which is never called unless readtimeout > 0.

I think the fix should be to change the default of readtimeout to 0 here: https://github.com/JuliaWeb/HTTP.jl/blob/master/src/Servers.jl#L198

Also, this should probably be reverted: 086157b

@HBaghdadi1995
Copy link
Contributor Author

HBaghdadi1995 commented Mar 14, 2019

Thanks Sam, I've taken your feedback and applied changes based on it.

@samoconnor samoconnor merged commit 39e89d6 into JuliaWeb:master Mar 15, 2019
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.

listen readtimeout option
2 participants