mirror of https://github.com/aria2/aria2
commit
e2eb5f82e2
|
@ -71,7 +71,7 @@ void callback(void* arg, int status, int timeouts, ares_addrinfo* result)
|
|||
}
|
||||
|
||||
namespace {
|
||||
void sock_state_cb(void* arg, int fd, int read, int write)
|
||||
void sock_state_cb(void* arg, ares_socket_t fd, int read, int write)
|
||||
{
|
||||
auto resolver = static_cast<AsyncNameResolver*>(arg);
|
||||
|
||||
|
@ -79,7 +79,7 @@ void sock_state_cb(void* arg, int fd, int read, int write)
|
|||
}
|
||||
} // namespace
|
||||
|
||||
void AsyncNameResolver::handle_sock_state(int fd, int read, int write)
|
||||
void AsyncNameResolver::handle_sock_state(ares_socket_t fd, int read, int write)
|
||||
{
|
||||
int events = 0;
|
||||
|
||||
|
@ -142,9 +142,9 @@ void AsyncNameResolver::resolve(const std::string& name)
|
|||
ares_getaddrinfo(channel_, name.c_str(), nullptr, &hints, callback, this);
|
||||
}
|
||||
|
||||
int AsyncNameResolver::getFds(fd_set* rfdsPtr, fd_set* wfdsPtr) const
|
||||
ares_socket_t AsyncNameResolver::getFds(fd_set* rfdsPtr, fd_set* wfdsPtr) const
|
||||
{
|
||||
auto nfds = 0;
|
||||
ares_socket_t nfds = 0;
|
||||
|
||||
for (const auto& ent : socks_) {
|
||||
if (ent.events & EventPoll::EVENT_READ) {
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
namespace aria2 {
|
||||
|
||||
struct AsyncNameResolverSocketEntry {
|
||||
int fd;
|
||||
ares_socket_t fd;
|
||||
int events;
|
||||
};
|
||||
|
||||
|
@ -89,7 +89,7 @@ public:
|
|||
|
||||
STATUS getStatus() const { return status_; }
|
||||
|
||||
int getFds(fd_set* rfdsPtr, fd_set* wfdsPtr) const;
|
||||
ares_socket_t getFds(fd_set* rfdsPtr, fd_set* wfdsPtr) const;
|
||||
|
||||
void process(fd_set* rfdsPtr, fd_set* wfdsPtr);
|
||||
|
||||
|
@ -108,7 +108,7 @@ public:
|
|||
|
||||
const std::string& getHostname() const { return hostname_; }
|
||||
|
||||
void handle_sock_state(int sock, int read, int write);
|
||||
void handle_sock_state(ares_socket_t sock, int read, int write);
|
||||
};
|
||||
|
||||
} // namespace aria2
|
||||
|
|
|
@ -129,7 +129,7 @@ SelectEventPoll::AsyncNameResolverEntry::AsyncNameResolverEntry(
|
|||
{
|
||||
}
|
||||
|
||||
int SelectEventPoll::AsyncNameResolverEntry::getFds(fd_set* rfdsPtr,
|
||||
ares_socket_t SelectEventPoll::AsyncNameResolverEntry::getFds(fd_set* rfdsPtr,
|
||||
fd_set* wfdsPtr)
|
||||
{
|
||||
return nameResolver_->getFds(rfdsPtr, wfdsPtr);
|
||||
|
@ -184,7 +184,7 @@ void SelectEventPoll::poll(const struct timeval& tv)
|
|||
|
||||
for (auto& i : nameResolverEntries_) {
|
||||
auto& entry = i.second;
|
||||
int fd = entry.getFds(&rfds, &wfds);
|
||||
auto fd = entry.getFds(&rfds, &wfds);
|
||||
// TODO force error if fd == 0
|
||||
if (fdmax_ < fd) {
|
||||
fdmax_ = fd;
|
||||
|
|
|
@ -142,7 +142,7 @@ private:
|
|||
command_ < entry.command_);
|
||||
}
|
||||
|
||||
int getFds(fd_set* rfdsPtr, fd_set* wfdsPtr);
|
||||
ares_socket_t getFds(fd_set* rfdsPtr, fd_set* wfdsPtr);
|
||||
|
||||
void process(fd_set* rfdsPtr, fd_set* wfdsPtr);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue