Author: jgg
Date: 1999-04-17 23:18:11 GMT
Little more robust timeout behavoir
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// -*- 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.
/* ######################################################################
HTTP Aquire Method - This is the FTP aquire method for APT.
{
// Wait for some data..
if (WaitFd(DataFd,false,TimeOut) == false)
{
// 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)
// Read the data..
int Res = read(DataFd,Buffer,sizeof(Buffer));
if (Res == 0)
MD5.Add(Buffer,Res);
if (To.Write(Buffer,Res) == false)
MD5.Add(Buffer,Res);
if (To.Write(Buffer,Res) == false)