Browse code

*** empty log message ***

Bogdan-Andrei Iancu authored on 18/02/2002 13:06:38
Showing 4 changed files
... ...
@@ -16,41 +16,35 @@ void free_cell( struct cell* dead_cell )
16 16
 	struct retrans_buff* rb;
17 17
 	char *b;
18 18
 
19
-	DBG("DEBUG: free_cell: start\n");
20 19
 	/* UA Server */
21
-	DBG("DEBUG: free_cell: inbound request %p\n",dead_cell->inbound_request);
22 20
 	release_cell_lock( dead_cell );
23 21
 	shm_lock();
24 22
 	if ( dead_cell->inbound_request )
25 23
 		sip_msg_free_unsafe( dead_cell->inbound_request );
26
-	DBG("DEBUG: free_cell: outbound response %p\n",dead_cell->outbound_response);
27 24
 	if (b=dead_cell->outbound_response.retr_buffer) shm_free_unsafe( b );
28 25
 
29 26
 	/* UA Clients */
30 27
 	for ( i =0 ; i<dead_cell->nr_of_outgoings;  i++ )
31 28
 	{
32 29
 		/* outbound requests*/
33
-		DBG("DEBUG: free_cell: outbound_request[%d] %p\n",i,dead_cell->outbound_request[i]);
34 30
 		if ( rb=dead_cell->outbound_request[i] )
35
-   		{
31
+		{
36 32
 			if (rb->retr_buffer) shm_free_unsafe( rb->retr_buffer );
37
-	 		dead_cell->outbound_request[i] = NULL;
38
-         		shm_free_unsafe( rb );
39
-   		}
33
+			dead_cell->outbound_request[i] = NULL;
34
+			shm_free_unsafe( rb );
35
+		}
40 36
 		/* outbound ACKs, if any */
41 37
 		if (rb=dead_cell->outbound_ack[i] )
42 38
 			shm_free_unsafe( rb );
43
-   		/* outbound requests*/
44
-   		DBG("DEBUG: free_cell: inbound_response[%d] %p\n",i,dead_cell->inbound_response[i]);
45
-   		if ( dead_cell -> inbound_response[i] )
46
-       		sip_msg_free_unsafe( dead_cell->inbound_response[i] );
47
-   	}
48
-   	/* mutex */
49
-   	/* release_cell_lock( dead_cell ); */
50
-   	/* the cell's body */
51
-   	shm_free_unsafe( dead_cell );
39
+		/* outbound requests*/
40
+		if ( dead_cell -> inbound_response[i] )
41
+		sip_msg_free_unsafe( dead_cell->inbound_response[i] );
42
+	}
43
+	/* mutex */
44
+	/* release_cell_lock( dead_cell ); */
45
+	/* the cell's body */
46
+	shm_free_unsafe( dead_cell );
52 47
 	shm_unlock();
53
-   	DBG("DEBUG: free_cell: done\n");
54 48
 }
55 49
 
56 50
 
... ...
@@ -136,14 +130,12 @@ struct cell*  build_cell( struct sip_msg* p_msg )
136 130
    str                src[5];
137 131
    int                i;
138 132
 
139
-    DBG("DEBUG: build_cell : start\n");
140 133
     /* do we have the source for the build process? */
141 134
    if (!p_msg)
142 135
       return NULL;
143 136
 
144 137
    /* allocs a new cell */
145 138
    new_cell = (struct cell*)sh_malloc( sizeof( struct cell ) );
146
-   DBG("DEBUG: build_cell : malloc done\n");
147 139
    if  ( !new_cell )
148 140
       return NULL;
149 141
 
... ...
@@ -165,7 +157,6 @@ struct cell*  build_cell( struct sip_msg* p_msg )
165 157
    new_cell->dele_tl.payload = new_cell;
166 158
 
167 159
    new_cell->inbound_request =  sip_msg_cloner(p_msg) ;
168
-   DBG("DEBUG: build_cell : clone done\n");
169 160
    if (!new_cell->inbound_request)
170 161
 	goto error;
171 162
    new_cell->relaied_reply_branch   = -1;
... ...
@@ -183,7 +174,6 @@ struct cell*  build_cell( struct sip_msg* p_msg )
183 174
 
184 175
     init_cell_lock(  new_cell );
185 176
 
186
-   DBG("DEBUG: build_cell : done\n");
187 177
    return new_cell;
188 178
 
189 179
 error:
... ...
@@ -210,7 +200,7 @@ void    insert_into_hash_table_unsafe( struct s_table *hash_table,  struct cell
210 200
 		p_entry->last_cell->next_cell = p_cell;
211 201
 		p_cell->prev_cell = p_entry->last_cell;
212 202
 	} else p_entry->first_cell = p_cell;
213
-	
203
+
214 204
 	p_entry->last_cell = p_cell;
215 205
 }
216 206
 
... ...
@@ -82,17 +82,17 @@ struct sip_msg*  sip_msg_cloner( struct sip_msg *org_msg )
82 82
    else
