summaryrefslogtreecommitdiff
path: root/tor.cc
diff options
context:
space:
mode:
authorTim Retout <tim@retout.co.uk>2014-07-18 18:11:40 +0100
committerTim Retout <tim@retout.co.uk>2014-07-18 19:06:54 +0100
commit163ffa7c4a7529ce257df72b1be392a0c0a32443 (patch)
tree6132e594184e6396cd2ca0058d585a0e8d0597ed /tor.cc
parent511fb0f0b5b0bf6c83c91a84633a22ae1c7cddf6 (diff)
Allow URI schemes starting with "tor+", e.g. "tor+http://"
Diffstat (limited to 'tor.cc')
-rw-r--r--tor.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/tor.cc b/tor.cc
index 8406cba..4d7a91e 100644
--- a/tor.cc
+++ b/tor.cc
@@ -151,8 +151,16 @@ bool TorMethod::Fetch(FetchItem *Itm)
URI Uri = Itm->Uri;
string remotehost = Uri.Host;
- // Undo the "tor" at the start
- Uri.Access = "http";
+ // Undo any "tor" or "tor+" at the start
+ string prefix="tor+";
+ if ("tor" == Uri.Access)
+ {
+ Uri.Access = "http";
+ }
+ else if (!Uri.Access.compare(0, prefix.size(), prefix))
+ {
+ Uri.Access = Uri.Access.substr(prefix.size());
+ }
// TODO:
// - http::Pipeline-Depth