commit c6ba7ba254a4f3419c21dfb7d2164ce43d6dff0d
parent 3fddf35bb7be93d3fa1d34a0bca474bf9c210d75
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Mon, 29 Nov 2021 14:17:02 +0300
test_client_put_stop: limit total test time
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/microhttpd/test_client_put_stop.c b/src/microhttpd/test_client_put_stop.c
@@ -1399,6 +1399,7 @@ performTestQueries (struct MHD_Daemon *d, int d_port,
struct sckt_notif_cb_param *sckt_result)
{
struct simpleQueryParams qParam;
+ time_t start;
int ret = 0; /* Return value */
size_t req_total_size;
size_t limit_send_size;
@@ -1440,6 +1441,7 @@ performTestQueries (struct MHD_Daemon *d, int d_port,
MHD_REQUEST_TERMINATED_READ_ERROR :
MHD_REQUEST_TERMINATED_CLIENT_ABORT;
found_right_reason = 0;
+ start = time (NULL);
for (limit_send_size = 1; limit_send_size < req_total_size; limit_send_size++)
{
int test_succeed;
@@ -1498,6 +1500,12 @@ performTestQueries (struct MHD_Daemon *d, int d_port,
&qParam, ahc_param, uri_cb_param,
term_result, sckt_result);
}
+
+ if (time (NULL) - start > TIMEOUTS_VAL * 25)
+ {
+ ret |= 1 << 2;
+ fprintf (stderr, "FAILED: Test total time exceeded.\n");
+ }
}
MHD_stop_daemon (d);