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