mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
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
This commit is contained in:
@ -597,11 +597,8 @@ ChannelSocket::read(ValueType* buf, std::size_t len, std::error_code& ec)
|
||||
{
|
||||
if (auto ep = pimpl_->endpoint.lock()) {
|
||||
int res = ep->read(pimpl_->channel, buf, len, ec);
|
||||
if (res < 0) {
|
||||
if (ec)
|
||||
JAMI_ERR("Error when reading on channel: %s", ec.message().c_str());
|
||||
shutdown();
|
||||
}
|
||||
if (ec)
|
||||
JAMI_ERR("Error when reading on channel: %s", ec.message().c_str());
|
||||
return res;
|
||||
}
|
||||
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)
|
||||
{
|
||||
if (auto ep = pimpl_->endpoint.lock()) {
|
||||
int res = ep->write(pimpl_->channel, buf, len, ec);
|
||||
if (res < 0) {
|
||||
if (ec)
|
||||
JAMI_ERR("Error when writing on channel: %s", ec.message().c_str());
|
||||
shutdown();
|
||||
}
|
||||
if (ec)
|
||||
JAMI_ERR("Error when writing on channel: %s", ec.message().c_str());
|
||||
return res;
|
||||
}
|
||||
ec = std::make_error_code(std::errc::broken_pipe);
|
||||
@ -629,10 +623,8 @@ ChannelSocket::waitForData(std::chrono::milliseconds timeout, std::error_code& e
|
||||
{
|
||||
if (auto ep = pimpl_->endpoint.lock()) {
|
||||
auto res = ep->waitForData(pimpl_->channel, timeout, ec);
|
||||
if (res < 0) {
|
||||
if (ec)
|
||||
JAMI_ERR("Error when waiting on channel: %s", ec.message().c_str());
|
||||
}
|
||||
if (ec)
|
||||
JAMI_ERR("Error when waiting on channel: %s", ec.message().c_str());
|
||||
return res;
|
||||
}
|
||||
ec = std::make_error_code(std::errc::broken_pipe);
|
||||
|
Reference in New Issue
Block a user