[SR-Users] dialog: cseq

Halina Nowak halina at mbdsys.com
Fri Jun 14 14:03:10 CEST 2013


Proposal for cseq:

cseq numbering:

--- a/modules/dialog/dlg_handlers.c    Wed Apr 03 13:33:38 2013 +0200
+++ b/modules/dialog/dlg_handlers.c    Fri Jun 14 13:39:47 2013 +0200
@@ -220,7 +220,7 @@
          cseq = (get_cseq(msg))->number;
      } else {
          /* use the same as in request */
-        cseq = dlg->cseq[DLG_CALLER_LEG];
+        cseq = dlg->cseq[DLG_CALLEE_LEG];
      }


avoid memory leak:

--- a/modules/dialog/dlg_hash.c    Fri Jun 14 13:40:12 2013 +0200
+++ b/modules/dialog/dlg_hash.c    Fri Jun 14 13:45:21 2013 +0200
@@ -485,7 +485,14 @@
      char *p;

      dlg->tag[leg].s = (char*)shm_malloc( tag->len + rr->len + 
contact->len );
-    dlg->cseq[leg].s = (char*)shm_malloc( cseq->len );
+    if(dlg->cseq[leg].s){
+      if (dlg->cseq[leg].len < cseq->len) {
+        shm_free(dlg->cseq[leg].s);
+        dlg->cseq[leg].s = (char*)shm_malloc(cseq->len);
+      }
+    }else{
+      dlg->cseq[leg].s = (char*)shm_malloc( cseq->len );
+    }
      if ( dlg->tag[leg].s==NULL || dlg->cseq[leg].s==NULL) {
          LM_ERR("no more shm mem\n");
          if (dlg->tag[leg].s)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20130614/1037cc3b/attachment.html>


More information about the sr-users mailing list