summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.co.uk>2010-05-17 15:49:41 (GMT)
committerNicolas Dufresne <nicolas.dufresne@collabora.co.uk>2010-05-17 15:53:33 (GMT)
commit2261fb991cac0b0e705c06ee5aafc81e1d8027b9 (patch)
tree25b0abf3d3b8e3540c303ba472820ea46900b122
parent4cdfd8b57144ca9f3f3127d28cdad4f01ff0a678 (diff)
downloadlibproxy-http.tar.gz
libproxy-http.tar.xz
Fallback to HTTP Connect at last resorthttp
-rw-r--r--libproxy/modules/config_gnome.cpp40
1 files changed, 26 insertions, 14 deletions
diff --git a/libproxy/modules/config_gnome.cpp b/libproxy/modules/config_gnome.cpp
index f31aa8b..ab62ac1 100644
--- a/libproxy/modules/config_gnome.cpp
+++ b/libproxy/modules/config_gnome.cpp
@@ -206,24 +206,37 @@ public:
if (host == "" || get_port(port) == 0) {
// Get the per-scheme proxy settings
if (dest.get_scheme() == "http") {
- type = "http";
- host = this->data[PROXY_HTTP_HOST];
- port = this->data[PROXY_HTTP_PORT];
+ type = "http";
+ host = this->data[PROXY_HTTP_HOST];
+ port = this->data[PROXY_HTTP_PORT];
}
else if (dest.get_scheme() == "https") {
- // It is expected that the configured server is an
- // HTTP server that support CONNECT method.
- type = "http";
- host = this->data[PROXY_SECURE_HOST];
- port = this->data[PROXY_SECURE_PORT];
+ // It is expected that the configured server is an
+ // HTTP server that support CONNECT method.
+ type = "http";
+ host = this->data[PROXY_SECURE_HOST];
+ port = this->data[PROXY_SECURE_PORT];
}
else if (dest.get_scheme() == "ftp") {
- // It is expected that the configured server is an
- // HTTP server that handles proxying FTP URLs
- // (e.g. request with header "Host: ftp://ftp.host.org")
+ // It is expected that the configured server is an
+ // HTTP server that handles proxying FTP URLs
+ // (e.g. request with header "Host: ftp://ftp.host.org")
+ type = "http";
+ host = this->data[PROXY_FTP_HOST];
+ port = this->data[PROXY_FTP_PORT];
+ }
+ else
+ {
+ type = "socks";
+ host = this->data[PROXY_SOCKS_HOST];
+ port = this->data[PROXY_SOCKS_PORT];
+
+ // If still no proxy try HTTP Connect
+ if (host == "" || get_port(port) == 0) {
type = "http";
- host = this->data[PROXY_FTP_HOST];
- port = this->data[PROXY_FTP_PORT];
+ host = this->data[PROXY_SECURE_HOST];
+ port = this->data[PROXY_SECURE_PORT];
+ }
}
// If no proxy is set and we have the same_proxy option
@@ -235,7 +248,6 @@ public:
}
}
-
// If host and port were found, build config url
if (host != "" && get_port(port) != 0) {
string tmp = type + "://";