83 83
       lump_chain = org_msg->repl_add_rm;
84 84
    while (lump_chain)
85
-   {  
85
+   {
86 86
       len += lump_len( lump_chain );
87 87
       lump_tmp = lump_chain->before;
88 88
       while ( lump_tmp )
89
-      {  
89
+      {
90 90
          len += lump_len( lump_tmp );
91 91
          lump_tmp = lump_tmp->before;
92 92
       }
93 93
       lump_tmp = lump_chain->after;
94 94
       while ( lump_tmp )
95
-      {  
95
+      {
96 96
          len += lump_len( lump_tmp );
97 97
          lump_tmp = lump_tmp->after;
98 98
       }
... ...
@@ -270,13 +270,13 @@ struct sip_msg*  sip_msg_cloner( struct sip_msg *org_msg )
270 270
       lump_anchor = &(new_msg->repl_add_rm);
271 271
    }
272 272
    while (lump_chain)
273
-   {  
273
+   {
274 274
       lump_clone( (*lump_anchor) , lump_chain , p );
275 275
       /*before list*/
276 276
       lump_tmp = lump_chain->before;
277 277
       lump_anchor2 = &((*lump_anchor)->before);
278 278
       while ( lump_tmp )
279
-      {  
279
+      {
280 280
          lump_clone( (*lump_anchor2) , lump_tmp , p );
281 281
          lump_anchor2 = &((*lump_anchor2)->before);
282 282
          lump_tmp = lump_tmp->before;
... ...
@@ -285,7 +285,7 @@ struct sip_msg*  sip_msg_cloner( struct sip_msg *org_msg )
285 285
       lump_tmp = lump_chain->after;
286 286
       lump_anchor2 = &((*lump_anchor)->after);
287 287
       while ( lump_tmp )
288
-      {  
288
+      {
289 289
          lump_clone( (*lump_anchor2) , lump_tmp , p );
290 290
          lump_anchor2 = &((*lump_anchor2)->after);
291 291
          lump_tmp = lump_tmp->after;
... ...
@@ -307,7 +307,6 @@ struct sip_msg*  sip_msg_cloner( struct sip_msg *org_msg )
307 307
        (*rpl_lump_anchor)->next=0;
308 308
        rpl_lump_anchor = &((*rpl_lump_anchor)->next);
309 309
    }
310
-    DBG("DEBUG:cloner --------<%d>---------<%d>-------------\n",len,p-foo);
311 310
    return new_msg;
312 311
 }
313 312
 
... ...
@@ -1036,12 +1036,13 @@ int t_build_and_send_ACK( struct cell *Trans, unsigned int branch, struct sip_ms
1036 1036
    len += CRLF_LEN; /*new line*/
1037 1037
 
1038 1038
    /* ack_buf = (char *)pkg_malloc( len +1); */
1039
-	srb = (struct retrans_buff *) sh_malloc( sizeof(struct retrans_buff) + len + 1 );
1040
-	if (!srb) {
1041
-		LOG(L_ERR, "ERROR: t_build_and_send_ACK: cannot allocate memory\n");
1042
-		goto error1;
1043
-	}
1044
-	ack_buf = (char *) srb + sizeof(struct retrans_buff);
1039
+   srb = (struct retrans_buff *) sh_malloc(
1040
+          sizeof(struct retrans_buff) + len +1 );
1041
+   if (!srb) {
1042
+      LOG(L_ERR, "ERROR: t_build_and_send_ACK: cannot allocate memory\n");
1043
+     goto error1;
1044
+    }
1045
+    ack_buf = (char *) srb + sizeof(struct retrans_buff);
1045 1046
 
1046 1047
    p = ack_buf;
1047 1048
    DBG("DEBUG: t_build_and_send_ACK: len = %d \n",len);
... ...
@@ -1062,10 +1063,8 @@ int t_build_and_send_ACK( struct cell *Trans, unsigned int branch, struct sip_ms
1062 1063
    }
1063 1064
 
1064 1065
    *(p++) = ' ';
1065
-
1066 1066
    memcpy( p , p_msg->orig+(p_msg->first_line.u.request.version.s-p_msg->buf) , p_msg->first_line.u.request.version.len );
1067 1067
    p += p_msg->first_line.u.request.version.len;
1068
-
1069 1068
    memcpy( p, CRLF, CRLF_LEN );
1070 1069
    p+=CRLF_LEN;
1071 1070
 
... ...
@@ -32,7 +32,7 @@ loadmodule "modules/sl/sl.so"
32 32
 loadmodule "modules/cpl/cpl.so"
33 33
 
34 34
 
35
-route{    /*
35
+route{
36 36
              sl_filter_ACK();
37 37
 
38 38
              if ( mf_is_maxfwd_present() )
... ...
@@ -49,7 +49,7 @@ route{    /*
49 49
              }else{
50 50
                    mf_add_maxfwd_header( "10" );
51 51
              };
52
-                 */
52
+                 
53 53
 
54 54
              /*
55 55
              if (method=="INVITE")