[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 40/153: sws: handle EINTR when calling select()
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 40/153: sws: handle EINTR when calling select() |
Date: |
Tue, 11 Sep 2018 12:51:51 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 3db628360ced36ad73ab75036d6fed9738f59871
Author: Michael Kaufmann <address@hidden>
AuthorDate: Sun Jul 29 13:47:31 2018 +0200
sws: handle EINTR when calling select()
Closes https://github.com/curl/curl/pull/2808
---
tests/server/sws.c | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/tests/server/sws.c b/tests/server/sws.c
index ec11224f5..4879cfa8b 100644
--- a/tests/server/sws.c
+++ b/tests/server/sws.c
@@ -1536,18 +1536,18 @@ static void http_connect(curl_socket_t *infdp,
if(got_exit_signal)
break;
- rc = select((int)maxfd + 1, &input, &output, NULL, &timeout);
+ do {
+ rc = select((int)maxfd + 1, &input, &output, NULL, &timeout);
+ } while(rc < 0 && errno == EINTR && !got_exit_signal);
+
+ if(got_exit_signal)
+ break;
if(rc > 0) {
/* socket action */
- bool tcp_fin_wr;
+ bool tcp_fin_wr = FALSE;
timeout_count = 0;
- if(got_exit_signal)
- break;
-
- tcp_fin_wr = FALSE;
-
/* ---------------------------------------------------------- */
/* passive mode FTP may establish a secondary tunnel */
@@ -2289,7 +2289,13 @@ int main(int argc, char *argv[])
if(got_exit_signal)
goto sws_cleanup;
- rc = select((int)maxfd + 1, &input, &output, NULL, &timeout);
+ do {
+ rc = select((int)maxfd + 1, &input, &output, NULL, &timeout);
+ } while(rc < 0 && errno == EINTR && !got_exit_signal);
+
+ if(got_exit_signal)
+ goto sws_cleanup;
+
if(rc < 0) {
error = SOCKERRNO;
logmsg("select() failed with error: (%d) %s",
@@ -2297,9 +2303,6 @@ int main(int argc, char *argv[])
goto sws_cleanup;
}
- if(got_exit_signal)
- goto sws_cleanup;
-
if(rc == 0) {
/* Timed out - try again */
continue;
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 45/153: retry: return error if rewind was necessary but didn't happen, (continued)
- [GNUnet-SVN] [gnurl] 45/153: retry: return error if rewind was necessary but didn't happen, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 53/153: hostip: fix unused variable warning, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 47/153: HTTP: Don't attempt to needlessly decompress redirect body, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 23/153: test320: treat curl320.out file as binary, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 44/153: http2: clear the drain counter in Curl_http2_done, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 01/153: examples/crawler.c: move #ifdef to column 0, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 24/153: auth: only ever pick CURLAUTH_BEARER if we *have* a Bearer token, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 37/153: TODO: Support Authority Information Access certificate extension (AIA), gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 35/153: test1157: test -H from empty file, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 39/153: test1157: follow-up to 35ecffb9, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 40/153: sws: handle EINTR when calling select(),
gnunet <=
- [GNUnet-SVN] [gnurl] 05/153: ares: check for NULL in completed-callback, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 28/153: wolfSSL/CyaSSL: Fix memory leak in Curl_cyassl_random, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 43/153: smb: fix memory leak on early failure, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 16/153: RELEASE-NOTES: sync, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 13/153: darwinssl: add support for ALPN negotiation, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 34/153: curl: Fix segfault when -H @headerfile is empty, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 27/153: reuse_conn(): free old_conn->options, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 08/153: docs/SECURITY-PROCESS: mention bounty, drop pre-notify, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 19/153: http2: several cleanups, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 02/153: schannel: fix MinGW compile break, gnunet, 2018/09/11