dns: handle early eof in tcp fallback
authorAlexey Izbyshev <izbyshev@ispras.ru>
Fri, 24 Feb 2023 20:48:55 +0000 (23:48 +0300)
committerRich Felker <dalias@aerifal.cx>
Mon, 27 Feb 2023 15:03:34 +0000 (10:03 -0500)
commitbec42ef393c0ad64e699a901ab0746d16bfde251
treed1eb9b19c3b43167c3b835ec1b2140cf0c03f265
parent9b132e556774c744f9052581d2d8d0fab417e97c
dns: handle early eof in tcp fallback

A zero returned from recvmsg is currently treated as if some data were
received, so if a DNS server closes its TCP socket before sending the
full answer, __res_msend_rc will spin until the timeout elapses because
POLLIN event will be reported on each poll. Fix this by treating an
early EOF as an error.
src/network/res_msend.c