[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 118/264: sockfilt: remove redundancy in timeout handling
From: |
gnunet |
Subject: |
[gnurl] 118/264: sockfilt: remove redundancy in timeout handling |
Date: |
Thu, 30 Apr 2020 16:07:01 +0200 |
This is an automated email from the git hooks/post-receive script.
nikita pushed a commit to branch master
in repository gnurl.
commit 57476a91e4c8028fcd47b8d322a2248dd2cb5091
Author: Marc Hoersken <address@hidden>
AuthorDate: Sun Mar 29 17:18:34 2020 +0200
sockfilt: remove redundancy in timeout handling
And update other logmsg output in select_ws on Windows.
---
tests/server/sockfilt.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c
index 26bbf416d..6863d17ce 100644
--- a/tests/server/sockfilt.c
+++ b/tests/server/sockfilt.c
@@ -750,7 +750,7 @@ struct select_ws_data {
HANDLE thread; /* the internal thread handle (indexed by thd) */
};
static int select_ws(int nfds, fd_set *readfds, fd_set *writefds,
- fd_set *exceptfds, struct timeval *timeout)
+ fd_set *exceptfds, struct timeval *tv)
{
HANDLE abort, mutex, signal, handle, *handles;
fd_set readsock, writesock, exceptsock;
@@ -768,9 +768,17 @@ static int select_ws(int nfds, fd_set *readfds, fd_set
*writefds,
return -1;
}
+ /* convert struct timeval to milliseconds */
+ if(tv) {
+ milliseconds = (tv->tv_sec*1000)+(DWORD)(((double)tv->tv_usec)/1000.0);
+ }
+ else {
+ milliseconds = INFINITE;
+ }
+
/* check if we got descriptors, sleep in case we got none */
if(!nfds) {
- Sleep((timeout->tv_sec*1000)+(DWORD)(((double)timeout->tv_usec)/1000.0));
+ SleepEx(milliseconds, FALSE);
return 0;
}
@@ -906,14 +914,6 @@ static int select_ws(int nfds, fd_set *readfds, fd_set
*writefds,
}
}
- /* convert struct timeval to milliseconds */
- if(timeout) {
- milliseconds = ((timeout->tv_sec * 1000) + (timeout->tv_usec / 1000));
- }
- else {
- milliseconds = INFINITE;
- }
-
/* wait for one of the internal handles to trigger */
wait = WaitForMultipleObjectsEx(nfd, handles, FALSE, milliseconds, FALSE);
@@ -981,13 +981,13 @@ static int select_ws(int nfds, fd_set *readfds, fd_set
*writefds,
for(fds = 0; fds < nfds; fds++) {
if(FD_ISSET(fds, readfds))
- logmsg("select_ws: %d is readable", fds);
+ logmsg("[select_ws] %d is readable", fds);
if(FD_ISSET(fds, writefds))
- logmsg("select_ws: %d is writable", fds);
+ logmsg("[select_ws] %d is writable", fds);
if(FD_ISSET(fds, exceptfds))
- logmsg("select_ws: %d is excepted", fds);
+ logmsg("[select_ws] %d is exceptional", fds);
}
for(idx = 0; idx < wsa; idx++) {
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 75/264: config: remove all defines of HAVE_DES_H, (continued)
- [gnurl] 75/264: config: remove all defines of HAVE_DES_H, gnunet, 2020/04/30
- [gnurl] 65/264: test970: improve the test, gnunet, 2020/04/30
- [gnurl] 82/264: docs/make: generate curl.1 from listed files only, gnunet, 2020/04/30
- [gnurl] 76/264: CI: migrate macOS jobs from Azure and Travis CI to GitHub Actions, gnunet, 2020/04/30
- [gnurl] 34/264: DISABLED: disable test 323, gnunet, 2020/04/30
- [gnurl] 42/264: tool_setopt: correct the copyright year range, gnunet, 2020/04/30
- [gnurl] 90/264: KNOWN_BUGS: "stick to same family over SOCKS pro" is presumed fixed, gnunet, 2020/04/30
- [gnurl] 63/264: TODO: Use "random" ports for the test servers, gnunet, 2020/04/30
- [gnurl] 85/264: RELEASE-NOTES: synced, gnunet, 2020/04/30
- [gnurl] 120/264: windows: enable UnixSockets with all build toolchains, gnunet, 2020/04/30
- [gnurl] 118/264: sockfilt: remove redundancy in timeout handling,
gnunet <=
- [gnurl] 97/264: output.d: quote the URL when globbing, gnunet, 2020/04/30
- [gnurl] 15/264: tests: remove python_dependencies for smbserver from our tree, gnunet, 2020/04/30
- [gnurl] 94/264: curl.h: remnove CURL_VERSION_ESNI. Never supported nor documented, gnunet, 2020/04/30
- [gnurl] 96/264: dist: add tests/version-scan.pl to tarball, gnunet, 2020/04/30
- [gnurl] 99/264: ngtcp2: update to git master for the key installation API change, gnunet, 2020/04/30
- [gnurl] 129/264: lib670: use the same Win32 API check as all other lib tests, gnunet, 2020/04/30
- [gnurl] 102/264: cleanup: insert newline after if() conditions, gnunet, 2020/04/30
- [gnurl] 87/264: mailmap: fixup a few author names/fields, gnunet, 2020/04/30
- [gnurl] 86/264: version: add 'cainfo' and 'capath' to version info struct, gnunet, 2020/04/30
- [gnurl] 100/264: cmake: add CMAKE_MSVC_RUNTIME_LIBRARY, gnunet, 2020/04/30