Browse Source

- fixed parse_via_param (now handles also ',')

Andrei Pelinescu-Onciul 24 years ago
parent
commit
490ff008c6
2 changed files with 26 additions and 6 deletions
  1. 7 5
      Makefile
  2. 19 1
      parse_via.c

+ 7 - 5
Makefile

@@ -31,16 +31,18 @@ NAME=ser
 # SHM_MEM    compiles in shared mem. support, needed by some modules and
 #            by USE_SHM_MEM
 # PKG_MALLOC uses a faster malloc (exclusive w/ USE_SHM_MEM)
-# USE_SHM_MEM all pkg_malloc => sh_malloc (most mallocs use a common sh. mem.
-#           segment); don't define PKG_MALLOC!
-DEFS=-DTHREAD -DNOCR -DMACROEATER -DDNS_IP_HACK  -DSHM_MEM -DUSE_SHM_MEM #-DNO_DEBUG 
+# USE_SHM_MEM all pkg_malloc => shm_malloc (most mallocs use a common sh. mem.
+#           segment); don't define PKG_MALLOC if you want this!
+DEFS=-DTHREAD -DNOCR -DMACROEATER -DDNS_IP_HACK  -DSHM_MEM -DUSE_SHM_MEM \
+	 -DPKG_MALLOC -DNO_DEBUG
+#-DNO_DEBUG 
 #-DPKG_MALLOC
 #-DNO_DEBUG#-DSTATS -DNO_DEBUG 
 #-DNO_LOG
 
 PROFILE=  # -pg #set this if you want profiling
-mode = debug
-#mode = release
+#mode = debug
+mode = release
 
 # platform dependent settings
 

+ 19 - 1
parse_via.c

@@ -700,7 +700,25 @@ find_value:
 						goto error;
 				}
 				break;
-			
+			case ',':
+				switch(state){
+					case P_VALUE:
+						*tmp=0;
+						param->value.len=tmp-param->value.s;
+						state=F_VIA;
+						goto endofvalue;
+					case P_STRING:
+						case F_LF:
+					case F_CR:
+					case F_CRLF:
+						state=END_OF_HEADER;
+						goto end_via;
+					default:
+						LOG(L_ERR, "ERROR: parse_via: invalid char <%c>"
+								" in state %d\n", state);
+						goto error;
+				}
+				break; /* what to do? */
 			case '"':
 				switch(state){
 					case F_VALUE: