summaryrefslogtreecommitdiff
path: root/libproxy/proxy.cpp
diff options
context:
space:
mode:
authornicolas.dufresne <nicolas.dufresne@c587cffe-e639-0410-9787-d7902ae8ed56>2010-04-02 15:02:02 +0000
committernicolas.dufresne <nicolas.dufresne@c587cffe-e639-0410-9787-d7902ae8ed56>2010-04-02 15:02:02 +0000
commitddbdc05a4892d30fdac8d7fc07333e83fc1ac7d3 (patch)
tree693a33fa965430bef0e8984be96e0bed08ad424e /libproxy/proxy.cpp
parentaf234a6c751db97dd500f6276526a5a4655cf090 (diff)
downloadlibproxy-ddbdc05a4892d30fdac8d7fc07333e83fc1ac7d3.tar.gz
Remove scheme base filterring on config extension
Filtering scheme returned by config modules was odd. This would mean that libproxy knows all the protocols that has internal proxy mechanism and even guess the one that does not exist yet. git-svn-id: http://libproxy.googlecode.com/svn/trunk@656 c587cffe-e639-0410-9787-d7902ae8ed56
Diffstat (limited to 'libproxy/proxy.cpp')
-rw-r--r--libproxy/proxy.cpp30
1 files changed, 11 insertions, 19 deletions
diff --git a/libproxy/proxy.cpp b/libproxy/proxy.cpp
index a6686ca..949c285 100644
--- a/libproxy/proxy.cpp
+++ b/libproxy/proxy.cpp
@@ -214,26 +214,18 @@ vector<string> proxy_factory::get_proxies(string url_) {
config = *i;
// Try to get the confurl
- try { confurl = (config)->get_config(*realurl); }
- catch (runtime_error e) { goto invalid_config; }
-
- // Validate the input
- if (!(confurl.get_scheme() == "http" ||
- confurl.get_scheme() == "socks" ||
- confurl.get_scheme().substr(0, 4) == "pac+" ||
- confurl.get_scheme() == "wpad" ||
- confurl.get_scheme() == "direct"))
- goto invalid_config;
-
- config->set_valid(true);
- confign = config->get_ignore(*realurl);
- break;
-
- invalid_config:
+ try {
+ confurl = config->get_config(*realurl);
+ confign = config->get_ignore(*realurl);
+ config->set_valid(true);
+ break;
+ }
+ catch (runtime_error e) {
confurl = "direct://";
confign = "";
- (config)->set_valid(false);
+ config->set_valid(false);
config = NULL;
+ }
}
if (debug) {
if (config)
@@ -356,8 +348,8 @@ vector<string> proxy_factory::get_proxies(string url_) {
response = format_pac_response(pacresp);
}
- /* If we have a manual config (http://..., socks://...) */
- else if (confurl.get_scheme() == "http" || confurl.get_scheme() == "socks")
+ /* If we have a manual config (http://..., socks://..., etc.) */
+ else
{
this->wpad = false;
if (this->pac) { delete this->pac; this->pac = NULL; }