From dd1fd92b04c5265e134a50bd9262b8f732e90f9c Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:55:55 +0000 Subject: Fixed error reporting for empty host strings and invali... Author: jgg Date: 2000-05-12 05:04:57 GMT Fixed error reporting for empty host strings and invalid proxy settings --- methods/connect.cc | 6 ++++-- methods/http.cc | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/methods/connect.cc b/methods/connect.cc index 034b1c212..e92eebe76 100644 --- a/methods/connect.cc +++ b/methods/connect.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: connect.cc,v 1.4 1999/11/19 05:01:54 jgg Exp $ +// $Id: connect.cc,v 1.5 2000/05/12 05:04:57 jgg Exp $ /* ###################################################################### Connect - Replacement connect call @@ -161,6 +161,8 @@ bool Connect(string Host,int Port,const char *Service,int DefPort,int &Fd, _error->Discard(); } - return false; + if (_error->PendingError() == true) + return false; + return _error->Error("Unable to connect to '%s'",Host.c_str()); } /*}}}*/ diff --git a/methods/http.cc b/methods/http.cc index ad8fe373a..78e8135d4 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: http.cc,v 1.44 2000/01/30 08:16:43 jgg Exp $ +// $Id: http.cc,v 1.45 2000/05/12 05:04:57 jgg Exp $ /* ###################################################################### HTTP Aquire Method - This is the HTTP aquire method for APT. @@ -309,11 +309,11 @@ bool ServerState::Open() break; } } - + // Determine what host and port to use based on the proxy settings int Port = 0; string Host; - if (Proxy.empty() == true) + if (Proxy.empty() == true || Proxy.Host.empty() == true) { if (ServerName.Port != 0) Port = ServerName.Port; -- cgit v1.2.3