]> granicus.if.org Git - pdns/commit
Restore the existing behaviour of Socket::connect() with a 0 timeout
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 26 Apr 2018 07:38:51 +0000 (09:38 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 26 Apr 2018 07:38:51 +0000 (09:38 +0200)
commit399fd9478e0f4dd8452d0531f04d354c50c9dbfc
treef0d81db1dfe837621e359a46bf872e9783da570f
parent6d47a93bb4cd7ea62b5aa035b8d5fe1c9141e3d2
Restore the existing behaviour of Socket::connect() with a 0 timeout

73ba5999186da82b444472170f7e0ce312ce536b rightly removed the code
duplication between `Socket::connect()` and `SConnectWithTimeout()`.
Unfortunately the two codes had different behaviours when connecting
in non-blocking mode with a timeout value of zero. The first one
just returned the socket descriptor on `EINPROGRESS`, rightly
assuming that a value of 0 for the timeout meant not to wait for the
connection to established, while `SConnectWithTimeout()` did not
handle that special case, because it was never called with a value
of 0 for the timeout duration.
pdns/iputils.cc