mirror of https://github.com/aria2/aria2
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.ccpull/1/head
parent
626fa15c5e
commit
55c5cccf09
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue