Happy eyeballs fixes#1928
Closed
Andersbakken wants to merge 4 commits into
Closed
Conversation
The timer should be started after conn->connecttime is set. Otherwise
the timer could expire without this condition being true:
/* should we try another protocol family? */
if(i == 0 && conn->tempaddr[1] == NULL &&
curlx_tvdiff(now, conn->connecttime) >= HAPPY_EYEBALLS_TIMEOUT) {
bagder
reviewed
Sep 28, 2017
Member
There was a problem hiding this comment.
You'll need to edit symbols-in-versions too and add a man page for the new option. I think this option makes perfect sence and I'm +1 on adding it, but the new option needs to wait for the feature window after the pending release but the bugfix part can be cherry-picked already now.
Contributor
Author
|
I added docs and updated symbols-in-versions. I assumed 7.55.3 for the version. Is that correct? Thanks. |
bagder
pushed a commit
that referenced
this pull request
Sep 29, 2017
The timer should be started after conn->connecttime is set. Otherwise
the timer could expire without this condition being true:
/* should we try another protocol family? */
if(i == 0 && conn->tempaddr[1] == NULL &&
curlx_tvdiff(now, conn->connecttime) >= HAPPY_EYEBALLS_TIMEOUT) {
Ref: #1928
Member
|
I cherry-picked the first commit into master now, see 49d75a4 |
Andersbakken
added a commit
to Andersbakken/curl
that referenced
this pull request
Oct 20, 2017
Member
|
@Andersbakken: If you can rebase this and fix the conflicts, we can work on merging this PR! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
I have two patches for happy eyeballs.
3e50c6a
Fixes a race condition that can happen if the thread running libcurl gets preempted at certain times.
The following can happen:
thread is stalled a little bit:
singleipconnect is called at 3 ms
conn->connecttime is set to 3ms
curl_multi_perform is called at 201 ms,
struct curltime now = Curl_tvnow(); is set to 201
Curl_is_connected is called at 201 ms.
This statement is false:
curlx_tvdiff(now, conn->connecttime) >= HAPPY_EYEBALLS_TIMEOUT) {
curl_multi_perform removes the happy eyeballs timer since 201 >= 200 with this statement:
multi->timetree = Curl_splaygetbest(now, multi->timetree, &t);
The timer never fires.
ed1fb2d
adds a feature to set customize the 200ms delay for happy eyeballs to whatever one wants.