Browse code

- free_via_lump changed into free_via_clen_lump (ugly name to remind us this is just a temporary hack that should be replaced); now it will free also the HDR_CONTENTLENGHT lumps

Andrei Pelinescu-Onciul authored on 24/11/2003 17:39:51
Showing 3 changed files
... ...
@@ -30,6 +30,13 @@
30 30
  * along with this program; if not, write to the Free Software 
31 31
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
32 32
  */
33
+/*
34
+ * Histoy:
35
+ * -------
36
+ *  2003-11-24  changed free_via_lump to free_via_clen_lump and make it
37
+ *              handle CONTENTLENGTH lumps also (andrei)
38
+ */
39
+
33 40
 
34 41
 
35 42
 #ifndef _FIX_LUMPS_H
... ...
@@ -47,14 +54,17 @@
47 54
    the other case when I want to delete them is when a message
48 55
    is stored in shmem for branch picking, forwarded lated and
49 56
    Via removal is applied to the shmem-ed message
57
+
58
+   the same thing for Content-Length lumps (FIXME: this
59
+   should be done in a nicer way)
50 60
 */
51
-inline static void free_via_lump( struct lump **list )
61
+inline static void free_via_clen_lump( struct lump **list )
52 62
 {
53 63
 	struct lump *prev_lump, *lump, *a, *foo;
54 64
 
55 65
 	prev_lump=0;
56 66
 	for(lump=*list;lump;lump=lump->next) {
57
-		if (lump->type==HDR_VIA) {
67
+		if (lump->type==HDR_VIA||lump->type==HDR_CONTENTLENGTH) {
58 68
 			a=lump->before;
59 69
 			while(a) {
60 70
 				foo=a; a=a->before;
... ...
@@ -103,7 +103,7 @@ char *print_uac_request( struct cell *t, struct sip_msg *i_req,
103 103
 		other branches  and for  shmem i_req they would mix up
104 104
 	 	shmem with pkg_mem
105 105
 	*/
106
-	free_via_lump(&i_req->add_rm);
106
+	free_via_clen_lump(&i_req->add_rm);
107 107
 
108 108
 	shbuf=(char *)shm_malloc(*len);
109 109
 	if (!shbuf) {
... ...
@@ -909,7 +909,7 @@ enum rps relay_reply( struct cell *t, struct sip_msg *p_msg, int branch,
909 909
 			   structure
910 910
 			*/
911 911
 			if (branch!=relay) {
912
-				free_via_lump(&relayed_msg->add_rm);
912
+				free_via_clen_lump(&relayed_msg->add_rm);
913 913
 			}
914 914
 		}
915 915
 		update_reply_stats( relayed_code );