52 #define NOW(x,y) now.tv_sec = x; now.tv_usec = y 54 #define TIMEOUTS(x,y) data->set.timeout = x; data->set.connecttimeout = y 83 {
BASE + 4, 0, 10000, 8000,
FALSE, 6000,
"6 seconds should be left"},
84 {
BASE + 4, 990000, 10000, 8000,
FALSE, 5010,
"5010 ms should be left"},
85 {
BASE + 10, 0, 10000, 8000,
FALSE, -1,
"timeout is -1, expired"},
86 {
BASE + 12, 0, 10000, 8000,
FALSE, -2000,
"-2000, overdue 2 seconds"},
89 {
BASE + 4, 0, 10000, 8000,
TRUE, 4000,
"4 seconds should be left"},
90 {
BASE + 4, 990000, 10000, 8000,
TRUE, 3010,
"3010 ms should be left"},
91 {
BASE + 8, 0, 10000, 8000,
TRUE, -1,
"timeout is -1, expired"},
92 {
BASE + 10, 0, 10000, 8000,
TRUE, -2000,
"-2000, overdue 2 seconds"},
95 {
BASE + 4, 0, 10000, 0,
FALSE, 6000,
"6 seconds should be left"},
96 {
BASE + 4, 990000, 10000, 0,
FALSE, 5010,
"5010 ms should be left"},
97 {
BASE + 10, 0, 10000, 0,
FALSE, -1,
"timeout is -1, expired"},
98 {
BASE + 12, 0, 10000, 0,
FALSE, -2000,
"-2000, overdue 2 seconds"},
101 {
BASE + 4, 0, 10000, 0,
FALSE, 6000,
"6 seconds should be left"},
102 {
BASE + 4, 990000, 10000, 0,
FALSE, 5010,
"5010 ms should be left"},
103 {
BASE + 10, 0, 10000, 0,
FALSE, -1,
"timeout is -1, expired"},
104 {
BASE + 12, 0, 10000, 0,
FALSE, -2000,
"-2000, overdue 2 seconds"},
107 {
BASE + 4, 0, 0, 10000,
FALSE, 0,
"no timeout active"},
108 {
BASE + 4, 990000, 0, 10000,
FALSE, 0,
"no timeout active"},
109 {
BASE + 10, 0, 0, 10000,
FALSE, 0,
"no timeout active"},
110 {
BASE + 12, 0, 0, 10000,
FALSE, 0,
"no timeout active"},
113 {
BASE + 4, 0, 0, 10000,
TRUE, 6000,
"6 seconds should be left"},
114 {
BASE + 4, 990000, 0, 10000,
TRUE, 5010,
"5010 ms should be left"},
115 {
BASE + 10, 0, 0, 10000,
TRUE, -1,
"timeout is -1, expired"},
116 {
BASE + 12, 0, 0, 10000,
TRUE, -2000,
"-2000, overdue 2 seconds"},
119 {
BASE + 4, 0, 0, 0,
FALSE, 0,
"no timeout active"},
120 {
BASE + 4, 990000, 0, 0,
FALSE, 0,
"no timeout active"},
121 {
BASE + 10, 0, 0, 0,
FALSE, 0,
"no timeout active"},
122 {
BASE + 12, 0, 0, 0,
FALSE, 0,
"no timeout active"},
125 {
BASE + 4, 0, 0, 0,
TRUE, 296000,
"no timeout active"},
126 {
BASE + 4, 990000, 0, 0,
TRUE, 295010,
"no timeout active"},
127 {
BASE + 10, 0, 0, 0,
TRUE, 290000,
"no timeout active"},
128 {
BASE + 12, 0, 0, 0,
TRUE, 288000,
"no timeout active"},
131 {
BASE + 4, 0, 10000, 12000,
TRUE, 6000,
"6 seconds should be left"},
141 for(i = 0; i <
sizeof(
run)/
sizeof(run[0]); i++) {
145 if(timeout != run[i].
result)
static CURLcode unit_setup(void)
static struct Curl_easy * data
const struct timetest run[]
struct curltime t_startop
static void unit_stop(void)
time_t Curl_timeleft(struct Curl_easy *data, struct curltime *nowp, bool duringconnect)
CURL_EXTERN CURL * curl_easy_init(void)
CURL_EXTERN void curl_easy_cleanup(CURL *curl)
struct curltime t_startsingle
CURL_EXTERN void curl_global_cleanup(void)
curl_global_cleanup() globally cleanups curl, uses the value of "init_flags" to determine what needs ...