summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:54:29 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:54:29 +0000
commit6920216dc52ae31fb467f64e5422040c35c9661a (patch)
treec1993692c59b29398fd23dcea13f14c0682fa0b1 /methods
parent8867447c72064624c2dcd574be1ccd3601c7682c (diff)
Made http exit on a closed stdin
Author: jgg Date: 1999-08-03 06:08:23 GMT Made http exit on a closed stdin
Diffstat (limited to 'methods')
-rw-r--r--methods/http.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/methods/http.cc b/methods/http.cc
index 0c44ea461..ae7646a76 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: http.cc,v 1.36 1999/07/18 23:06:56 jgg Exp $
+// $Id: http.cc,v 1.37 1999/08/03 06:08:23 jgg Exp $
/* ######################################################################
HTTP Aquire Method - This is the HTTP aquire method for APT.
@@ -724,7 +724,7 @@ bool HttpMethod::Go(bool ToFile,ServerState *Srv)
// Handle commands from APT
if (FD_ISSET(STDIN_FILENO,&rfds))
{
- if (Run(true) != 0)
+ if (Run(true) != -1)
exit(100);
}
@@ -963,8 +963,10 @@ int HttpMethod::Loop()
return 0;
}
- // Run messages
- if (Run(true) != 0)
+ /* Run messages, we can accept 0 (no message) if we didn't
+ do a WaitFd above.. Otherwise the FD is closed. */
+ int Result = Run(true);
+ if (Result != -1 && (Result != 0 || Queue == 0))
return 100;
if (Queue == 0)