2
0
Эх сурвалжийг харах

- 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 22 жил өмнө
parent
commit
b7b66ef2a8

+ 12 - 2
modules/tm/fix_lumps.h

@@ -30,6 +30,13 @@
  * along with this program; if not, write to the Free Software 
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
+/*
+ * Histoy:
+ * -------
+ *  2003-11-24  changed free_via_lump to free_via_clen_lump and make it
+ *              handle CONTENTLENGTH lumps also (andrei)
+ */
+
 
 
 #ifndef _FIX_LUMPS_H
@@ -47,14 +54,17 @@
    the other case when I want to delete them is when a message
    is stored in shmem for branch picking, forwarded lated and
    Via removal is applied to the shmem-ed message
+
+   the same thing for Content-Length lumps (FIXME: this
+   should be done in a nicer way)
 */
-inline static void free_via_lump( struct lump **list )
+inline static void free_via_clen_lump( struct lump **list )
 {
 	struct lump *prev_lump, *lump, *a, *foo;
 
 	prev_lump=0;
 	for(lump=*list;lump;lump=lump->next) {
-		if (lump->type==HDR_VIA) {
+		if (lump->type==HDR_VIA||lump->type==HDR_CONTENTLENGTH) {
 			a=lump->before;
 			while(a) {
 				foo=a; a=a->before;

+ 1 - 1
modules/tm/t_fwd.c

@@ -103,7 +103,7 @@ char *print_uac_request( struct cell *t, struct sip_msg *i_req,
 		other branches  and for  shmem i_req they would mix up
 	 	shmem with pkg_mem
 	*/
-	free_via_lump(&i_req->add_rm);
+	free_via_clen_lump(&i_req->add_rm);
 
 	shbuf=(char *)shm_malloc(*len);
 	if (!shbuf) {

+ 1 - 1
modules/tm/t_reply.c

@@ -909,7 +909,7 @@ enum rps relay_reply( struct cell *t, struct sip_msg *p_msg, int branch,
 			   structure
 			*/
 			if (branch!=relay) {
-				free_via_lump(&relayed_msg->add_rm);
+				free_via_clen_lump(&relayed_msg->add_rm);
 			}
 		}
 		update_reply_stats( relayed_code );