Skip to content
Snippets Groups Projects
Commit ba95892d authored by Sébastien Blin's avatar Sébastien Blin
Browse files

multiplexed_socket: remove useless shutdown

The shutdown() are useless because the broken pipe error must trigger
a shutdown itself and this can cause some locks when the shutdown
callback is triggered when the socket is used to read/write data

Change-Id: If6c0cd481bfd8e00b57a30c4fb6d350756bff951
parent 746d256f
No related branches found
No related tags found
No related merge requests found
...@@ -597,11 +597,8 @@ ChannelSocket::read(ValueType* buf, std::size_t len, std::error_code& ec) ...@@ -597,11 +597,8 @@ ChannelSocket::read(ValueType* buf, std::size_t len, std::error_code& ec)
{ {
if (auto ep = pimpl_->endpoint.lock()) { if (auto ep = pimpl_->endpoint.lock()) {
int res = ep->read(pimpl_->channel, buf, len, ec); int res = ep->read(pimpl_->channel, buf, len, ec);
if (res < 0) {
if (ec) if (ec)
JAMI_ERR("Error when reading on channel: %s", ec.message().c_str()); JAMI_ERR("Error when reading on channel: %s", ec.message().c_str());
shutdown();
}
return res; return res;
} }
ec = std::make_error_code(std::errc::broken_pipe); ec = std::make_error_code(std::errc::broken_pipe);
...@@ -613,11 +610,8 @@ ChannelSocket::write(const ValueType* buf, std::size_t len, std::error_code& ec) ...@@ -613,11 +610,8 @@ ChannelSocket::write(const ValueType* buf, std::size_t len, std::error_code& ec)
{ {
if (auto ep = pimpl_->endpoint.lock()) { if (auto ep = pimpl_->endpoint.lock()) {
int res = ep->write(pimpl_->channel, buf, len, ec); int res = ep->write(pimpl_->channel, buf, len, ec);
if (res < 0) {
if (ec) if (ec)
JAMI_ERR("Error when writing on channel: %s", ec.message().c_str()); JAMI_ERR("Error when writing on channel: %s", ec.message().c_str());
shutdown();
}
return res; return res;
} }
ec = std::make_error_code(std::errc::broken_pipe); ec = std::make_error_code(std::errc::broken_pipe);
...@@ -629,10 +623,8 @@ ChannelSocket::waitForData(std::chrono::milliseconds timeout, std::error_code& e ...@@ -629,10 +623,8 @@ ChannelSocket::waitForData(std::chrono::milliseconds timeout, std::error_code& e
{ {
if (auto ep = pimpl_->endpoint.lock()) { if (auto ep = pimpl_->endpoint.lock()) {
auto res = ep->waitForData(pimpl_->channel, timeout, ec); auto res = ep->waitForData(pimpl_->channel, timeout, ec);
if (res < 0) {
if (ec) if (ec)
JAMI_ERR("Error when waiting on channel: %s", ec.message().c_str()); JAMI_ERR("Error when waiting on channel: %s", ec.message().c_str());
}
return res; return res;
} }
ec = std::make_error_code(std::errc::broken_pipe); ec = std::make_error_code(std::errc::broken_pipe);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment