mirror of
https://github.com/aria2/aria2.git
synced 2024-12-14 01:18:40 +00:00
2008-09-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
If error event is received in epoll, then abort download immediately. * src/AbstractCommand.cc * src/Command.cc * src/Command.h * src/DownloadEngine.cc * src/PeerAbstractCommand.cc
This commit is contained in:
parent
81b2e6e108
commit
0680ac5e5e
@ -1,3 +1,12 @@
|
||||
2008-09-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
If error event is received in epoll, then abort download immediately.
|
||||
* src/AbstractCommand.cc
|
||||
* src/Command.cc
|
||||
* src/Command.h
|
||||
* src/DownloadEngine.cc
|
||||
* src/PeerAbstractCommand.cc
|
||||
|
||||
2008-09-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
Added usage message for --uri-selector, --server-stat-of,
|
||||
|
@ -107,7 +107,7 @@ bool AbstractCommand::execute() {
|
||||
}
|
||||
if((checkSocketIsReadable && _readEvent) ||
|
||||
(checkSocketIsWritable && _writeEvent) ||
|
||||
_errorEvent ||
|
||||
_hupEvent ||
|
||||
#ifdef ENABLE_ASYNC_DNS
|
||||
(nameResolverCheck && nameResolveFinished()) ||
|
||||
#endif // ENABLE_ASYNC_DNS
|
||||
@ -136,6 +136,8 @@ bool AbstractCommand::execute() {
|
||||
}
|
||||
}
|
||||
return executeInternal();
|
||||
} else if(_errorEvent) {
|
||||
throw DlRetryEx("Network problem has occurred.");
|
||||
} else {
|
||||
if(checkPoint.elapsed(timeout)) {
|
||||
// timeout triggers ServerStat error state.
|
||||
|
@ -46,7 +46,8 @@ Command::Command(int32_t cuid):uuid(uuidGen++),
|
||||
logger(LogFactory::getInstance()),
|
||||
_readEvent(false),
|
||||
_writeEvent(false),
|
||||
_errorEvent(false) {}
|
||||
_errorEvent(false),
|
||||
_hupEvent(false) {}
|
||||
|
||||
void Command::transitStatus()
|
||||
{
|
||||
@ -73,16 +74,22 @@ void Command::writeEventReceived()
|
||||
_writeEvent = true;
|
||||
}
|
||||
|
||||
void Command::errorEventRecieved()
|
||||
void Command::errorEventReceived()
|
||||
{
|
||||
_errorEvent = true;
|
||||
}
|
||||
|
||||
void Command::hupEventReceived()
|
||||
{
|
||||
_hupEvent = true;
|
||||
}
|
||||
|
||||
void Command::clearIOEvents()
|
||||
{
|
||||
_readEvent = false;
|
||||
_writeEvent = false;
|
||||
_errorEvent = false;
|
||||
_hupEvent = false;
|
||||
}
|
||||
|
||||
} // namespace aria2
|
||||
|
@ -65,6 +65,7 @@ protected:
|
||||
bool _readEvent;
|
||||
bool _writeEvent;
|
||||
bool _errorEvent;
|
||||
bool _hupEvent;
|
||||
public:
|
||||
Command(int32_t cuid);
|
||||
|
||||
@ -95,7 +96,9 @@ public:
|
||||
|
||||
void writeEventReceived();
|
||||
|
||||
void errorEventRecieved();
|
||||
void errorEventReceived();
|
||||
|
||||
void hupEventReceived();
|
||||
|
||||
void clearIOEvents();
|
||||
};
|
||||
|
@ -109,8 +109,11 @@ void CommandEvent::processEvents(int events)
|
||||
if(SocketEntry::EVENT_WRITE&events) {
|
||||
_command->writeEventReceived();
|
||||
}
|
||||
if((SocketEntry::EVENT_ERROR|SocketEntry::EVENT_HUP)&events) {
|
||||
_command->errorEventRecieved();
|
||||
if(SocketEntry::EVENT_ERROR&events) {
|
||||
_command->errorEventReceived();
|
||||
}
|
||||
if(SocketEntry::EVENT_HUP&events) {
|
||||
_command->hupEventReceived();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -81,8 +81,10 @@ bool PeerAbstractCommand::execute()
|
||||
if(noCheck ||
|
||||
(checkSocketIsReadable && _readEvent) ||
|
||||
(checkSocketIsWritable && _writeEvent) ||
|
||||
_errorEvent) {
|
||||
_hupEvent) {
|
||||
checkPoint.reset();
|
||||
} else if(_errorEvent) {
|
||||
throw DlAbortEx("Network problem has occurred.");
|
||||
}
|
||||
if(checkPoint.elapsed(timeout)) {
|
||||
throw DlAbortEx(EX_TIME_OUT);
|
||||
|
Loading…
Reference in New Issue
Block a user