Commit 421977a2 authored by Simon Morlat's avatar Simon Morlat

fix 2 crashes

- double SipEvent::terminateProcessing() causing abort()
- recursion in asio socket close causing crash.
parent 7a3dcf94
......@@ -108,7 +108,9 @@ void SipEvent::terminateProcessing() {
if (mState == STARTED || mState == SUSPENDED) {
mState = TERMINATED;
flushLog();
} else {
} else if (mState==TERMINATED){
LOGE("SipEvent::terminateProcessing(): event is already terminated. Please fix your code.");
}else{
LOGA("Can't terminateProcessing: wrong state %s", stateStr(mState).c_str());
}
}
......
......@@ -141,8 +141,7 @@ void ForwardModule::onRequest(shared_ptr<RequestSipEvent> &ev) {
if (getAgent()->isUs(dest->url_host, dest->url_port, false)) {
SLOGD << "Skipping forwarding of request to us "
<< url_as_string(ms->getHome(), dest) << "\n" << ms;
ev->reply(SIP_500_INTERNAL_SERVER_ERROR, SIPTAG_SERVER_STR(getAgent()->getServerString()), TAG_END());
ev->terminateProcessing();
ev->reply(SIP_501_NOT_IMPLEMENTED, SIPTAG_SERVER_STR(getAgent()->getServerString()), TAG_END());
return;
}
......
......@@ -149,7 +149,6 @@ void PushNotificationClient::handle_read(const boost::system::error_code& error,
LOGD("PushNotificationClient(%s) read done: %s", mName.c_str(),response.str().c_str());
} else {
LOGE("PushNotificationClient(%s) read failed", mName.c_str());
onError();
}
}
......
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