浏览代码

- fixed parse_via_param: params. starting with [op] had incorect name/len
(thanks to Gabriel)

Andrei Pelinescu-Onciul 22 年之前
父节点
当前提交
ff76544d55
共有 3 个文件被更改,包括 11 次插入9 次删除
  1. 11 2
      parser/parse_via.c
  2. 0 6
      tcp_conn.h
  3. 0 1
      tcp_main.c

+ 11 - 2
parser/parse_via.c

@@ -40,8 +40,9 @@
  *  2003-01-27  modified parse_via to set new via_param->start member and
  *               via->params.s (andrei)
  *  2003-01-28  zero-terminations replaced with VIA_ZT (jiri)
- *  2003-02-28 scratchpad compatibility abandoned (jiri)
- *  2003-04-26 ZSW (jiri)
+ *  2003-02-28  scratchpad compatibility abandoned (jiri)
+ *  2003-04-26  ZSW (jiri)
+ *  2003-06-23  fixed  parse_via_param [op].* param. parsing bug (andrei)
  */
 
 
@@ -646,6 +647,10 @@ static /*inline*/ char* parse_via_param(char* p, char* end,
 			case 'p':
 			case 'P':
 				switch(state){
+					case F_PARAM:
+						state=GEN_PARAM;
+						param->name.s=tmp;
+						break;
 					case RECEIVED1:
 						state=RPORT1;
 						break;
@@ -661,6 +666,10 @@ static /*inline*/ char* parse_via_param(char* p, char* end,
 			case 'o':
 			case 'O':
 				switch(state){
+					case F_PARAM:
+						state=GEN_PARAM;
+						param->name.s=tmp;
+						break;
 					case RPORT1:
 						state=RPORT2;
 						break;

+ 0 - 6
tcp_conn.h

@@ -88,12 +88,6 @@ struct tcp_connection{
 	int id; /* id (unique!) used to retrieve a specific connection when
 	           reply-ing*/
 	struct receive_info rcv; /* src & dst ip, ports, proto a.s.o*/
-#if 0
-	struct ip_addr ip; /* peer ip */
-	int port; /* peer port */
-	int sock_idx; /* receiving socket index in the tcp_info array */
-	union sockaddr_union su;
-#endif
 	struct tcp_req req; /* request data */
 	volatile int refcnt;
 	int bad; /* if set this is a "bad" connection */

+ 0 - 1
tcp_main.c

@@ -118,7 +118,6 @@ struct tcp_connection* tcpconn_new(int sock, union sockaddr_union* su,
 {
 	struct tcp_connection *c;
 	
-
 	c=(struct tcp_connection*)shm_malloc(sizeof(struct tcp_connection));
 	if (c==0){
 		LOG(L_ERR, "ERROR: tcpconn_add: mem. allocation failure\n");