#include "multiif.h"
#include "altsvc.h"
#include "hsts.h"
+#include "vauth/vauth.h"
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
return CURLE_OK;
}
+#ifndef CURL_DISABLE_PROXY
+static CURLcode setproxy(struct Curl_easy *data, const char *proxy)
+{
+ if((data->set.str[STRING_PROXY] && proxy) &&
+ /* there was one set, is this a new one? */
+ !strcmp(data->set.str[STRING_PROXY], proxy))
+ return CURLE_OK; /* same one as before */
+
+ Curl_auth_digest_cleanup(&data->state.proxydigest);
+ memset(&data->state.authproxy, 0, sizeof(data->state.authproxy));
+ return Curl_setstropt(&data->set.str[STRING_PROXY], proxy);
+}
+#endif
+
/*
* Do not make Curl_vsetopt() static: it is called from
* packages/OS400/ccsidcurl.c.
* Setting it to NULL, means no proxy but allows the environment variables
* to decide for us (if CURLOPT_SOCKS_PROXY setting it to NULL).
*/
- result = Curl_setstropt(&data->set.str[STRING_PROXY],
- va_arg(param, char *));
+ result = setproxy(data, va_arg(param, char *));
break;
case CURLOPT_PRE_PROXY:
/* This is used to clean up the digest specific data */
void Curl_auth_digest_cleanup(struct digestdata *digest);
+#else
+#define Curl_auth_digest_cleanup(x)
#endif /* !CURL_DISABLE_CRYPTO_AUTH */
#ifdef USE_GSASL