diff options
Diffstat (limited to 'src/testspdy/test_session_timeout.c')
-rw-r--r-- | src/testspdy/test_session_timeout.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/testspdy/test_session_timeout.c b/src/testspdy/test_session_timeout.c index a89933b4..548a2128 100644 --- a/src/testspdy/test_session_timeout.c +++ b/src/testspdy/test_session_timeout.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include "common.h" | 31 | #include "common.h" |
32 | #include <sys/time.h> | 32 | #include <sys/time.h> |
33 | #include <sys/stat.h> | 33 | #include <sys/stat.h> |
34 | #include "../microspdy/internal.h" | ||
34 | 35 | ||
35 | #define TIMEOUT 2 | 36 | #define TIMEOUT 2 |
36 | #define SELECT_MS_TIMEOUT 20 | 37 | #define SELECT_MS_TIMEOUT 20 |
@@ -102,7 +103,6 @@ parentproc() | |||
102 | int childstatus; | 103 | int childstatus; |
103 | unsigned long long timeoutlong=0; | 104 | unsigned long long timeoutlong=0; |
104 | struct timeval timeout; | 105 | struct timeval timeout; |
105 | struct timespec ts; | ||
106 | int ret; | 106 | int ret; |
107 | fd_set read_fd_set; | 107 | fd_set read_fd_set; |
108 | fd_set write_fd_set; | 108 | fd_set write_fd_set; |
@@ -150,10 +150,7 @@ parentproc() | |||
150 | { | 150 | { |
151 | killchild("SPDY_get_timeout returned wrong timeout"); | 151 | killchild("SPDY_get_timeout returned wrong timeout"); |
152 | }*/ | 152 | }*/ |
153 | if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) | 153 | now = SPDYF_monotonic_time (); |
154 | now = ts.tv_nsec / 1000000 + ts.tv_sec*1000; | ||
155 | else | ||
156 | killchild("clock_gettime returned wrong value"); | ||
157 | if(now - beginning > TIMEOUT*1000 + SELECT_MS_TIMEOUT) | 154 | if(now - beginning > TIMEOUT*1000 + SELECT_MS_TIMEOUT) |
158 | { | 155 | { |
159 | printf("Started at: %llums\n",beginning); | 156 | printf("Started at: %llums\n",beginning); |
@@ -217,10 +214,7 @@ parentproc() | |||
217 | SPDY_run(daemon); | 214 | SPDY_run(daemon); |
218 | if(0 == beginning) | 215 | if(0 == beginning) |
219 | { | 216 | { |
220 | if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) | 217 | beginning = SPDYF_monotonic_time (); |
221 | beginning = ts.tv_nsec / 1000000 + ts.tv_sec*1000; | ||
222 | else | ||
223 | killchild("clock_gettime returned wrong number"); | ||
224 | } | 218 | } |
225 | /*if(do_sleep) | 219 | /*if(do_sleep) |
226 | { | 220 | { |