mirror of
https://github.com/curl/curl.git
synced 2026-06-13 11:05:38 +03:00
shorten name
This commit is contained in:
parent
62b92b22df
commit
4da0f86d20
7 changed files with 24 additions and 25 deletions
|
|
@ -939,7 +939,7 @@ static bool verifyconnect(curl_socket_t sockfd, int *error)
|
|||
static CURLcode socket_connect_result(struct Curl_easy *data,
|
||||
const char *ipaddress, int error)
|
||||
{
|
||||
if(SOCK_EWOULDBLOCK_EAGAIN(error) || error == SOCKEINPROGRESS)
|
||||
if(SOCK_EAGAIN(error) || error == SOCKEINPROGRESS)
|
||||
return CURLE_OK;
|
||||
|
||||
/* unknown error, fallthrough and try another address! */
|
||||
|
|
@ -1550,7 +1550,7 @@ static CURLcode cf_socket_send(struct Curl_cfilter *cf, struct Curl_easy *data,
|
|||
/* 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_EWOULDBLOCK_EAGAIN(sockerr)
|
||||
if(SOCK_EAGAIN(sockerr)
|
||||
#ifndef USE_WINSOCK
|
||||
|| (sockerr == SOCKEINTR) || (sockerr == SOCKEINPROGRESS)
|
||||
#endif
|
||||
|
|
@ -1609,7 +1609,7 @@ static CURLcode cf_socket_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
|
|||
/* 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_EWOULDBLOCK_EAGAIN(sockerr)
|
||||
if(SOCK_EAGAIN(sockerr)
|
||||
#ifndef USE_WINSOCK
|
||||
|| (sockerr == SOCKEINTR)
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1138,9 +1138,9 @@ typedef unsigned int curl_bit;
|
|||
#endif
|
||||
|
||||
#if !defined(USE_WINSOCK) && EAGAIN != SOCKEWOULDBLOCK
|
||||
#define SOCK_EWOULDBLOCK_EAGAIN(e) ((e) == SOCKEWOULDBLOCK || (e) == EAGAIN)
|
||||
#define SOCK_EAGAIN(e) ((e) == SOCKEWOULDBLOCK || (e) == EAGAIN)
|
||||
#else
|
||||
#define SOCK_EWOULDBLOCK_EAGAIN(e) ((e) == SOCKEWOULDBLOCK)
|
||||
#define SOCK_EAGAIN(e) ((e) == SOCKEWOULDBLOCK)
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ static int wakeup_inet(curl_socket_t socks[2], bool nonblocking)
|
|||
/* 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_EWOULDBLOCK_EAGAIN(sockerr)
|
||||
if(SOCK_EAGAIN(sockerr)
|
||||
#ifndef USE_WINSOCK
|
||||
|| (sockerr == SOCKEINTR) || (sockerr == SOCKEINPROGRESS)
|
||||
#endif
|
||||
|
|
@ -320,7 +320,7 @@ int Curl_wakeup_signal(curl_socket_t socks[2])
|
|||
if(err == SOCKEINTR)
|
||||
continue;
|
||||
#endif
|
||||
if(SOCK_EWOULDBLOCK_EAGAIN(err))
|
||||
if(SOCK_EAGAIN(err))
|
||||
err = 0; /* wakeup is already ongoing */
|
||||
}
|
||||
break;
|
||||
|
|
@ -344,7 +344,7 @@ CURLcode Curl_wakeup_consume(curl_socket_t socks[2], bool all)
|
|||
if(err == SOCKEINTR)
|
||||
continue;
|
||||
#endif
|
||||
if(SOCK_EWOULDBLOCK_EAGAIN(err))
|
||||
if(SOCK_EAGAIN(err))
|
||||
break;
|
||||
result = CURLE_READ_ERROR;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ static CURLcode do_sendmsg(struct Curl_cfilter *cf,
|
|||
|
||||
if(!curlx_sztouz(rv, psent)) {
|
||||
int err = SOCKERRNO;
|
||||
if(SOCK_EWOULDBLOCK_EAGAIN(err))
|
||||
if(SOCK_EAGAIN(err))
|
||||
return CURLE_AGAIN;
|
||||
switch(err) {
|
||||
case SOCKEMSGSIZE:
|
||||
|
|
@ -203,7 +203,7 @@ static CURLcode do_sendmsg(struct Curl_cfilter *cf,
|
|||
;
|
||||
|
||||
if(!curlx_sztouz(rv, psent)) {
|
||||
if(SOCK_EWOULDBLOCK_EAGAIN(SOCKERRNO)) {
|
||||
if(SOCK_EAGAIN(SOCKERRNO)) {
|
||||
result = CURLE_AGAIN;
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -484,7 +484,7 @@ static CURLcode recvmmsg_packets(struct Curl_cfilter *cf,
|
|||
(SOCKERRNO == SOCKEINTR || SOCKERRNO == SOCKEMSGSIZE))
|
||||
;
|
||||
if(mcount == -1) {
|
||||
if(SOCK_EWOULDBLOCK_EAGAIN(SOCKERRNO)) {
|
||||
if(SOCK_EAGAIN(SOCKERRNO)) {
|
||||
CURL_TRC_CF(data, cf, "ingress, recvmmsg -> EAGAIN");
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -571,7 +571,7 @@ static CURLcode recvmsg_packets(struct Curl_cfilter *cf,
|
|||
(SOCKERRNO == SOCKEINTR || SOCKERRNO == SOCKEMSGSIZE))
|
||||
;
|
||||
if(!curlx_sztouz(rc, &nread)) {
|
||||
if(SOCK_EWOULDBLOCK_EAGAIN(SOCKERRNO)) {
|
||||
if(SOCK_EAGAIN(SOCKERRNO)) {
|
||||
goto out;
|
||||
}
|
||||
if(!cf->connected && SOCKERRNO == SOCKECONNREFUSED) {
|
||||
|
|
@ -641,7 +641,7 @@ static CURLcode recvfrom_packets(struct Curl_cfilter *cf,
|
|||
(SOCKERRNO == SOCKEINTR || SOCKERRNO == SOCKEMSGSIZE))
|
||||
;
|
||||
if(!curlx_sztouz(rv, &nread)) {
|
||||
if(SOCK_EWOULDBLOCK_EAGAIN(SOCKERRNO)) {
|
||||
if(SOCK_EAGAIN(SOCKERRNO)) {
|
||||
CURL_TRC_CF(data, cf, "ingress, recvfrom -> EAGAIN");
|
||||
goto out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,9 +46,9 @@
|
|||
#endif
|
||||
|
||||
#if EAGAIN != EWOULDBLOCK
|
||||
#define RAW_EWOULDBLOCK_EAGAIN(e) ((e) == EWOULDBLOCK || (e) == EAGAIN)
|
||||
#define RAW_EAGAIN(e) ((e) == EWOULDBLOCK || (e) == EAGAIN)
|
||||
#else
|
||||
#define RAW_EWOULDBLOCK_EAGAIN(e) ((e) == EWOULDBLOCK)
|
||||
#define RAW_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_EWOULDBLOCK_EAGAIN(io_error)) {
|
||||
if(RAW_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_EWOULDBLOCK_EAGAIN(io_error)) {
|
||||
if(RAW_EAGAIN(io_error)) {
|
||||
CURL_TRC_CF(data, cf, "cf_send: EAGAIN after %zu bytes",
|
||||
tlswritten_total);
|
||||
return CURLE_AGAIN;
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ size_t tool_read_cb(char *buffer, size_t sz, size_t nmemb, void *userdata)
|
|||
#ifndef CURL_WINDOWS_UWP
|
||||
rc = sread(per->infd, buffer, curlx_uztosi(sz * nmemb));
|
||||
if(rc < 0) {
|
||||
if(SOCK_EWOULDBLOCK_EAGAIN(SOCKERRNO)) {
|
||||
if(SOCK_EAGAIN(SOCKERRNO)) {
|
||||
errno = 0;
|
||||
config->readbusy = TRUE;
|
||||
return CURL_READFUNC_PAUSE;
|
||||
|
|
|
|||
|
|
@ -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_EWOULDBLOCK_EAGAIN(SOCKERRNO)) {
|
||||
if(SOCK_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_EWOULDBLOCK_EAGAIN(SOCKERRNO)) {
|
||||
if((got == -1) && SOCK_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_EWOULDBLOCK_EAGAIN(error)) {
|
||||
if(SOCK_EAGAIN(error)) {
|
||||
/* nothing to read at the moment */
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1334,7 +1334,7 @@ static curl_socket_t connect_to(const char *ipaddr, unsigned short port)
|
|||
|
||||
if(rc) {
|
||||
error = SOCKERRNO;
|
||||
if((error == SOCKEINPROGRESS) || SOCK_EWOULDBLOCK_EAGAIN(error)) {
|
||||
if((error == SOCKEINPROGRESS) || SOCK_EAGAIN(error)) {
|
||||
fd_set output;
|
||||
struct timeval timeout = { 0 };
|
||||
timeout.tv_sec = 1; /* 1000 ms */
|
||||
|
|
@ -1352,8 +1352,7 @@ static curl_socket_t connect_to(const char *ipaddr, unsigned short port)
|
|||
error = SOCKERRNO;
|
||||
if((error == 0) || (SOCKEISCONN == error))
|
||||
goto success;
|
||||
else if((error != SOCKEINPROGRESS) &&
|
||||
!SOCK_EWOULDBLOCK_EAGAIN(error))
|
||||
else if((error != SOCKEINPROGRESS) && !SOCK_EAGAIN(error))
|
||||
goto error;
|
||||
}
|
||||
else if(!rc) {
|
||||
|
|
@ -1822,7 +1821,7 @@ static curl_socket_t accept_connection(curl_socket_t sock)
|
|||
|
||||
if(msgsock == CURL_SOCKET_BAD) {
|
||||
error = SOCKERRNO;
|
||||
if(SOCK_EWOULDBLOCK_EAGAIN(error)) {
|
||||
if(SOCK_EAGAIN(error)) {
|
||||
/* nothing to accept */
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue