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

channeled_transport: check socket before write

Fix a backtrace got on play store vitals

Change-Id: Id8333476073ab5aca253a9e69a48bf364018d0fc
parent 7eb1e737
Branches
No related tags found
No related merge requests found
...@@ -292,15 +292,15 @@ ChanneledSIPTransport::send(pjsip_tx_data* tdata, ...@@ -292,15 +292,15 @@ ChanneledSIPTransport::send(pjsip_tx_data* tdata,
// Check in we are able to send it in synchronous way first // Check in we are able to send it in synchronous way first
const std::size_t size = tdata->buf.cur - tdata->buf.start; const std::size_t size = tdata->buf.cur - tdata->buf.start;
std::unique_lock<std::mutex> lk {txMutex_}; std::unique_lock<std::mutex> lk {txMutex_};
if (/*TODO handle disconned: syncTx_ and*/ txQueue_.empty()) { if (txQueue_.empty()) {
if (socket_) {
std::error_code ec; std::error_code ec;
socket_->write(reinterpret_cast<const uint8_t*>(tdata->buf.start), size, ec); socket_->write(reinterpret_cast<const uint8_t*>(tdata->buf.start), size, ec);
lk.unlock(); if (!ec)
if (ec) {
return PJ_EINVAL;
}
return PJ_SUCCESS; return PJ_SUCCESS;
} }
return PJ_EINVAL;
}
// Asynchronous sending // Asynchronous sending
tdata->op_key.tdata = tdata; tdata->op_key.tdata = tdata;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment