diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-05-12 16:08:23 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-05-12 16:08:23 +0000 |
| commit | 64945c1f0383aeb4c48ed3f626358be90e45d846 (patch) | |
| tree | a4a5793d4801330651e05d162ececf5b9d429e53 /src/HttpServerBodyCommand.cc | |
| parent | 55c5cccf09d79a573577ded587eedf233acaf6a6 (diff) | |
2009-05-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Put a call to Socket::isReadable() in try block.
* src/HttpServerBodyCommand.cc
* src/HttpServerCommand.cc
Diffstat (limited to 'src/HttpServerBodyCommand.cc')
| -rw-r--r-- | src/HttpServerBodyCommand.cc | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/HttpServerBodyCommand.cc b/src/HttpServerBodyCommand.cc index 04d57647..a302a690 100644 --- a/src/HttpServerBodyCommand.cc +++ b/src/HttpServerBodyCommand.cc @@ -74,10 +74,10 @@ bool HttpServerBodyCommand::execute() if(_e->_requestGroupMan->downloadFinished() || _e->isHaltRequested()) { return true; } - if(_socket->isReadable(0) || _httpServer->getContentLength() == 0) { - _timeout.reset(); + try { + if(_socket->isReadable(0) || _httpServer->getContentLength() == 0) { + _timeout.reset(); - try { if(_httpServer->receiveBody()) { // Do something for requestpath and body if(_httpServer->getRequestPath() == "/rpc") { @@ -101,20 +101,21 @@ bool HttpServerBodyCommand::execute() _e->commands.push_back(this); return false; } - } catch(RecoverableException& e) { - logger->info("CUID#%d - Error occurred while reading HTTP request body", - e, cuid); - return true; - } - } else { - if(_timeout.elapsed(30)) { - logger->info("HTTP request body timeout."); - return true; } else { - _e->commands.push_back(this); - return false; + if(_timeout.elapsed(30)) { + logger->info("HTTP request body timeout."); + return true; + } else { + _e->commands.push_back(this); + return false; + } } + } catch(RecoverableException& e) { + logger->info("CUID#%d - Error occurred while reading HTTP request body", + e, cuid); + return true; } + } } // namespace aria2 |
