r245 - /apt-transport-debtorrent/trunk/debtorrent.cc
camrdale-guest at users.alioth.debian.org
camrdale-guest at users.alioth.debian.org
Wed Aug 15 00:23:15 UTC 2007
Author: camrdale-guest
Date: Wed Aug 15 00:23:15 2007
New Revision: 245
URL: http://svn.debian.org/wsvn/debtorrent/?sc=1&rev=245
Log:
Remove the http proxying.
Modified:
apt-transport-debtorrent/trunk/debtorrent.cc
Modified: apt-transport-debtorrent/trunk/debtorrent.cc
URL: http://svn.debian.org/wsvn/debtorrent/apt-transport-debtorrent/trunk/debtorrent.cc?rev=245&op=diff
==============================================================================
--- apt-transport-debtorrent/trunk/debtorrent.cc (original)
+++ apt-transport-debtorrent/trunk/debtorrent.cc Wed Aug 15 00:23:15 2007
@@ -56,7 +56,6 @@
time_t HttpMethod::FailTime = 0;
unsigned long TimeOut = 120;
bool Debug = false;
-URI Proxy;
unsigned long CircleBuf::BwReadLimit=0;
unsigned long CircleBuf::BwTickReadData=0;
@@ -306,49 +305,15 @@
Out.Reset();
Persistent = true;
- // Determine the proxy setting
- if (getenv("http_proxy") == 0)
- {
- string DefProxy = _config->Find("Acquire::http::Proxy");
- string SpecificProxy = _config->Find("Acquire::http::Proxy::" + ServerName.Host);
- if (SpecificProxy.empty() == false)
- {
- if (SpecificProxy == "DIRECT")
- Proxy = "";
- else
- Proxy = SpecificProxy;
- }
- else
- Proxy = DefProxy;
- }
- else
- Proxy = getenv("http_proxy");
-
- // Parse no_proxy, a , separated list of domains
- if (getenv("no_proxy") != 0)
- {
- if (CheckDomainList(ServerName.Host,getenv("no_proxy")) == true)
- Proxy = "";
- }
-
// Determine what host and port to use based on the proxy settings
int Port = 0;
string Host;
- if (Proxy.empty() == true || Proxy.Host.empty() == true)
- {
- if (ServerName.Port != 0)
- Port = ServerName.Port;
- Host = ServerName.Host;
- }
- else
- {
- if (Proxy.Port != 0)
- Port = Proxy.Port;
- Host = Proxy.Host;
- }
+ if (ServerName.Port != 0)
+ Port = ServerName.Port;
+ Host = ServerName.Host;
// Connect to the remote server
- if (Connect(Host,Port,"http",80,ServerFd,TimeOut,Owner) == false)
+ if (Connect(Host,Port,"http",9988,ServerFd,TimeOut,Owner) == false)
return false;
return true;
@@ -650,40 +615,11 @@
if (Itm->Uri.length() >= sizeof(Buf))
abort();
- /* Build the request. We include a keep-alive header only for non-proxy
- requests. This is to tweak old http/1.0 servers that do support keep-alive
- but not HTTP/1.1 automatic keep-alive. Doing this with a proxy server
- will glitch HTTP/1.0 proxies because they do not filter it out and
- pass it on, HTTP/1.1 says the connection should default to keep alive
- and we expect the proxy to do this */
- if (Proxy.empty() == true || Proxy.Host.empty())
- sprintf(Buf,"GET %s HTTP/1.1\r\nHost: %s\r\nConnection: keep-alive\r\n",
- QuoteString(Uri.Path,"~").c_str(),ProperHost.c_str());
- else
- {
- /* Generate a cache control header if necessary. We place a max
- cache age on index files, optionally set a no-cache directive
- and a no-store directive for archives. */
- sprintf(Buf,"GET %s HTTP/1.1\r\nHost: %s\r\n",
- Itm->Uri.c_str(),ProperHost.c_str());
- // only generate a cache control header if we actually want to
- // use a cache
- if (_config->FindB("Acquire::http::No-Cache",false) == false)
- {
- if (Itm->IndexFile == true)
- sprintf(Buf+strlen(Buf),"Cache-Control: max-age=%u\r\n",
- _config->FindI("Acquire::http::Max-Age",0));
- else
- {
- if (_config->FindB("Acquire::http::No-Store",false) == true)
- strcat(Buf,"Cache-Control: no-store\r\n");
- }
- }
- }
- // generate a no-cache header if needed
- if (_config->FindB("Acquire::http::No-Cache",false) == true)
- strcat(Buf,"Cache-Control: no-cache\r\nPragma: no-cache\r\n");
-
+ /* Build the request. We include a keep-alive header to tweak old
+ http/1.0 servers that do support keep-alive but not HTTP/1.1
+ automatic keep-alive. */
+ sprintf(Buf,"GET %s HTTP/1.1\r\nHost: %s\r\nConnection: keep-alive\r\n",
+ QuoteString(Uri.Path,"~").c_str(),ProperHost.c_str());
string Req = Buf;
@@ -704,10 +640,6 @@
Req += Buf;
}
}
-
- if (Proxy.User.empty() == false || Proxy.Password.empty() == false)
- Req += string("Proxy-Authorization: Basic ") +
- Base64Encode(Proxy.User + ":" + Proxy.Password) + "\r\n";
if (Uri.User.empty() == false || Uri.Password.empty() == false)
Req += string("Authorization: Basic ") +
More information about the Debtorrent-commits
mailing list