mirror of https://github.com/aria2/aria2
2009-08-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that download fails if SocketCore::establishConnection() throws exception and aria2 doesn't try another address. * src/AbstractCommand.cc * src/InitiateConnectionCommand.cc * src/message.hpull/1/head
parent
942990354f
commit
a4d5134f80
15
ChangeLog
15
ChangeLog
|
@ -1,3 +1,18 @@
|
||||||
|
2009-08-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Fixed the bug that download fails if
|
||||||
|
SocketCore::establishConnection() throws exception and aria2
|
||||||
|
doesn't try another address.
|
||||||
|
* src/AbstractCommand.cc
|
||||||
|
* src/InitiateConnectionCommand.cc
|
||||||
|
* src/message.h
|
||||||
|
|
||||||
|
2009-08-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Fixed sqlite3.m4 macro so that sqlite3_open_v2 function is
|
||||||
|
detected properly.
|
||||||
|
* m4/sqlite3.m4
|
||||||
|
|
||||||
2009-08-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2009-08-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Renamed xmlrpc::elements::PARAMS to xmlrpc::elements::A2_PARAMS
|
Renamed xmlrpc::elements::PARAMS to xmlrpc::elements::A2_PARAMS
|
||||||
|
|
|
@ -546,10 +546,10 @@ bool AbstractCommand::checkIfConnectionEstablished
|
||||||
if(socket->isReadable(0)) {
|
if(socket->isReadable(0)) {
|
||||||
std::string error = socket->getSocketError();
|
std::string error = socket->getSocketError();
|
||||||
if(!error.empty()) {
|
if(!error.empty()) {
|
||||||
|
// See also InitiateConnectionCommand::executeInternal()
|
||||||
e->markBadIPAddress(connectedHostname, connectedAddr, connectedPort);
|
e->markBadIPAddress(connectedHostname, connectedAddr, connectedPort);
|
||||||
if(!e->findCachedIPAddress(connectedHostname, connectedPort).empty()) {
|
if(!e->findCachedIPAddress(connectedHostname, connectedPort).empty()) {
|
||||||
logger->info("CUID#%d - Could not to connect to %s:%u."
|
logger->info(MSG_CONNECT_FAILED_AND_RETRY,
|
||||||
" Trying another address",
|
|
||||||
cuid, connectedAddr.c_str(), connectedPort);
|
cuid, connectedAddr.c_str(), connectedPort);
|
||||||
Command* command =
|
Command* command =
|
||||||
InitiateConnectionCommandFactory::createInitiateConnectionCommand
|
InitiateConnectionCommandFactory::createInitiateConnectionCommand
|
||||||
|
|
|
@ -47,6 +47,7 @@
|
||||||
#include "DownloadContext.h"
|
#include "DownloadContext.h"
|
||||||
#include "Segment.h"
|
#include "Segment.h"
|
||||||
#include "a2functional.h"
|
#include "a2functional.h"
|
||||||
|
#include "InitiateConnectionCommandFactory.h"
|
||||||
|
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
|
||||||
|
@ -111,10 +112,28 @@ bool InitiateConnectionCommand::executeInternal() {
|
||||||
logger->info(MSG_DNS_CACHE_HIT, cuid, hostname.c_str(), ipaddr.c_str());
|
logger->info(MSG_DNS_CACHE_HIT, cuid, hostname.c_str(), ipaddr.c_str());
|
||||||
addrs.push_back(ipaddr);
|
addrs.push_back(ipaddr);
|
||||||
}
|
}
|
||||||
Command* command = createNextCommand(hostname, ipaddr, port,
|
try {
|
||||||
|
Command* command = createNextCommand(hostname, ipaddr, port,
|
||||||
addrs, proxyRequest);
|
addrs, proxyRequest);
|
||||||
e->commands.push_back(command);
|
e->commands.push_back(command);
|
||||||
return true;
|
return true;
|
||||||
|
} catch(RecoverableException& ex) {
|
||||||
|
// Catch exception and retry another address.
|
||||||
|
// See also AbstractCommand::checkIfConnectionEstablished
|
||||||
|
e->markBadIPAddress(hostname, ipaddr, port);
|
||||||
|
if(!e->findCachedIPAddress(hostname, port).empty()) {
|
||||||
|
logger->info(EX_EXCEPTION_CAUGHT, ex);
|
||||||
|
logger->info(MSG_CONNECT_FAILED_AND_RETRY, cuid, ipaddr.c_str(), port);
|
||||||
|
Command* command =
|
||||||
|
InitiateConnectionCommandFactory::createInitiateConnectionCommand
|
||||||
|
(cuid, req, _fileEntry, _requestGroup, e);
|
||||||
|
e->setNoWait(true);
|
||||||
|
e->commands.push_back(command);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
e->removeCachedIPAddress(hostname, port);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace aria2
|
} // namespace aria2
|
||||||
|
|
|
@ -89,6 +89,8 @@
|
||||||
#define MSG_TRACKER_REQUEST_CREATION_FAILED _("CUID#%d - Cannot create tracker request.")
|
#define MSG_TRACKER_REQUEST_CREATION_FAILED _("CUID#%d - Cannot create tracker request.")
|
||||||
#define MSG_CREATING_TRACKER_REQUEST _("CUID#%d - Creating new tracker request command #%d")
|
#define MSG_CREATING_TRACKER_REQUEST _("CUID#%d - Creating new tracker request command #%d")
|
||||||
#define MSG_DHT_ENABLED_PEER _("CUID#%d - The peer is DHT-enabled.")
|
#define MSG_DHT_ENABLED_PEER _("CUID#%d - The peer is DHT-enabled.")
|
||||||
|
#define MSG_CONNECT_FAILED_AND_RETRY "CUID#%d - Could not to connect to %s:%u."\
|
||||||
|
" Trying another address"
|
||||||
|
|
||||||
#define MSG_UNRECOGNIZED_URI _("Unrecognized URI or unsupported protocol: %s")
|
#define MSG_UNRECOGNIZED_URI _("Unrecognized URI or unsupported protocol: %s")
|
||||||
#define MSG_TRACKER_WARNING_MESSAGE _("Tracker returned warning message: %s")
|
#define MSG_TRACKER_WARNING_MESSAGE _("Tracker returned warning message: %s")
|
||||||
|
|
Loading…
Reference in New Issue