From 6920216dc52ae31fb467f64e5422040c35c9661a Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:54:29 +0000 Subject: Made http exit on a closed stdin Author: jgg Date: 1999-08-03 06:08:23 GMT Made http exit on a closed stdin --- methods/http.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'methods/http.cc') 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) -- cgit v1.2.3-70-g09d2