summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2018-05-24 13:54:27 +0000
committerJulian Andres Klode <jak@debian.org>2018-05-24 13:54:27 +0000
commit9b0319db37c97cfb2a018b6af97019efba4562ab (patch)
tree4dd7778d05b65b30f5c9d0c5d8dc142f7d9926ba
parent6eaeec549241677335813af78f394010e5b3eefb (diff)
parent329a4a6159f1972ff5ec7bc2db26430f26dc61f3 (diff)
Merge branch 'pu/timeout-bad-addr-fixes' into 'master'
Pu/timeout bad addr fixes See merge request apt-team/apt!18
-rw-r--r--doc/examples/configure-index6
-rw-r--r--methods/basehttp.cc2
-rw-r--r--methods/connect.cc1
-rw-r--r--methods/ftp.cc2
-rw-r--r--methods/http.cc4
-rw-r--r--methods/rsh.cc2
6 files changed, 9 insertions, 8 deletions
diff --git a/doc/examples/configure-index b/doc/examples/configure-index
index 4612f362e..71ec57be0 100644
--- a/doc/examples/configure-index
+++ b/doc/examples/configure-index
@@ -259,7 +259,7 @@ Acquire
{
Proxy "http://127.0.0.1:3128";
Proxy::http.us.debian.org "DIRECT"; // Specific per-host setting
- Timeout "120";
+ Timeout "30";
ConnectionAttemptDelayMsec "250";
Pipeline-Depth "5";
AllowRedirect "true";
@@ -285,7 +285,7 @@ Acquire
Verify-Host "true";
AllowRedirect "true";
- Timeout "120";
+ Timeout "30";
ConnectionAttemptDelayMsec "250";
AllowRedirect "true";
@@ -313,7 +313,7 @@ Acquire
"PASS $(SITE_PASS)";
};
- Timeout "120";
+ Timeout "30";
ConnectionAttemptDelayMsec "250";
/* Passive mode control, proxy, non-proxy and per-host. Pasv mode
diff --git a/methods/basehttp.cc b/methods/basehttp.cc
index 3a73d04c6..3d95ba7df 100644
--- a/methods/basehttp.cc
+++ b/methods/basehttp.cc
@@ -250,7 +250,7 @@ bool RequestState::HeaderLine(string const &Line) /*{{{*/
/*}}}*/
// ServerState::ServerState - Constructor /*{{{*/
ServerState::ServerState(URI Srv, BaseHttpMethod *Owner) :
- ServerName(Srv), TimeOut(120), Owner(Owner)
+ ServerName(Srv), TimeOut(30), Owner(Owner)
{
Reset();
}
diff --git a/methods/connect.cc b/methods/connect.cc
index d4e4303b3..e5d17a2f5 100644
--- a/methods/connect.cc
+++ b/methods/connect.cc
@@ -307,6 +307,7 @@ static ResultState WaitAndCheckErrors(std::list<Connection> &Conns, std::unique_
for (auto &Conn : Conns)
{
Conn.Owner->SetFailReason("Timeout");
+ bad_addr.insert(bad_addr.begin(), Conn.Name);
_error->Error(_("Could not connect to %s:%s (%s), "
"connection timed out"),
Conn.Host.c_str(), Conn.Service, Conn.Name);
diff --git a/methods/ftp.cc b/methods/ftp.cc
index ebe555a04..8213f1b50 100644
--- a/methods/ftp.cc
+++ b/methods/ftp.cc
@@ -62,7 +62,7 @@ struct AFMap AFMap[] = {{AF_INET,1},{0, 0}};
struct AFMap AFMap[] = {{AF_INET,1},{AF_INET6,2},{0, 0}};
#endif
-unsigned long TimeOut = 120;
+unsigned long TimeOut = 30;
URI Proxy;
string FtpMethod::FailFile;
int FtpMethod::FailFd = -1;
diff --git a/methods/http.cc b/methods/http.cc
index 4514c3d60..3862497a8 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -496,7 +496,7 @@ ResultState HttpServerState::Open()
return result;
result = UnwrapSocks(ServerName.Host, ServerName.Port == 0 ? DefaultPort : ServerName.Port,
- Proxy, ServerFd, Owner->ConfigFindI("TimeOut", 120), Owner);
+ Proxy, ServerFd, Owner->ConfigFindI("TimeOut", 30), Owner);
if (result != ResultState::SUCCESSFUL)
return result;
}
@@ -536,7 +536,7 @@ ResultState HttpServerState::Open()
}
if (Host == Proxy.Host && tls)
{
- result = UnwrapHTTPConnect(ServerName.Host, ServerName.Port == 0 ? DefaultPort : ServerName.Port, Proxy, ServerFd, Owner->ConfigFindI("TimeOut", 120), Owner);
+ result = UnwrapHTTPConnect(ServerName.Host, ServerName.Port == 0 ? DefaultPort : ServerName.Port, Proxy, ServerFd, Owner->ConfigFindI("TimeOut", 30), Owner);
if (result != ResultState::SUCCESSFUL)
return result;
}
diff --git a/methods/rsh.cc b/methods/rsh.cc
index 7f1d1cc69..0da18690b 100644
--- a/methods/rsh.cc
+++ b/methods/rsh.cc
@@ -32,7 +32,7 @@
#include <apti18n.h>
/*}}}*/
-unsigned long TimeOut = 120;
+unsigned long TimeOut = 30;
Configuration::Item const *RshOptions = 0;
time_t RSHMethod::FailTime = 0;
std::string RSHMethod::FailFile;