From: zdohnal Date: Thu, 14 Dec 2023 16:33:40 +0000 (+0100) Subject: httpAddrConnect2: Check for error if POLLHUP is in valid revents X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9fe54b5c54db7f2e620fbb3d17a627b5393a76a;p=thirdparty%2Fcups.git httpAddrConnect2: Check for error if POLLHUP is in valid revents Some Linux kernel versions put POLLOUT|POLLHUP into revents when client tries to connect with httpAddrConnect2(), which makes the connection fail. Let's check the option SO_ERROR before scratching the attempt - if there is no error, remove POLLHUP from revents. I've re-purposed previously Solaris-only code to be used everywhere if the conditions are met - this should prevent bigger delays than necessary. Slightly different issue than #827, but with similar symptoms (kernel sending POLLOUT|POLLHUP). --- c9fe54b5c54db7f2e620fbb3d17a627b5393a76a