diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:55:19 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:55:19 +0000 |
commit | f93d1355dd915fd5c197293ba0e62292ec15cb2d (patch) | |
tree | 78be0c02ba0ec102282e26e1b611b6f0f9ab25e5 /methods/ftp.cc | |
parent | 0b5c85b5c9edc8cbd9a3962d412810354398b095 (diff) |
Reorderd error handling
Author: jgg
Date: 1999-12-09 03:45:56 GMT
Reorderd error handling
Diffstat (limited to 'methods/ftp.cc')
-rw-r--r-- | methods/ftp.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/methods/ftp.cc b/methods/ftp.cc index b9f708d80..a7fa83233 100644 --- a/methods/ftp.cc +++ b/methods/ftp.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: ftp.cc,v 1.16 1999/11/29 23:20:27 jgg Exp $ +// $Id: ftp.cc,v 1.17 1999/12/09 03:45:56 jgg Exp $ /* ###################################################################### HTTP Aquire Method - This is the FTP aquire method for APT. @@ -285,8 +285,9 @@ bool FTPConn::ReadLine(string &Text) int Res = read(ServerFd,Buffer + Len,sizeof(Buffer) - Len); if (Res <= 0) { + _error->Errno("read","Read error"); Close(); - return _error->Errno("read","Read error"); + return false; } Len += Res; } @@ -392,8 +393,9 @@ bool FTPConn::WriteMsg(unsigned int &Ret,string &Text,const char *Fmt,...) int Res = write(ServerFd,S + Start,Len); if (Res <= 0) { + _error->Errno("write","Write Error"); Close(); - return _error->Errno("write","Write Error"); + return false; } Len -= Res; |