diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:51:31 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:51:31 +0000 |
commit | 94235cfb1980f4056638fe9abaef162f8c6fe38c (patch) | |
tree | 4f07f9b18ad7caf943f4f9955a6d4645f69abca2 /methods | |
parent | 92c26a2f28e2d68ecd2520cb2b2793e6068ce0ed (diff) |
Fixed problem with not being able to open files
Author: jgg
Date: 1998-11-21 06:09:09 GMT
Fixed problem with not being able to open files
Diffstat (limited to 'methods')
-rw-r--r-- | methods/http.cc | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/methods/http.cc b/methods/http.cc index fec484249..babf7b972 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: http.cc,v 1.5 1998/11/11 06:54:21 jgg Exp $ +// $Id: http.cc,v 1.6 1998/11/21 06:09:09 jgg Exp $ /* ###################################################################### HTTP Aquire Method - This is the HTTP aquire method for APT. @@ -789,7 +789,8 @@ bool HttpMethod::ServerDie(ServerState *Srv) 0 - File is open, 1 - IMS hit 3 - Unrecoverable error - 4 - Error with error content page */ + 4 - Error with error content page + 5 - Unrecoverable non-server error (close the connection) */ int HttpMethod::DealWithHeaders(FetchResult &Res,ServerState *Srv) { // Not Modified @@ -819,7 +820,7 @@ int HttpMethod::DealWithHeaders(FetchResult &Res,ServerState *Srv) delete File; File = new FileFd(Queue->DestFile,FileFd::WriteAny); if (_error->PendingError() == true) - return 3; + return 5; FailFile = Queue->DestFile; FailFd = File->Fd(); @@ -845,7 +846,7 @@ int HttpMethod::DealWithHeaders(FetchResult &Res,ServerState *Srv) if (Srv->In.MD5->AddFD(File->Fd(),Srv->StartPos) == false) { _error->Errno("read","Problem hashing file"); - return 3; + return 5; } lseek(File->Fd(),0,SEEK_END); } @@ -999,6 +1000,14 @@ int HttpMethod::Loop() Fail(); break; } + + // Hard internal error, kill the connection and fail + case 5: + { + Fail(); + Server->Close(); + break; + } // We need to flush the data, the header is like a 404 w/ error text case 4: |