Improve stability by exiting immediately on common errors #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR improves stability and user experience by terminating, instead of waiting indefinitely, in the following cases:
Kill connections in the
shared::proxy()
function when either duplex stream direction terminates, rather than both.For example, if a user starts a connection at
bore.pub:12345
that forwards a raw HTTP/2 connection to their localhost port, and they kill the web server at that port, then previously future HTTP/2 requests in the same browser session tobore.pub:12345
would hang indefinitely because they would reuse the same TCP stream. With this change, the TCP stream would be closed immediately instead.Adds a timeout to initial protocol messages.
Initial protocol messages should be expected immediately, so if they are not sent, that indicates a network partition or other issue. This adds a timeout to such messages. It catches cases such as when the
-s
flag is passed tobore local
even when the server is configured to not use a secret. Previously this case would wait indefinitely for a server challenge.Adds a timeout to initial TCP connections.
This fixes issues such as typo in the TCP connection string. Previously running something like
bore local 5000 --to google.com
would wait indefinitely for a connection togoogle.com:7835
. Now it terminates gracefully with an error.