mirror of
https://github.com/curl/curl.git
synced 2026-08-01 13:58:39 +03:00
Curl_rand_bytes to control env override
- in DEBUGBUILD, all specifying if true random numbers are desired or simulated ones via CURL_ENTROPY - allows to use randoms in other DEBUG checks to not interfere with the CURL_ENTROPY - without this change, any Curl_rand() use will alter results of some AUTHENTICATION methods like DIGEST Closes #14264
This commit is contained in:
parent
0324d557e4
commit
2372a5915c
3 changed files with 42 additions and 20 deletions
|
|
@ -1464,7 +1464,7 @@ static ssize_t cf_socket_send(struct Curl_cfilter *cf, struct Curl_easy *data,
|
|||
/* simulate network blocking/partial writes */
|
||||
if(ctx->wblock_percent > 0) {
|
||||
unsigned char c = 0;
|
||||
Curl_rand(data, &c, 1);
|
||||
Curl_rand_bytes(data, FALSE, &c, 1);
|
||||
if(c >= ((100-ctx->wblock_percent)*256/100)) {
|
||||
CURL_TRC_CF(data, cf, "send(len=%zu) SIMULATE EWOULDBLOCK", orig_len);
|
||||
*err = CURLE_AGAIN;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue