auth: Wait for the connection to the carbon server to be established #4126

Merged
merged 1 commit into from Jul 28, 2016

Projects

None yet

4 participants

@rgacogne
Member
rgacogne commented Jul 6, 2016

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.

Fixes #4120.

@rgacogne rgacogne 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.
6718094
@Habbie
Member
Habbie commented Jul 7, 2016

@RvdE can you test this?

@Habbie Habbie added this to the auth-4.0.0 milestone Jul 7, 2016
@RvdE
Contributor
RvdE commented Jul 8, 2016

I've applied the patch and everything works 100% again. Thanks

@pieterlexis pieterlexis merged commit aa25fc8 into PowerDNS:master Jul 28, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@rgacogne rgacogne deleted the rgacogne:auth-carbon-freebsd branch Jul 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment