mirror of https://github.com/aria2/aria2
2010-10-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Don't reuse socket which is readable because we assume that if socket is readable it means peer shutdowns connection and the socket will receive EOF. Added default timeout value to DownloadEngine::poolSocket(). * src/DownloadEngine.cc * src/DownloadEngine.hpull/1/head
parent
6b74a27586
commit
51308002d3
|
@ -1,3 +1,12 @@
|
||||||
|
2010-10-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Don't reuse socket which is readable because we assume that if
|
||||||
|
socket is readable it means peer shutdowns connection and the
|
||||||
|
socket will receive EOF. Added default timeout value to
|
||||||
|
DownloadEngine::poolSocket().
|
||||||
|
* src/DownloadEngine.cc
|
||||||
|
* src/DownloadEngine.h
|
||||||
|
|
||||||
2010-10-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2010-10-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Fixed the bug that file allocation is enabled in HTTP even if
|
Fixed the bug that file allocation is enabled in HTTP even if
|
||||||
|
|
|
@ -399,7 +399,9 @@ DownloadEngine::findSocketPoolEntry(const std::string& key)
|
||||||
for(std::multimap<std::string, SocketPoolEntry>::iterator i =
|
for(std::multimap<std::string, SocketPoolEntry>::iterator i =
|
||||||
range.first, eoi = range.second; i != eoi; ++i) {
|
range.first, eoi = range.second; i != eoi; ++i) {
|
||||||
const SocketPoolEntry& e = (*i).second;
|
const SocketPoolEntry& e = (*i).second;
|
||||||
if(!e.isTimeout()) {
|
// We assume that if socket is readable it means peer shutdowns
|
||||||
|
// connection and the socket will receive EOF. So skip it.
|
||||||
|
if(!e.isTimeout() && !e.getSocket()->isReadable(0)) {
|
||||||
logger_->info("Found socket for %s", key.c_str());
|
logger_->info("Found socket for %s", key.c_str());
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
|
@ -257,7 +257,7 @@ public:
|
||||||
const std::string& proxyhost, uint16_t proxyport,
|
const std::string& proxyhost, uint16_t proxyport,
|
||||||
const SharedHandle<SocketCore>& sock,
|
const SharedHandle<SocketCore>& sock,
|
||||||
const std::map<std::string, std::string>& options,
|
const std::map<std::string, std::string>& options,
|
||||||
time_t timeout);
|
time_t timeout = 15);
|
||||||
|
|
||||||
void poolSocket(const SharedHandle<Request>& request,
|
void poolSocket(const SharedHandle<Request>& request,
|
||||||
const std::string& username,
|
const std::string& username,
|
||||||
|
@ -269,7 +269,7 @@ public:
|
||||||
void poolSocket(const std::string& ipaddr, uint16_t port,
|
void poolSocket(const std::string& ipaddr, uint16_t port,
|
||||||
const std::string& proxyhost, uint16_t proxyport,
|
const std::string& proxyhost, uint16_t proxyport,
|
||||||
const SharedHandle<SocketCore>& sock,
|
const SharedHandle<SocketCore>& sock,
|
||||||
time_t timeout);
|
time_t timeout = 15);
|
||||||
|
|
||||||
void poolSocket(const SharedHandle<Request>& request,
|
void poolSocket(const SharedHandle<Request>& request,
|
||||||
const SharedHandle<Request>& proxyRequest,
|
const SharedHandle<Request>& proxyRequest,
|
||||||
|
|
Loading…
Reference in New Issue