aboutsummaryrefslogtreecommitdiff
path: root/tests/server/sockfilt.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-02-22 09:31:18 +0000
committerYang Tse <yangsita@gmail.com>2008-02-22 09:31:18 +0000
commit1d95109ffa685a30c806b4192874b2f387400aca (patch)
treee96cf2c0699499de4df719e62a9e886b03c59f1b /tests/server/sockfilt.c
parente9bb7b771287026596d03b75c3767a64b0cf3952 (diff)
Revert sockfilt.c back to revision 1.42
Changes introduced in revision 1.43 were useless
Diffstat (limited to 'tests/server/sockfilt.c')
-rw-r--r--tests/server/sockfilt.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c
index 5780e794f..aeefb23bd 100644
--- a/tests/server/sockfilt.c
+++ b/tests/server/sockfilt.c
@@ -164,7 +164,6 @@ static bool juggle(curl_socket_t *sockfdp,
curl_socket_t listenfd,
enum sockmode *mode)
{
- struct timeval initial_tv;
struct timeval timeout;
fd_set fds_read;
fd_set fds_write;
@@ -176,8 +175,6 @@ static bool juggle(curl_socket_t *sockfdp,
ssize_t nread_socket;
ssize_t bytes_written;
ssize_t buffer_len;
- long pending_ms;
- long timeout_ms = 120 * 1000;
/* 'buffer' is this excessively large only to be able to support things like
test 1003 which tests exceedingly large server response lines */
@@ -191,6 +188,9 @@ static bool juggle(curl_socket_t *sockfdp,
return FALSE;
#endif
+ timeout.tv_sec = 120;
+ timeout.tv_usec = 0;
+
FD_ZERO(&fds_read);
FD_ZERO(&fds_write);
FD_ZERO(&fds_err);
@@ -246,23 +246,9 @@ static bool juggle(curl_socket_t *sockfdp,
} /* switch(*mode) */
- pending_ms = timeout_ms;
- initial_tv = curlx_tvnow();
-
do {
- timeout.tv_sec = pending_ms / 1000;
- timeout.tv_usec = (pending_ms % 1000) * 1000;
- rc = select((int)maxfd + 1, &fds_read, &fds_write, &fds_err, &timeout);
- if(rc != -1)
- break;
- if(SOCKERRNO != EINTR)
- break;
- pending_ms = timeout_ms - curlx_tvdiff(curlx_tvnow(), initial_tv);
- if(pending_ms <= 0) {
- rc = 0;
- break;
- }
- } while(rc == -1);
+ rc = select(maxfd + 1, &fds_read, &fds_write, &fds_err, &timeout);
+ } while((rc == -1) && (SOCKERRNO == EINTR));
switch(rc) {
case -1: