Commit 374c4240 authored by Dominik Charousset's avatar Dominik Charousset

Avoid shutting down socket channels

Closing one communication channel such as read or write may cause the
remote side to abort the entire connection since it assumes an error or
disconnect.
parent 5ee6e029
...@@ -184,7 +184,6 @@ void multiplexer::shutdown_reading(const socket_manager_ptr& mgr) { ...@@ -184,7 +184,6 @@ void multiplexer::shutdown_reading(const socket_manager_ptr& mgr) {
} else if (auto index = index_of(mgr); index != -1) { } else if (auto index = index_of(mgr); index != -1) {
mgr->block_reads(); mgr->block_reads();
auto& entry = pollset_[index]; auto& entry = pollset_[index];
std::ignore = shutdown_read(socket{entry.fd});
entry.events &= ~input_mask; entry.events &= ~input_mask;
if (entry.events == 0) if (entry.events == 0)
del(index); del(index);
...@@ -202,7 +201,6 @@ void multiplexer::shutdown_writing(const socket_manager_ptr& mgr) { ...@@ -202,7 +201,6 @@ void multiplexer::shutdown_writing(const socket_manager_ptr& mgr) {
} else if (auto index = index_of(mgr); index != -1) { } else if (auto index = index_of(mgr); index != -1) {
mgr->block_writes(); mgr->block_writes();
auto& entry = pollset_[index]; auto& entry = pollset_[index];
std::ignore = shutdown_write(socket{entry.fd});
entry.events &= ~output_mask; entry.events &= ~output_mask;
if (entry.events == 0) if (entry.events == 0)
del(index); del(index);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment