Problem: Theoretical overflow when polling more than INT_MAX handles.

Solution: Always use fd_t when accessing the pollset.
This commit is contained in:
Michael Lutz 2016-06-11 18:50:40 +02:00
parent 7292de8de5
commit 8d8d32f4d0

View File

@ -94,25 +94,25 @@ void zmq::poll_t::rm_fd (handle_t handle_)
void zmq::poll_t::set_pollin (handle_t handle_)
{
int index = fd_table [handle_].index;
fd_t index = fd_table [handle_].index;
pollset [index].events |= POLLIN;
}
void zmq::poll_t::reset_pollin (handle_t handle_)
{
int index = fd_table [handle_].index;
fd_t index = fd_table [handle_].index;
pollset [index].events &= ~((short) POLLIN);
}
void zmq::poll_t::set_pollout (handle_t handle_)
{
int index = fd_table [handle_].index;
fd_t index = fd_table [handle_].index;
pollset [index].events |= POLLOUT;
}
void zmq::poll_t::reset_pollout (handle_t handle_)
{
int index = fd_table [handle_].index;
fd_t index = fd_table [handle_].index;
pollset [index].events &= ~((short) POLLOUT);
}