]> granicus.if.org Git - curl/commit
connect: fix race condition with happy eyeballs timeout
authorAnders Bakken <agbakken@gmail.com>
Thu, 28 Sep 2017 15:20:04 +0000 (08:20 -0700)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 29 Sep 2017 06:51:59 +0000 (08:51 +0200)
commit49d75a4c15393d66e9f3e0ce289a610da4d6e5a9
tree1f8ac13f83a587acf1b2d481db511b5014391693
parentc66d94d6da50b20a8bc218683bc88b54ac15d6c2
connect: fix race condition with happy eyeballs timeout

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
lib/connect.c