summaryrefslogtreecommitdiff
path: root/src/HttpServerResponseCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-05-12 16:06:14 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-05-12 16:06:14 +0000
commit55c5cccf09d79a573577ded587eedf233acaf6a6 (patch)
tree4bd5aaaec38e6402fe25faf29e3bf0d142a89b4a /src/HttpServerResponseCommand.cc
parent626fa15c5ec40bd35a05a98cbdfafcd809d9a0bc (diff)
2009-05-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed segmentation fault error. SocketBuffer::sendResponse() may throw exception , so it is now in try block. * src/HttpServerResponseCommand.cc
Diffstat (limited to 'src/HttpServerResponseCommand.cc')
-rw-r--r--src/HttpServerResponseCommand.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/HttpServerResponseCommand.cc b/src/HttpServerResponseCommand.cc
index ca096b93..9e689571 100644
--- a/src/HttpServerResponseCommand.cc
+++ b/src/HttpServerResponseCommand.cc
@@ -39,6 +39,7 @@
#include "Logger.h"
#include "HttpServerCommand.h"
#include "RequestGroupMan.h"
+#include "RecoverableException.h"
namespace aria2 {
@@ -66,7 +67,13 @@ bool HttpServerResponseCommand::execute()
if(_e->_requestGroupMan->downloadFinished() || _e->isHaltRequested()) {
return true;
}
- _httpServer->sendResponse();
+ try {
+ _httpServer->sendResponse();
+ } catch(RecoverableException& e) {
+ logger->info("CUID#%d - Error occurred while transmitting response body.",
+ e, cuid);
+ return true;
+ }
if(_httpServer->sendBufferIsEmpty()) {
logger->info("CUID#%d - HttpServer: all response transmitted.", cuid);
if(_httpServer->supportsPersistentConnection()) {
@@ -82,7 +89,7 @@ bool HttpServerResponseCommand::execute()
return true;
} else {
_e->commands.push_back(this);
- return true;
+ return false;
}
}
}