]> git.ipfire.org Git - thirdparty/cups.git/commit
httpAddrConnect2: Check for error if POLLHUP is in valid revents
authorZdenek Dohnal <zdohnal@redhat.com>
Fri, 15 Dec 2023 09:59:54 +0000 (10:59 +0100)
committerZdenek Dohnal <zdohnal@redhat.com>
Fri, 15 Dec 2023 09:59:54 +0000 (10:59 +0100)
commite0c31f4794ef637b74b0a0074364ff407ca40d5a
treeb0ca6fed56ff3f4c4696a2e2e624c8e1f7243a67
parent3f36dfc2a53d45fe7147bbf71c39c1525acb47bf
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).
CHANGES.md
cups/http-addrlist.c