diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:53:33 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:53:33 +0000 |
commit | 25dbb396187255367674f264732db681538c87a2 (patch) | |
tree | cead710060c59f25ca8a7f618ab754cefcae8b1a /methods/ftp.cc | |
parent | c9a64a4dc57e49e9a92e5e8c3e32ea9619534a58 (diff) |
Little more robust timeout behavoir
Author: jgg
Date: 1999-04-17 23:18:11 GMT
Little more robust timeout behavoir
Diffstat (limited to 'methods/ftp.cc')
-rw-r--r-- | methods/ftp.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/methods/ftp.cc b/methods/ftp.cc index 145858f1f..d72a44ea3 100644 --- a/methods/ftp.cc +++ b/methods/ftp.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: ftp.cc,v 1.6 1999/04/11 21:23:10 jgg Exp $ +// $Id: ftp.cc,v 1.7 1999/04/17 23:18:11 jgg Exp $ /* ###################################################################### HTTP Aquire Method - This is the FTP aquire method for APT. @@ -725,8 +725,11 @@ bool FTPConn::Get(const char *Path,FileFd &To,unsigned long Resume, { // Wait for some data.. if (WaitFd(DataFd,false,TimeOut) == false) - return _error->Error("Data socket connect timed out"); - + { + Close(); + return _error->Error("Data socket timed out"); + } + // Read the data.. int Res = read(DataFd,Buffer,sizeof(Buffer)); if (Res == 0) @@ -740,7 +743,10 @@ bool FTPConn::Get(const char *Path,FileFd &To,unsigned long Resume, MD5.Add(Buffer,Res); if (To.Write(Buffer,Res) == false) + { + Close(); return false; + } } // All done |