mirror of
https://github.com/curl/curl.git
synced 2026-05-30 15:17:27 +03:00
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 <randall.becker@nexbridge.ca>
This commit is contained in:
parent
ae4ec1d2ec
commit
aed732acb1
2 changed files with 20 additions and 0 deletions
|
|
@ -103,6 +103,9 @@ static CURLcode send_binary(CURL *curl, char *buf, size_t buflen)
|
|||
return result;
|
||||
}
|
||||
|
||||
#if defined(__TANDEM)
|
||||
# include <cextdecs.h(PROCESS_DELAY_)>
|
||||
#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
|
||||
|
|
|
|||
|
|
@ -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 <cextdecs.h(PROCESS_DELAY_)>
|
||||
#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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue