opensips/opensips.patch.save

changeset 377
67e813202d53
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/opensips/opensips.patch.save	Wed Sep 21 14:04:16 2011 +0200
     1.3 @@ -0,0 +1,42 @@
     1.4 +Index: modules/registrar/save.c
     1.5 +diff -Nau modules/registrar/save.c.orig modules/registrar/save.c
     1.6 +--- modules/registrar/save.c.orig	2008-03-07 14:12:56.307895000 +0100
     1.7 ++++ modules/registrar/save.c	2008-03-08 00:03:02.436987000 +0100
     1.8 +@@ -51,6 +51,7 @@
     1.9 + #include "../../ut.h"
    1.10 + #include "../../qvalue.h"
    1.11 + #include "../../dset.h"
    1.12 ++#include "../../msg_translator.h"
    1.13 + #ifdef USE_TCP
    1.14 + #include "../../tcp_server.h"
    1.15 + #endif
    1.16 +@@ -687,9 +688,28 @@
    1.17 + 	contact_t* c;
    1.18 + 	int st;
    1.19 + 	str aor;
    1.20 ++    unsigned int new_len = 0;
    1.21 ++    struct sip_msg* sip_manip = 0;
    1.22 + 
    1.23 + 	rerrno = R_FINE;
    1.24 + 
    1.25 ++	/* make a cheap shallow copy of the incoming message */
    1.26 ++	sip_manip = (void*)pkg_malloc(sizeof(struct sip_msg));
    1.27 ++	if (sip_manip==0) {
    1.28 ++		LM_ERR("no more pkg memory\n");
    1.29 ++		goto error;
    1.30 ++	}
    1.31 ++	memcpy(sip_manip,_m,sizeof(struct sip_msg));
    1.32 ++
    1.33 ++	/* incorporate changes made to the routing script so far, */
    1.34 ++	/* this mean that the so called 'lumps' will be processed */
    1.35 ++	sip_manip->buf = build_res_buf_from_sip_res(_m, &new_len);
    1.36 ++	sip_manip->len = new_len;
    1.37 ++
    1.38 ++	/* from here on, use the new refreshed message data as */
    1.39 ++    /* specifically manipulated according to the user's wish */
    1.40 ++    _m = sip_manip;  /* only safe when passing by value */
    1.41 ++
    1.42 + 	if (parse_message(_m) < 0) {
    1.43 + 		goto error;
    1.44 + 	}
    1.45 +Don't forget to free(3) the pkg_alloc(3) memory!!!

mercurial