Browse code

- fixed branch parsed bug (parse_via) - added module dependecy to master Makefile (modules/*/Makefile)

Andrei Pelinescu-Onciul authored on 04/12/2001 00:29:18
Showing 4 changed files
... ...
@@ -33,8 +33,10 @@ NAME=ser
33 33
 # PKG_MALLOC uses a faster malloc (exclusive w/ USE_SHM_MEM)
34 34
 # USE_SHM_MEM all pkg_malloc => shm_malloc (most mallocs use a common sh. mem.
35 35
 #           segment); don't define PKG_MALLOC if you want this!
36
-DEFS=-DTHREAD -DNOCR -DMACROEATER -DDNS_IP_HACK  -DSHM_MEM -DUSE_SHM_MEM \
37
-	 -DPKG_MALLOC  -DNO_DEBUG
36
+DEFS=-DTHREAD -DNOCR -DMACROEATER -DDNS_IP_HACK  -DSHM_MEM \
37
+	 -DPKG_MALLOC #-DNO_DEBUG
38
+# -DUSE_SHM_MEM
39
+#-DNO_DEBUG 
38 40
 #-DPKG_MALLOC
39 41
 #-DNO_DEBUG#-DSTATS -DNO_DEBUG 
40 42
 #-DNO_LOG
... ...
@@ -15,6 +15,8 @@ NAME=tm.so
15 15
 SHLIB_LD_FLAGS= -shared
16 16
 LIBS= -lpthread
17 17
 
18
+ALLDEP=Makefile ../../Makefile
19
+
18 20
 ifeq ($(ARCH), SunOS)
19 21
 LDFLAGS=-O2 -G
20 22
 endif
... ...
@@ -263,6 +263,9 @@ __inline char* parse_via_param(	char* p, char* end, int* pstate,
263 263
 						state=HIDDEN1;
264 264
 						param->name.s=tmp;
265 265
 						break;
266
+					case BRANCH5:
267
+						state=FIN_BRANCH;
268
+						break;
266 269
 					case GEN_PARAM:
267 270
 						break;
268 271
 					case F_CR:
... ...
@@ -809,7 +812,6 @@ char* parse_via(char* buffer, char* end, struct via_body *vb)
809 812
 	char* tmp_param;
810 813
 	struct via_param* param;
811 814
 
812
-
813 815
 parse_again:
814 816
 	vb->error=VIA_PARSE_ERROR;
815 817
 	/* parse start of via ( SIP/2.0/UDP    )*/
... ...
@@ -1586,12 +1588,6 @@ main_via:
1586 1588
 						memset(param,0, sizeof(struct via_param));
1587 1589
 						tmp=parse_via_param(tmp, end, &state, &saved_state,
1588 1590
 											param);
1589
-						/*add param to the list*/
1590
-						if (vb->last_param)	vb->last_param->next=param;
1591
-						else				vb->param_lst=param;
1592
-						vb->last_param=param;
1593
-						if (param->type==PARAM_BRANCH)
1594
-							vb->branch=param;
1595 1591
 						
1596 1592
 						switch(state){
1597 1593
 							case L_PARAM:
... ...
@@ -1616,6 +1612,12 @@ main_via:
1616 1612
 										*tmp, state);
1617 1613
 								goto error;
1618 1614
 						}
1615
+						/*add param to the list*/
1616
+						if (vb->last_param)	vb->last_param->next=param;
1617
+						else				vb->param_lst=param;
1618
+						vb->last_param=param;
1619
+						if (param->type==PARAM_BRANCH)
1620
+							vb->branch=param;
1619 1621
 						break;
1620 1622
 					case P_PARAM:
1621 1623
 						break;
... ...
@@ -1706,6 +1708,7 @@ endofpacket:
1706 1708
 	}
1707 1709
 	return tmp;
1708 1710
 nextvia:
1711
+	DBG("parse_via: next_via\n");
1709 1712
 	vb->error=VIA_PARSE_OK;
1710 1713
 	vb->bsize=tmp-buffer;
1711 1714
 	if (vb->port_str.s){
... ...
@@ -86,7 +86,7 @@ error_dots:
86 86
 	if (err) *err=1;
87 87
 	return 0;
88 88
 error_char:
89
-	DBG("str2ip: ERROR: unexpected char %c in %s\n", *str, init);
89
+	DBG("str2ip: WARNING: unexpected char %c in %s\n", *str, init);
90 90
 	if (err) *err=1;
91 91
 	return 0;
92 92
 }