From 17a823bdb5690d7be926f280526487fb1b5db1d3 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 12 Jun 2026 23:07:30 +0200 Subject: [PATCH] dedupe comments --- lib/cf-socket.c | 6 ------ lib/curl_setup.h | 3 +++ lib/socketpair.c | 3 --- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/cf-socket.c b/lib/cf-socket.c index 7f534c2a34..fb9160a391 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -1547,9 +1547,6 @@ static CURLcode cf_socket_send(struct Curl_cfilter *cf, struct Curl_easy *data, if(!curlx_sztouz(rv, pnwritten)) { int sockerr = SOCKERRNO; - /* The socket error 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 */ if(SOCK_EAGAIN(sockerr) #ifndef USE_WINSOCK || (sockerr == SOCKEINTR) || (sockerr == SOCKEINPROGRESS) @@ -1606,9 +1603,6 @@ static CURLcode cf_socket_recv(struct Curl_cfilter *cf, struct Curl_easy *data, if(!curlx_sztouz(rv, pnread)) { int sockerr = SOCKERRNO; - /* The socket error may be EWOULDBLOCK or on some systems EAGAIN when - it returned due to its inability to read data without blocking. - We therefore treat both error codes the same here */ if(SOCK_EAGAIN(sockerr) #ifndef USE_WINSOCK || (sockerr == SOCKEINTR) diff --git a/lib/curl_setup.h b/lib/curl_setup.h index 0d6488e833..42106e5468 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -1137,6 +1137,9 @@ typedef unsigned int curl_bit; #define SOCKEWOULDBLOCK EWOULDBLOCK #endif +/* The socket error may be EWOULDBLOCK or on some systems EAGAIN when + it returned due to its inability to send/read data without blocking. + We therefore treat both error codes the same here */ #if !defined(USE_WINSOCK) && EAGAIN != SOCKEWOULDBLOCK #define SOCK_EAGAIN(e) ((e) == SOCKEWOULDBLOCK || (e) == EAGAIN) #else diff --git a/lib/socketpair.c b/lib/socketpair.c index 0bcfbbbba2..eb4a0f2db9 100644 --- a/lib/socketpair.c +++ b/lib/socketpair.c @@ -232,9 +232,6 @@ static int wakeup_inet(curl_socket_t socks[2], bool nonblocking) /* Do not block forever */ if(curlx_timediff_ms(curlx_now(), start) > (60 * 1000)) goto error; - /* The socket error may be EWOULDBLOCK or on some systems EAGAIN when - it returned due to its inability to read data without blocking. - We therefore treat both error codes the same here */ if(SOCK_EAGAIN(sockerr) #ifndef USE_WINSOCK || (sockerr == SOCKEINTR) || (sockerr == SOCKEINPROGRESS)