[master] 33e69f027 vtcp: Use VTIM_poll_tmo() in VTCP_read()
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Mon Feb 5 18:19:05 UTC 2024
commit 33e69f0274a5a44327acb71ec644e31d772d2e77
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date: Fri Feb 2 19:41:27 2024 +0100
vtcp: Use VTIM_poll_tmo() in VTCP_read()
diff --git a/lib/libvarnish/vtcp.c b/lib/libvarnish/vtcp.c
index d46142b46..c15dfdedf 100644
--- a/lib/libvarnish/vtcp.c
+++ b/lib/libvarnish/vtcp.c
@@ -643,10 +643,7 @@ VTCP_read(int fd, void *ptr, size_t len, vtim_dur tmo)
pfd[0].fd = fd;
pfd[0].events = POLLIN;
pfd[0].revents = 0;
- j = (int)floor(tmo * 1e3);
- if (j == 0)
- j++;
- j = poll(pfd, 1, j);
+ j = poll(pfd, 1, VTIM_poll_tmo(tmo));
if (j == 0)
return (-2);
}
More information about the varnish-commit
mailing list