diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 1840aeff04..dde3f89e28 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -1139,8 +1139,10 @@ typedef unsigned int curl_bit; #if EAGAIN != SOCKEWOULDBLOCK #define SOCK_EAGAIN_EWOULDBLOCK(e) ((e) == EAGAIN || (e) == SOCKEWOULDBLOCK) +#define RAW_EAGAIN_EWOULDBLOCK(e) ((e) == EAGAIN || (e) == EWOULDBLOCK) #else #define SOCK_EAGAIN_EWOULDBLOCK(e) ((e) == EAGAIN) +#define RAW_EAGAIN_EWOULDBLOCK(e) ((e) == EAGAIN) #endif /* diff --git a/lib/vtls/rustls.c b/lib/vtls/rustls.c index 8d0285a74b..f56ea07825 100644 --- a/lib/vtls/rustls.c +++ b/lib/vtls/rustls.c @@ -160,11 +160,7 @@ static ssize_t tls_recv_more(struct Curl_cfilter *cf, io_ctx.data = data; io_error = rustls_connection_read_tls(backend->conn, read_cb, &io_ctx, &tls_bytes_read); - if(io_error == EWOULDBLOCK -#if EAGAIN != EWOULDBLOCK - || io_error == EAGAIN -#endif - ) { + if(RAW_EAGAIN_EWOULDBLOCK(io_error)) { *err = CURLE_AGAIN; return -1; } @@ -274,11 +270,7 @@ static CURLcode cr_flush_out(struct Curl_cfilter *cf, struct Curl_easy *data, while(rustls_connection_wants_write(rconn)) { io_error = rustls_connection_write_tls(rconn, write_cb, &io_ctx, &tlswritten); - if(io_error == EWOULDBLOCK -#if EAGAIN != EWOULDBLOCK - || io_error == EAGAIN -#endif - ) { + if(RAW_EAGAIN_EWOULDBLOCK(io_error)) { CURL_TRC_CF(data, cf, "cf_send: EAGAIN after %zu bytes", tlswritten_total); return CURLE_AGAIN;