From: Randall S. Becker Date: Tue, 10 Dec 2024 20:02:00 +0000 (+0000) Subject: tests/http/clients: use proper sleep() call on NonStop X-Git-Tag: curl-8_12_0~365 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aed732acb1252dcd096c295ef28391c99422d2fb;p=thirdparty%2Fcurl.git tests/http/clients: use proper sleep() call on NonStop This fix impacts ws-data.c and ws-pingpong.c. sleep() replaced with system PROCESS_DELAY_() having the same resolution as usleep(). Fixes #15711 Closes #15712 Signed-off-by: Randall S. Becker --- diff --git a/tests/http/clients/ws-data.c b/tests/http/clients/ws-data.c index 6698326dfb..4a3be67bf2 100644 --- a/tests/http/clients/ws-data.c +++ b/tests/http/clients/ws-data.c @@ -103,6 +103,9 @@ static CURLcode send_binary(CURL *curl, char *buf, size_t buflen) return result; } +#if defined(__TANDEM) +# include +#endif static CURLcode recv_binary(CURL *curl, char *exp_data, size_t exp_len) { const struct curl_ws_frame *frame; @@ -118,6 +121,13 @@ static CURLcode recv_binary(CURL *curl, char *exp_data, size_t exp_len) fprintf(stderr, "EAGAIN, sleep, try again\n"); #ifdef _WIN32 Sleep(100); +#elif defined(__TANDEM) + /* NonStop only defines usleep when building for a threading model */ +# if defined(_PUT_MODEL_) || defined(_KLT_MODEL_) + usleep(100*1000); +# else + PROCESS_DELAY_(100*1000); +# endif #else usleep(100*1000); #endif diff --git a/tests/http/clients/ws-pingpong.c b/tests/http/clients/ws-pingpong.c index efb01bcd71..f11d217f47 100644 --- a/tests/http/clients/ws-pingpong.c +++ b/tests/http/clients/ws-pingpong.c @@ -94,6 +94,9 @@ static void websocket_close(CURL *curl) "ws: curl_ws_send returned %u, sent %u\n", (int)result, (int)sent); } +#if defined(__TANDEM) +# include +#endif static CURLcode pingpong(CURL *curl, const char *payload) { CURLcode res; @@ -108,6 +111,13 @@ static CURLcode pingpong(CURL *curl, const char *payload) if(res == CURLE_AGAIN) { #ifdef _WIN32 Sleep(100); +#elif defined(__TANDEM) + /* NonStop only defines usleep when building for a threading model */ +# if defined(_PUT_MODEL_) || defined(_KLT_MODEL_) + usleep(100*1000); +# else + PROCESS_DELAY_(100*1000); +# endif #else usleep(100*1000); #endif