// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: http.cc,v 1.15 1998/12/11 01:45:36 jgg Exp $
+// $Id: http.cc,v 1.19 1998/12/31 05:45:26 jgg Exp $
/* ######################################################################
HTTP Aquire Method - This is the HTTP aquire method for APT.
{
if (Line.empty() == true)
return true;
-
+
// The http server might be trying to do something evil.
if (Line.length() >= MAXLEN)
return _error->Error("Got a single header line over %u chars",MAXLEN);
and we expect the proxy to do this */
if (Proxy.empty() == true)
sprintf(Buf,"GET %s HTTP/1.1\r\nHost: %s\r\nConnection: keep-alive\r\n",
- Uri.Path.c_str(),ProperHost.c_str());
+ QuoteString(Uri.Path,"~").c_str(),ProperHost.c_str());
else
{
/* Generate a cache control header if necessary. We place a max
sprintf(Buf,"GET %s HTTP/1.1\r\nHost: %s\r\n",
Itm->Uri.c_str(),ProperHost.c_str());
if (_config->FindB("Acquire::http::No-Cache",false) == true)
- strcat(Buf,"Cache-Control: no-cache\r\n");
+ strcat(Buf,"Cache-Control: no-cache\r\nPragma: no-cache\r\n");
else
{
if (Itm->IndexFile == true)
}
}
-/* if (ProxyAuth.empty() == false)
- Req += string("Proxy-Authorization: Basic ") + Base64Encode(ProxyAuth) + "\r\n";*/
+ if (Proxy.User.empty() == false || Proxy.Password.empty() == false)
+ Req += string("Proxy-Authorization: Basic ") +
+ Base64Encode(Proxy.User + ":" + Proxy.Password) + "\r\n";
Req += "User-Agent: Debian APT-HTTP/1.2\r\n\r\n";
-// cerr << Req << endl;
+ cerr << Req << endl;
Out.Read(Req);
}
if (pkgAcqMethod::Configuration(Message) == false)
return false;
- TimeOut = _config->FindI("Acquire::http::Timeout",120);
- PipelineDepth = _config->FindI("Acquire::http::Pipeline-Depth",5);
+ TimeOut = _config->FindI("Acquire::http::Timeout",TimeOut);
+ PipelineDepth = _config->FindI("Acquire::http::Pipeline-Depth",
+ PipelineDepth);
return true;
}