Skip to content

Commit

Permalink
v1p: Use VTCP_poll()
Browse files Browse the repository at this point in the history
Otherwise poll(2) returns EINVAL on FreeBSD when both pipe_timeout and
pipe_task_deadline are disabled.

Fixes #4043
  • Loading branch information
dridi committed Feb 2, 2024
1 parent bb4ee3f commit f3cd69d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions bin/varnishd/http1/cache_http1_pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,12 @@ V1P_Process(const struct req *req, int fd, struct v1p_acct *v1a,
fds[1].revents = 0;
tmo = cache_param->pipe_timeout;
if (tmo == 0.)
tmo = -1.;
tmo = NAN;
if (deadline > 0.) {
tmo_task = deadline - VTIM_real();
tmo = (tmo > 0.) ? vmin(tmo, tmo_task) : tmo_task;
tmo = vmax(tmo, 0.);
tmo = vmin(tmo, tmo_task);
}
i = poll(fds, 2, (int)(tmo * 1e3));
i = VTCP_poll(fds, 2, tmo);
if (i == 0)
sc = SC_RX_TIMEOUT;
if (i < 1)
Expand Down

0 comments on commit f3cd69d

Please sign in to comment.