]> git.ipfire.org Git - thirdparty/pdns.git/commit
auth: Wait for the connection to the carbon server to be established 4126/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 6 Jul 2016 16:12:08 +0000 (18:12 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 6 Jul 2016 16:12:08 +0000 (18:12 +0200)
commit671809420f0adca93f3686af46711fece8f16160
treecc62f713e2756f48f26d751e95bf773dc599053b
parent7f1a3cc238a10f0bbae39f0b602423a3ce9a6357
auth: Wait for the connection to the carbon server to be established

Doing a non-blocking `connect()` immediately followed by a `write()`
cause the `write()` to fail with `ENOTCONN` on FreeBSD.
This commit instead wait for the `connect()` operation to finish
using `poll()` with a short timeout if it returned `EINPROGRESS`,
so that either we have a connected socket to write to, or we fail.
pdns/auth-carbon.cc
pdns/sstuff.hh