]> git.ipfire.org Git - thirdparty/cups.git/commit
httpAddrConnect2: Check for error if POLLHUP is in valid revents 839/head
authorZdenek Dohnal <zdohnal@redhat.com>
Thu, 14 Dec 2023 08:37:22 +0000 (09:37 +0100)
committerZdenek Dohnal <zdohnal@redhat.com>
Thu, 14 Dec 2023 08:37:22 +0000 (09:37 +0100)
commit289685fbfdaee9d6f364111dfd8017eb8aaf2afb
tree90d8b87bdf5bcbb372a8b6c7073ef42ff879fb39
parent97d269c22c6103bb600dbe9944dc28f19c90d19e
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).
cups/http-addrlist.c