mirror of https://github.com/aria2/aria2
2008-06-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Made _epEvents a member variable. * src/DownloadEngine.cc * src/DownloadEngine.hpull/1/head
parent
d4b29c84fc
commit
09502fc3db
|
@ -1,3 +1,9 @@
|
|||
2008-06-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
Made _epEvents a member variable.
|
||||
* src/DownloadEngine.cc
|
||||
* src/DownloadEngine.h
|
||||
|
||||
2008-06-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
Cancel download if http redirect is bounded more than 20 times.
|
||||
|
|
|
@ -398,6 +398,8 @@ DownloadEngine::DownloadEngine():logger(LogFactory::getInstance()),
|
|||
|
||||
_epfd = epoll_create(EPOLL_EVENTS_MAX);
|
||||
|
||||
_epEvents = new struct epoll_event[EPOLL_EVENTS_MAX];
|
||||
|
||||
#else // !HAVE_EPOLL
|
||||
|
||||
updateFdSet();
|
||||
|
@ -419,6 +421,7 @@ DownloadEngine::~DownloadEngine() {
|
|||
}
|
||||
}
|
||||
|
||||
delete [] _epEvents;
|
||||
|
||||
#endif // HAVE_EPOLL
|
||||
}
|
||||
|
@ -496,12 +499,8 @@ void DownloadEngine::waitData()
|
|||
// timeout is millisec
|
||||
int timeout = _noWait ? 0 : 1000;
|
||||
|
||||
// TODO make member variable
|
||||
const size_t _maxEpEvents = EPOLL_EVENTS_MAX;
|
||||
struct epoll_event _epEvents[_maxEpEvents];
|
||||
|
||||
int res;
|
||||
while((res = epoll_wait(_epfd, _epEvents, _maxEpEvents, timeout)) == -1 &&
|
||||
while((res = epoll_wait(_epfd, _epEvents, EPOLL_EVENTS_MAX, timeout)) == -1 &&
|
||||
errno == EINTR);
|
||||
|
||||
if(res > 0) {
|
||||
|
|
|
@ -237,6 +237,8 @@ private:
|
|||
|
||||
int _epfd;
|
||||
|
||||
struct epoll_event* _epEvents;
|
||||
|
||||
static const size_t EPOLL_EVENTS_MAX = 1024;
|
||||
|
||||
#else // !HAVE_EPOLL
|
||||
|
|
Loading…
Reference in New Issue