Hi guys,

   with David we were doing some tests with the HTTP protocol
configuration options and we came up with this case:

- default: set the proxy
- for particular URLs: unset it

   With the current proxy it is not possible, because, if we write:

<url: http://www.po-net.prato.it>
http_proxy:
</url>

   the setting is not considered (it is empty).

   My suggestion is to use the dash ('-') as special character for
unsetting this value or the keyword ('noproxy') as follows:

<url: http://www.po-net.prato.it>
http_proxy: -
</url>

or

<url: http://www.po-net.prato.it>
http_proxy: noproxy
</url>

   In this case, I slightly need to modify the Document.cc file.

   I am also concerned about applying this small change to the current
code or not: I consider this a bug (which prevent the spider to
correctly work in this case).

   Here is the small patch.

   Please let me know, so I can eventually open and close a bug.

Ciao,
-Gabriele

diff -3 -u -p -r1.68 Document.cc
--- Document.cc 23 Oct 2003 02:10:55 -0000      1.68
+++ Document.cc 30 Jan 2004 11:01:27 -0000
@@ -186,10 +186,19 @@ Document::Url(const String &u)
     url = new URL(u);
 
     const String proxyURL = config->Find(url,"http_proxy");
-    if (proxyURL.length())
+    // If http_proxy is set to '-' or 'noproxy', the proxy for the
+    // current URL is unset
+    if (!proxyURL.length() || !mystrncasecmp(proxyURL.get(), "noproxy",
7)
+        || !mystrncasecmp(proxyURL.get(), "-", 1))
     {
-       proxy = new URL(proxyURL);
-       proxy->normalize();
+        if (proxy)
+            delete proxy;
+        proxy = 0;
+    }
+    else
+    {
+        proxy = new URL(proxyURL);
+        proxy->normalize();
     }
 
     const String credentials = config->Find(url,"authorization");




-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
ht://Dig Developer mailing list:
[EMAIL PROTECTED]
List information (subscribe/unsubscribe, etc.)
https://lists.sourceforge.net/lists/listinfo/htdig-dev

Reply via email to