diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2011-04-27 10:32:53 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2011-04-27 10:32:53 +0200 |
commit | 3b422ab4b2df243f48330a3329e98c9506d791c6 (patch) | |
tree | 6ab69aeae606e5438f684285a6d8bd863343c883 /methods | |
parent | 2d5102e87ae43da3ec7a3f12997363348278cabe (diff) |
* methods/http.cc:
- add config option to ignore a closed stdin to be able to easily
use the method as a simple standalone downloader
Diffstat (limited to 'methods')
-rw-r--r-- | methods/http.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/methods/http.cc b/methods/http.cc index dfc1619e3..26abc14d9 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -778,9 +778,10 @@ bool HttpMethod::Go(bool ToFile,ServerState *Srv) if (Srv->In.WriteSpace() == true && ToFile == true && FileFD != -1) FD_SET(FileFD,&wfds); - + // Add stdin - FD_SET(STDIN_FILENO,&rfds); + if (_config->FindB("Acquire::http::DependOnSTDIN", true) == true) + FD_SET(STDIN_FILENO,&rfds); // Figure out the max fd int MaxFd = FileFD; @@ -1113,7 +1114,13 @@ int HttpMethod::Loop() do a WaitFd above.. Otherwise the FD is closed. */ int Result = Run(true); if (Result != -1 && (Result != 0 || Queue == 0)) - return 100; + { + if(FailReason.empty() == false || + _config->FindB("Acquire::http::DependOnSTDIN", true) == true) + return 100; + else + return 0; + } if (Queue == 0) continue; |