Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/invite bye leak #283

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
more logging
  • Loading branch information
davehorton committed May 26, 2023
commit c4b7a37e5368a65a243cf0ab6affb0fbdd7f9fb9
3 changes: 2 additions & 1 deletion src/invite-in-progress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,12 @@ namespace drachtio {
return true;
}

void IIP_Clear(InvitesInProgress_t& iips, nta_leg_t* leg) {
std::shared_ptr<IIP> IIP_Clear(InvitesInProgress_t& iips, nta_leg_t* leg) {
std::shared_ptr<IIP> iip;
if (IIP_FindByLeg(iips, leg, iip)) {
IIP_Clear(iips, iip);
}
return iip;
}

void IIP_Clear(InvitesInProgress_t& iips, std::shared_ptr<IIP>& iip) {
Expand Down
2 changes: 1 addition & 1 deletion src/invite-in-progress.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ namespace drachtio {
bool IIP_FindByReliable(const InvitesInProgress_t& iips, nta_reliable_t* rel, std::shared_ptr<IIP>& iip) ;
bool IIP_FindByTransactionId(const InvitesInProgress_t& iips, const std::string& transactionId, std::shared_ptr<IIP>& iip) ;
void IIP_Clear(InvitesInProgress_t& iips, std::shared_ptr<IIP>& iip);
void IIP_Clear(InvitesInProgress_t& iips, nta_leg_t* leg);
std::shared_ptr<IIP> IIP_Clear(InvitesInProgress_t& iips, nta_leg_t* leg);
size_t IIP_Size(const InvitesInProgress_t& iips);
void IIP_SetReliable(InvitesInProgress_t& iips, std::shared_ptr<IIP>& iip, nta_reliable_t* rel);
void IIP_Log(const InvitesInProgress_t& iips, bool full = false);
Expand Down
6 changes: 5 additions & 1 deletion src/sip-dialog-controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,11 @@ namespace drachtio {

// in case we have an invite in progress we sent, and received a BYE instead of final response
DR_LOG(log_debug) << "SipDialogController::processRequestInsideDialog: received BYE, if we have an IIP clear it now" ;
IIP_Clear(m_invitesInProgress, leg); }
std::shared_ptr<IIP> iip = IIP_Clear(m_invitesInProgress, leg);
if (iip) {
DR_LOG(log_debug) << "SipDialogController::processRequestInsideDialog: found an IIP to clear: " << *iip; ;
}
}
}
}
return rc ;
Expand Down