[PATCH] poll() does not set POLLIN event flag in revents

DESCRIPTION

I noticed that WGET2-MINGW hangs indefinitely if http2 connection hangs up.

The reason for this lies in the poll() implementation in gnulib, which does not set the POLLIN event flag in revents, but only the POLLHUP flag.

I checked, the native poll implementation in Linux sets the POLIN flag along with POLLHUP in the same situation.

COMMAND TO REPRODUCE

  1. Issue the following command:
wget2.exe --mirror --http2-only --max-threads=1 --timeout=60 --tries=0 --retry-on-http-error=4*,5* --accept=pdf,doc,docx,zip --directory-prefix=C:\\Users\\litvin\\Downloads\\STANDARDS\\ETSI https://www.etsi.org/deliver/
  1. Disconnect your internet connection and wait 1 minute.

--> WGET2-MINGW hangs forever in wget_http2_get_response_cb() function (http2.c). And there is the following comment at this point:

// nbytes == 0 has been seen on Win11, continue looping

PROPOSED PATCH

In the attached patch, I propose a fix for the poll() function: 0001-Fix-poll-does-not-set-POLLIN-event-flag-in-revents.patch

Assignee Loading
Time tracking Loading