cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Proxy off ?

From: Paul Johnson <paul_at_applewoodhouse.com>
Date: Fri, 10 Sep 2004 17:35:29 +0100

Ah. That's what I am doing but apparently it's not working out that way, at
least according to a beta tester (from microsoft). Here's the code that I
call (amonst others) each time I'm about to send some data. As you can see,
if my own preferences settings says no proxy, it just doesn't set anything,
howevever the curl object gets left in its last state which in my case was
for http proxy.

tVOID SetCurlProxyStuff (tVOID)
{
 if (Prefs.ProxyType==PROXY_NONE)
  {
// Need to do more here as it seems to get left on if it was HTTP beforehand
  return;
  }

 // Set proxy type
 if (Prefs.ProxyType==PROXY_HTTP)
  curl_easy_setopt(curl,CURLOPT_PROXYTYPE,CURLPROXY_HTTP);
 else
 if (Prefs.ProxyType==PROXY_SOCKS4)
  curl_easy_setopt(curl,CURLOPT_PROXYTYPE,CURLPROXY_SOCKS4);
 else
 if (Prefs.ProxyType==PROXY_SOCKS5)
  curl_easy_setopt(curl,CURLOPT_PROXYTYPE,CURLPROXY_SOCKS5);

[SNIP]
}

Regards,
Paul Johnson.
www.applewoodhouse.com

----- Original Message -----
From: "Dan Fandrich" <dan_at_coneharvesters.com>
To: "libcurl development" <curl-library_at_cool.haxx.se>
Sent: Friday, September 10, 2004 4:37 PM
Subject: Re: Proxy off ?

> On Fri, Sep 10, 2004 at 02:41:34PM +0100, Paul Johnson wrote:
> > It happens after he chooses HTTP whilst at work, leaves the program
running
> > (its that sort of a program) then plugs into another network without a
> > proxy. I'd agree that he should just restart the program as a fix, but
my
> > client who's paying wants it to be more immediate. Can't really say I
blame
> > him tbh.
> >
> > Is there a way ?
>
> What Daniel (the other one) was getting at was to have your app simply
> stop selecting a proxy where it currently is doing so. To look at it
another
> way, at some point your customer is initiating a transfer using curl, and
curl
> is trying to use a proxy. That means your app is using curl_easy_setopt to
> set some proxy options before starting the transfer. When your customer
> presses the "no proxy" button, just don't set up those options for future
> transfers.
>
> >>> Dan
> --
> http://www.MoveAnnouncer.com The web change of address
service
> Let webmasters know that your web site has moved
Received on 2004-09-10