aboutsummaryrefslogtreecommitdiff
path: root/lib/setopt.c
diff options
context:
space:
mode:
authorFrancisco Sedano <fran@fransedano.net>2018-02-14 17:20:43 +0000
committerJay Satiro <raysatiro@yahoo.com>2018-02-21 21:29:10 -0500
commit23713645d4e9ae00a3065f7a3d995e57748da4c7 (patch)
treef0add953900167057056308a77ef9ba8ac6228a6 /lib/setopt.c
parentdd027c80fe444e9555ad324ddf8e461eb358f4a3 (diff)
url: Add option CURLOPT_RESOLVER_START_FUNCTION
- Add new option CURLOPT_RESOLVER_START_FUNCTION to set a callback that will be called every time before a new resolve request is started (ie before a host is resolved) with a pointer to backend-specific resolver data. Currently this is only useful for ares. - Add new option CURLOPT_RESOLVER_START_DATA to set a user pointer to pass to the resolver start callback. Closes https://github.com/curl/curl/pull/2311
Diffstat (limited to 'lib/setopt.c')
-rw-r--r--lib/setopt.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/setopt.c b/lib/setopt.c
index 8dcd10e6b..9c96eb358 100644
--- a/lib/setopt.c
+++ b/lib/setopt.c
@@ -2110,6 +2110,21 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option,
data->set.fclosesocket = va_arg(param, curl_closesocket_callback);
break;
+ case CURLOPT_RESOLVER_START_FUNCTION:
+ /*
+ * resolver start callback function: called before a new resolver request
+ * is started
+ */
+ data->set.resolver_start = va_arg(param, curl_resolver_start_callback);
+ break;
+
+ case CURLOPT_RESOLVER_START_DATA:
+ /*
+ * resolver start callback data pointer. Might be NULL.
+ */
+ data->set.resolver_start_client = va_arg(param, void *);
+ break;
+
case CURLOPT_CLOSESOCKETDATA:
/*
* socket callback data pointer. Might be NULL.