summaryrefslogtreecommitdiff
path: root/lib/asyn-thread.c
diff options
context:
space:
mode:
authorJay Satiro <raysatiro@yahoo.com>2021-01-25 01:27:13 -0500
committerJay Satiro <raysatiro@yahoo.com>2021-02-09 02:47:51 -0500
commitb9f11ae87564447e61533eeafea9a1caa4cfa31d (patch)
tree222f75683fa4ce2e7d03f29bb52e3e264e816356 /lib/asyn-thread.c
parentb48db908e08cf6dca67ef12f29738e7188702299 (diff)
downloadcurl-b9f11ae87564447e61533eeafea9a1caa4cfa31d.tar.gz
lib: drop USE_SOCKETPAIR in favor of CURL_DISABLE_SOCKETPAIR
.. since the former is undocumented and they both do the same thing. Closes https://github.com/curl/curl/pull/6517
Diffstat (limited to 'lib/asyn-thread.c')
-rw-r--r--lib/asyn-thread.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c
index 9fcbc3c1f..3fb771ab8 100644
--- a/lib/asyn-thread.c
+++ b/lib/asyn-thread.c
@@ -163,7 +163,7 @@ struct thread_sync_data {
int port;
char *hostname; /* hostname to resolve, Curl_async.hostname
duplicate */
-#ifdef USE_SOCKETPAIR
+#ifndef CURL_DISABLE_SOCKETPAIR
struct Curl_easy *data;
curl_socket_t sock_pair[2]; /* socket pair */
#endif
@@ -201,7 +201,7 @@ void destroy_thread_sync_data(struct thread_sync_data *tsd)
if(tsd->res)
Curl_freeaddrinfo(tsd->res);
-#ifdef USE_SOCKETPAIR
+#ifndef CURL_DISABLE_SOCKETPAIR
/*
* close one end of the socket pair (may be done in resolver thread);
* the other end (for reading) is always closed in the parent thread.
@@ -243,7 +243,7 @@ int init_thread_sync_data(struct thread_data *td,
Curl_mutex_init(tsd->mtx);
-#ifdef USE_SOCKETPAIR
+#ifndef CURL_DISABLE_SOCKETPAIR
/* create socket pair, avoid AF_LOCAL since it doesn't build on Solaris */
if(Curl_socketpair(AF_UNIX, SOCK_STREAM, 0, &tsd->sock_pair[0]) < 0) {
tsd->sock_pair[0] = CURL_SOCKET_BAD;
@@ -297,7 +297,7 @@ static unsigned int CURL_STDCALL getaddrinfo_thread(void *arg)
struct thread_data *td = tsd->td;
char service[12];
int rc;
-#ifdef USE_SOCKETPAIR
+#ifndef CURL_DISABLE_SOCKETPAIR
char buf[1];
#endif
@@ -322,7 +322,7 @@ static unsigned int CURL_STDCALL getaddrinfo_thread(void *arg)
free(td);
}
else {
-#ifdef USE_SOCKETPAIR
+#ifndef CURL_DISABLE_SOCKETPAIR
if(tsd->sock_pair[1] != CURL_SOCKET_BAD) {
/* DNS has been resolved, signal client task */
buf[0] = 1;
@@ -382,7 +382,7 @@ static void destroy_async_data(struct Curl_async *async)
if(async->tdata) {
struct thread_data *td = async->tdata;
int done;
-#ifdef USE_SOCKETPAIR
+#ifndef CURL_DISABLE_SOCKETPAIR
curl_socket_t sock_rd = td->tsd.sock_pair[0];
struct Curl_easy *data = td->tsd.data;
#endif
@@ -407,7 +407,7 @@ static void destroy_async_data(struct Curl_async *async)
free(async->tdata);
}
-#ifdef USE_SOCKETPAIR
+#ifndef CURL_DISABLE_SOCKETPAIR
/*
* ensure CURLMOPT_SOCKETFUNCTION fires CURL_POLL_REMOVE
* before the FD is invalidated to avoid EBADF on EPOLL_CTL_DEL
@@ -654,13 +654,13 @@ int Curl_resolver_getsock(struct Curl_easy *data, curl_socket_t *socks)
timediff_t milli;
timediff_t ms;
struct resdata *reslv = (struct resdata *)data->state.async.resolver;
-#ifdef USE_SOCKETPAIR
+#ifndef CURL_DISABLE_SOCKETPAIR
struct thread_data *td = data->state.async.tdata;
#else
(void)socks;
#endif
-#ifdef USE_SOCKETPAIR
+#ifndef CURL_DISABLE_SOCKETPAIR
if(td) {
/* return read fd to client for polling the DNS resolution status */
socks[0] = td->tsd.sock_pair[0];
@@ -679,7 +679,7 @@ int Curl_resolver_getsock(struct Curl_easy *data, curl_socket_t *socks)
else
milli = 200;
Curl_expire(data, milli, EXPIRE_ASYNC_NAME);
-#ifdef USE_SOCKETPAIR
+#ifndef CURL_DISABLE_SOCKETPAIR
}
#endif