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
pull/1/head
Tatsuhiro Tsujikawa 2009-05-12 16:06:14 +00:00
parent 626fa15c5e
commit 55c5cccf09
2 changed files with 15 additions and 2 deletions

View File

@ -1,3 +1,9 @@
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
2009-05-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added "amChoking" and "peerChoking" key in getPeers response.

View File

@ -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;
}
}
}