[OpenSER-Devel] [ openser-Bugs-1932524 ] dialog: improper dialog reference for DLGCB_WITHIN_RESPONSE

SourceForge.net noreply at sourceforge.net
Wed Apr 2 20:49:27 CEST 2008


Bugs item #1932524, was opened at 2008-04-02 14:38
Message generated for change (Settings changed) made by osas
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1932524&group_id=139143

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
>Category: modules
Group: ver devel
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Ovidiu Sas (osas)
Assigned to: Nobody/Anonymous (nobody)
Summary: dialog: improper dialog reference for DLGCB_WITHIN_RESPONSE

Initial Comment:
If DLGCB_WITHIN_RESPONSE calback is activated, dialogs never goes into DLG_STATE_DELETED state.  This is a result of an extra reference being performed on for ACK on dlg_onroute() method.

ACK is a special transaction without a response, and therefore the TMCB_RESPONSE_FWDED|TMCB_TRANS_DELETED callbacks should not be invoked for ACK.

The entire TMCB_RESPONSE_FWDED|TMCB_TRANS_DELETED claback registration block should be filtered out for ACK transactions:
dlg_handlers.c:dlg_onroute():
     /* ref the dialog as registered into the transaction
      * callback; unref will be done when the transaction
      * will be destroied */
      LM_INFO("ref_dlg( %p , '1' )\n", dlg);
      ref_dlg( dlg , 1);
      /* register callback for the replies of this request */
      if ( d_tmb.register_tmcb( req, 0,
           TMCB_RESPONSE_FWDED|TMCB_TRANS_DELETED,
           dlg_seq_onreply, (void*)dlg)<0 ) {
               LM_ERR("failed to register TMCB (2)\n");
               unref_dlg( dlg , 1);
      }


Something like this is fixing the problem:
dlg_handlers.c:dlg_onroute():
-       if ( (dlg->cbs.types)&DLGCB_WITHIN_RESPONSE ) {
+       if ( (dlg->cbs.types)&DLGCB_WITHIN_RESPONSE &&
+             event!=DLG_EVENT_REQACK ) {


This is causing dialog leakage and some funny shm memory pollution (the server is not able to shutdown properly).


Regards,
Ovidiu Sas

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1932524&group_id=139143



More information about the Devel mailing list