summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
fea3e0c)
Previously we'd not been unsetting POLLOUT, which will result in
us spin-loop'ing with ChannelManager_write_buffer_space_avail.
Further, we'd also not been unsetting the POLLIN bit, which would
result in us never pausing read as the SocketDescriptor API
requires us to.
for (int i = 0; i < descriptor->handler->sockcount; i++) {
if (descriptor->handler->pollfds[i].fd == descriptor->fd) {
if (pause_read) {
for (int i = 0; i < descriptor->handler->sockcount; i++) {
if (descriptor->handler->pollfds[i].fd == descriptor->fd) {
if (pause_read) {
- descriptor->handler->pollfds[i].events &= POLLIN;
- descriptor->handler->pollfds[i].events |= POLLOUT;
+ descriptor->handler->pollfds[i].events = POLLOUT;
- descriptor->handler->pollfds[i].events |= POLLIN;
+ descriptor->handler->pollfds[i].events = POLLIN;
lockres = pthread_mutex_lock(&handler->sockets_mutex);
assert(lockres == 0);
assert(handler->pollfds[i - 1].fd == pollfds[i].fd); // Only we change fd order!
lockres = pthread_mutex_lock(&handler->sockets_mutex);
assert(lockres == 0);
assert(handler->pollfds[i - 1].fd == pollfds[i].fd); // Only we change fd order!
- handler->pollfds[i - 1].events &= POLLIN;
- handler->pollfds[i - 1].events |= POLLOUT;
+ handler->pollfds[i - 1].events = POLLOUT;
lockres = pthread_mutex_unlock(&handler->sockets_mutex);
assert(lockres == 0);
}
lockres = pthread_mutex_unlock(&handler->sockets_mutex);
assert(lockres == 0);
}