summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/easy.c
diff options
context:
space:
mode:
Diffstat (limited to 'libs/libcurl/src/easy.c')
-rw-r--r--libs/libcurl/src/easy.c51
1 files changed, 41 insertions, 10 deletions
diff --git a/libs/libcurl/src/easy.c b/libs/libcurl/src/easy.c
index 1a6912748e..b648e80c14 100644
--- a/libs/libcurl/src/easy.c
+++ b/libs/libcurl/src/easy.c
@@ -83,8 +83,6 @@
#include "curl_memory.h"
#include "memdebug.h"
-void Curl_version_init(void);
-
/* true globals -- for curl_global_init() and curl_global_cleanup() */
static unsigned int initialized;
static long init_flags;
@@ -201,8 +199,6 @@ static CURLcode global_init(long flags, bool memoryfuncs)
init_flags = flags;
- Curl_version_init();
-
return CURLE_OK;
fail:
@@ -887,6 +883,17 @@ struct Curl_easy *curl_easy_duphandle(struct Curl_easy *data)
data->state.resolver))
goto fail;
+#ifdef USE_ARES
+ if(Curl_set_dns_servers(outcurl, data->set.str[STRING_DNS_SERVERS]))
+ goto fail;
+ if(Curl_set_dns_interface(outcurl, data->set.str[STRING_DNS_INTERFACE]))
+ goto fail;
+ if(Curl_set_dns_local_ip4(outcurl, data->set.str[STRING_DNS_LOCAL_IP4]))
+ goto fail;
+ if(Curl_set_dns_local_ip6(outcurl, data->set.str[STRING_DNS_LOCAL_IP6]))
+ goto fail;
+#endif /* USE_ARES */
+
Curl_convert_setup(outcurl);
Curl_initinfo(outcurl);
@@ -973,16 +980,37 @@ void curl_easy_reset(struct Curl_easy *data)
*/
CURLcode curl_easy_pause(struct Curl_easy *data, int action)
{
- struct SingleRequest *k = &data->req;
+ struct SingleRequest *k;
CURLcode result = CURLE_OK;
+ int oldstate;
+ int newstate;
- /* first switch off both pause bits */
- int newstate = k->keepon &~ (KEEP_RECV_PAUSE| KEEP_SEND_PAUSE);
+ if(!GOOD_EASY_HANDLE(data) || !data->conn)
+ /* crazy input, don't continue */
+ return CURLE_BAD_FUNCTION_ARGUMENT;
- /* set the new desired pause bits */
- newstate |= ((action & CURLPAUSE_RECV)?KEEP_RECV_PAUSE:0) |
+ k = &data->req;
+ oldstate = k->keepon & (KEEP_RECV_PAUSE| KEEP_SEND_PAUSE);
+
+ /* first switch off both pause bits then set the new pause bits */
+ newstate = (k->keepon &~ (KEEP_RECV_PAUSE| KEEP_SEND_PAUSE)) |
+ ((action & CURLPAUSE_RECV)?KEEP_RECV_PAUSE:0) |
((action & CURLPAUSE_SEND)?KEEP_SEND_PAUSE:0);
+ if((newstate & (KEEP_RECV_PAUSE| KEEP_SEND_PAUSE)) == oldstate) {
+ /* Not changing any pause state, return */
+ DEBUGF(infof(data, "pause: no change, early return\n"));
+ return CURLE_OK;
+ }
+
+ /* Unpause parts in active mime tree. */
+ if((k->keepon & ~newstate & KEEP_SEND_PAUSE) &&
+ (data->mstate == CURLM_STATE_PERFORM ||
+ data->mstate == CURLM_STATE_TOOFAST) &&
+ data->state.fread_func == (curl_read_callback) Curl_mime_read) {
+ Curl_mime_unpause(data->state.in);
+ }
+
/* put it back in the keepon */
k->keepon = newstate;
@@ -1033,8 +1061,11 @@ CURLcode curl_easy_pause(struct Curl_easy *data, int action)
to have this handle checked soon */
if((newstate & (KEEP_RECV_PAUSE|KEEP_SEND_PAUSE)) !=
(KEEP_RECV_PAUSE|KEEP_SEND_PAUSE)) {
- data->state.drain++;
Curl_expire(data, 0, EXPIRE_RUN_NOW); /* get this handle going again */
+
+ /* force a recv/send check of this connection, as the data might've been
+ read off the socket already */
+ data->conn->cselect_bits = CURL_CSELECT_IN | CURL_CSELECT_OUT;
if(data->multi)
Curl_update_timer(data->multi);
}