diff --git a/lib/cf-socket.c b/lib/cf-socket.c index ac74e5c026..803ae97b6b 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -1567,7 +1567,7 @@ static CURLcode cf_socket_send(struct Curl_cfilter *cf, struct Curl_easy *data, /* errno may be EWOULDBLOCK or on some systems EAGAIN when it returned due to its inability to send off data without blocking. We therefore treat both error codes the same here */ - SOCK_EAGAIN_EWOULDBLOCK(sockerr) || + SOCK_EWOULDBLOCK_EAGAIN(sockerr) || (SOCKEINTR == sockerr) || (SOCKEINPROGRESS == sockerr) #endif @@ -1633,7 +1633,7 @@ static CURLcode cf_socket_recv(struct Curl_cfilter *cf, struct Curl_easy *data, /* errno may be EWOULDBLOCK or on some systems EAGAIN when it returned due to its inability to send off data without blocking. We therefore treat both error codes the same here */ - SOCK_EAGAIN_EWOULDBLOCK(sockerr) || + SOCK_EWOULDBLOCK_EAGAIN(sockerr) || (SOCKEINTR == sockerr) #endif ) { diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 38e3003e9e..9cda99ab88 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -1138,9 +1138,9 @@ typedef unsigned int curl_bit; #endif #if !defined(USE_WINSOCK) && EAGAIN != SOCKEWOULDBLOCK -#define SOCK_EAGAIN_EWOULDBLOCK(e) ((e) == SOCKEWOULDBLOCK || (e) == EAGAIN) +#define SOCK_EWOULDBLOCK_EAGAIN(e) ((e) == SOCKEWOULDBLOCK || (e) == EAGAIN) #else -#define SOCK_EAGAIN_EWOULDBLOCK(e) ((e) == SOCKEWOULDBLOCK) +#define SOCK_EWOULDBLOCK_EAGAIN(e) ((e) == SOCKEWOULDBLOCK) #endif /* diff --git a/lib/socketpair.c b/lib/socketpair.c index 912c107f64..fc5ae15e4b 100644 --- a/lib/socketpair.c +++ b/lib/socketpair.c @@ -240,7 +240,7 @@ static int wakeup_inet(curl_socket_t socks[2], bool nonblocking) /* errno may be EWOULDBLOCK or on some systems EAGAIN when it returned due to its inability to send off data without blocking. We therefore treat both error codes the same here */ - SOCK_EAGAIN_EWOULDBLOCK(sockerr) || + SOCK_EWOULDBLOCK_EAGAIN(sockerr) || (SOCKEINTR == sockerr) || (SOCKEINPROGRESS == sockerr) #endif ) { @@ -326,7 +326,7 @@ int Curl_wakeup_signal(curl_socket_t socks[2]) #else if(err == SOCKEINTR) continue; - if(SOCK_EAGAIN_EWOULDBLOCK(err)) + if(SOCK_EWOULDBLOCK_EAGAIN(err)) err = 0; /* wakeup is already ongoing */ #endif } @@ -352,7 +352,7 @@ CURLcode Curl_wakeup_consume(curl_socket_t socks[2], bool all) #else if(SOCKERRNO == SOCKEINTR) continue; - if(SOCK_EAGAIN_EWOULDBLOCK(SOCKERRNO)) + if(SOCK_EWOULDBLOCK_EAGAIN(SOCKERRNO)) break; #endif result = CURLE_READ_ERROR; diff --git a/lib/vquic/vquic.c b/lib/vquic/vquic.c index aa04fcbbdb..0bddc1afb4 100644 --- a/lib/vquic/vquic.c +++ b/lib/vquic/vquic.c @@ -206,7 +206,7 @@ static CURLcode do_sendmsg(struct Curl_cfilter *cf, ; if(!curlx_sztouz(rv, psent)) { - if(SOCK_EAGAIN_EWOULDBLOCK(SOCKERRNO)) { + if(SOCK_EWOULDBLOCK_EAGAIN(SOCKERRNO)) { result = CURLE_AGAIN; goto out; } @@ -487,7 +487,7 @@ static CURLcode recvmmsg_packets(struct Curl_cfilter *cf, (SOCKERRNO == SOCKEINTR || SOCKERRNO == SOCKEMSGSIZE)) ; if(mcount == -1) { - if(SOCK_EAGAIN_EWOULDBLOCK(SOCKERRNO)) { + if(SOCK_EWOULDBLOCK_EAGAIN(SOCKERRNO)) { CURL_TRC_CF(data, cf, "ingress, recvmmsg -> EAGAIN"); goto out; } @@ -574,7 +574,7 @@ static CURLcode recvmsg_packets(struct Curl_cfilter *cf, (SOCKERRNO == SOCKEINTR || SOCKERRNO == SOCKEMSGSIZE)) ; if(!curlx_sztouz(rc, &nread)) { - if(SOCK_EAGAIN_EWOULDBLOCK(SOCKERRNO)) { + if(SOCK_EWOULDBLOCK_EAGAIN(SOCKERRNO)) { goto out; } if(!cf->connected && SOCKERRNO == SOCKECONNREFUSED) { @@ -644,7 +644,7 @@ static CURLcode recvfrom_packets(struct Curl_cfilter *cf, (SOCKERRNO == SOCKEINTR || SOCKERRNO == SOCKEMSGSIZE)) ; if(!curlx_sztouz(rv, &nread)) { - if(SOCK_EAGAIN_EWOULDBLOCK(SOCKERRNO)) { + if(SOCK_EWOULDBLOCK_EAGAIN(SOCKERRNO)) { CURL_TRC_CF(data, cf, "ingress, recvfrom -> EAGAIN"); goto out; } diff --git a/lib/vtls/rustls.c b/lib/vtls/rustls.c index 43125355df..b598a174fb 100644 --- a/lib/vtls/rustls.c +++ b/lib/vtls/rustls.c @@ -46,9 +46,9 @@ #endif #if EAGAIN != SOCKEWOULDBLOCK -#define RAW_EAGAIN_EWOULDBLOCK(e) ((e) == EWOULDBLOCK || (e) == EAGAIN) +#define RAW_EWOULDBLOCK_EAGAIN(e) ((e) == EWOULDBLOCK || (e) == EAGAIN) #else -#define RAW_EAGAIN_EWOULDBLOCK(e) ((e) == EWOULDBLOCK) +#define RAW_EWOULDBLOCK_EAGAIN(e) ((e) == EWOULDBLOCK) #endif struct rustls_ssl_backend_data { @@ -166,7 +166,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(RAW_EAGAIN_EWOULDBLOCK(io_error)) { + if(RAW_EWOULDBLOCK_EAGAIN(io_error)) { *err = CURLE_AGAIN; return -1; } @@ -276,7 +276,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(RAW_EAGAIN_EWOULDBLOCK(io_error)) { + if(RAW_EWOULDBLOCK_EAGAIN(io_error)) { CURL_TRC_CF(data, cf, "cf_send: EAGAIN after %zu bytes", tlswritten_total); return CURLE_AGAIN; diff --git a/tests/server/sws.c b/tests/server/sws.c index cab8d58755..9ead98e206 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -976,7 +976,7 @@ static int sws_send_doc(curl_socket_t sock, struct sws_httprequest *req) retry: written = swrite(sock, buffer, num); if(written < 0) { - if(SOCK_EAGAIN_EWOULDBLOCK(SOCKERRNO)) { + if(SOCK_EWOULDBLOCK_EAGAIN(SOCKERRNO)) { curlx_wait_ms(10); goto retry; } @@ -1133,7 +1133,7 @@ static int sws_get_request(curl_socket_t sock, struct sws_httprequest *req) logmsg("Got %zd bytes from client", got); } - if((got == -1) && SOCK_EAGAIN_EWOULDBLOCK(SOCKERRNO)) { + if((got == -1) && SOCK_EWOULDBLOCK_EAGAIN(SOCKERRNO)) { int rc; fd_set input; fd_set output; @@ -1193,7 +1193,7 @@ static int sws_get_request(curl_socket_t sock, struct sws_httprequest *req) else if(got < 0) { char errbuf[STRERROR_LEN]; int error = SOCKERRNO; - if(SOCK_EAGAIN_EWOULDBLOCK(error)) { + if(SOCK_EWOULDBLOCK_EAGAIN(error)) { /* nothing to read at the moment */ return 0; } @@ -1821,7 +1821,7 @@ static curl_socket_t accept_connection(curl_socket_t sock) if(msgsock == CURL_SOCKET_BAD) { error = SOCKERRNO; - if(SOCK_EAGAIN_EWOULDBLOCK(error)) { + if(SOCK_EWOULDBLOCK_EAGAIN(error)) { /* nothing to accept */ return 0; }