cURL / Mailing Lists / curl-library / Single Mail

curl-library

CURLOPT_PROXY and --disable-http

From: Kai Sommerfeld <Kai.Sommerfeld_at_sun.com>
Date: Tue, 18 Jan 2005 17:19:17 +0100

Hi,

  Stephan Bergmann, one of my co-workers asked me to forward the
following problem description/patch to this list:

- Kai.

.............................................
Hi all,

Using curl 7.12.2 in OpenOffice.org leads to the following problem:

OpenOffice.org uses curl only for FTP traffic, so curl is configured
with --disable-http. Also, OpenOffice.org has its own, internal
management of proxy settings, and if OpenOffice.org is configured to use
an (HTTP) proxy for FTP traffic, it does not use curl at all. However,
if OpenOffice.org is configured to use no proxy for FTP, but the
environment variable ftp_proxy is set, curl complains with
CURLE_UNSUPPORTED_PROTOCOL. To work around this, I tried

   curl_easy_setopt(curl, CURLOPT_PROXY, "");

as the first call to curl, which unfortunately fails with
CURLE_FAILED_INIT, as Curl_setopt (url.c) only supports CURLOPT_PROXY if
CURL_DISABLE_HTTP is not defined. IMHO, this is an inconsistency in the
curl implementation. I tried to fix it with the below patch, which
works fine for me.

If you consider this patch (or any other modification of the code that
has the same effect) good, it would be great if you would include it in
a future version of curl. That way, OpenOffice.org could then upgrade
to that version of curl, and get rid of locally applying the patch.

-Stephan

*** url.c.orig 2004-10-18 00:21:02.000000000 +0200
--- url.c 2005-01-18 16:41:59.276343519 +0100
***************
*** 813,818 ****
--- 813,819 ----
          here, we continue as if we were using the already set type
          and this just changes the actual request keyword */
       break;
+ #endif /* CURL_DISABLE_HTTP */

     case CURLOPT_PROXY:
       /*
***************
*** 835,840 ****
--- 836,842 ----
       data->change.proxy = data->set.set_proxy;
       break;

+ #ifndef CURL_DISABLE_HTTP
     case CURLOPT_PROXYPORT:
       /*
        * Explicitly set HTTP proxy port number.
Received on 2005-01-18