Explorar o código

- fixed missing l: support in tcp pre-parsing

Andrei Pelinescu-Onciul %!s(int64=22) %!d(string=hai) anos
pai
achega
607fcb9085
Modificáronse 3 ficheiros con 17 adicións e 2 borrados
  1. 1 1
      Makefile.defs
  2. 2 0
      TODO
  3. 14 1
      tcp_read.c

+ 1 - 1
Makefile.defs

@@ -25,7 +25,7 @@
 VERSION = 0
 VERSION = 0
 PATCHLEVEL = 8
 PATCHLEVEL = 8
 SUBLEVEL =   11
 SUBLEVEL =   11
-EXTRAVERSION = pre24
+EXTRAVERSION = pre25
 
 
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")
 OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")

+ 2 - 0
TODO

@@ -34,6 +34,8 @@ x fix bind_address for tcp (in some  way)
 - tcp_destroy (called on ser exit)
 - tcp_destroy (called on ser exit)
 - BUG:?? ipv6 only and try to send to ipv4 => getsendsocket=>0 (send_ipv6=0)
 - BUG:?? ipv6 only and try to send to ipv4 => getsendsocket=>0 (send_ipv6=0)
   the reverse is also true
   the reverse is also true
+- SUBST lumps for replies (involves setting the send_socket in forward_reply, 
+  before build_res_from_res, & adding it to buid_res_from_res).
 
 
 
 
 High priority:
 High priority:

+ 14 - 1
tcp_read.c

@@ -29,6 +29,7 @@
  * --------
  * --------
  * 2002-12-??  created by andrei.
  * 2002-12-??  created by andrei.
  * 2003-02-10  zero term before calling receive_msg & undo afterwards (andrei)
  * 2003-02-10  zero term before calling receive_msg & undo afterwards (andrei)
+ * 2003-05-13  l: (short form of Content-Length) is now recognized (andrei)
  */
  */
 
 
 #ifdef USE_TCP
 #ifdef USE_TCP
@@ -125,7 +126,13 @@ int tcp_read_headers(struct tcp_req *r, int fd)
 					case 'c': \
 					case 'c': \
 						if(!r->has_content_len) r->state=H_CONT_LEN1; \
 						if(!r->has_content_len) r->state=H_CONT_LEN1; \
 						else r->state=H_SKIP; \
 						else r->state=H_SKIP; \
-						break 
+						break; \
+					case 'l': \
+					case 'L': \
+						/* short form for Content-Length */ \
+						if (!r->has_content_len) r->state=H_L_COLON; \
+						else r->state=H_SKIP; \
+						break
 						
 						
 	#define change_state(upper, lower, newstate)\
 	#define change_state(upper, lower, newstate)\
 					switch(*p){ \
 					switch(*p){ \
@@ -246,6 +253,12 @@ int tcp_read_headers(struct tcp_req *r, int fd)
 						r->state=H_CONT_LEN1; 
 						r->state=H_CONT_LEN1; 
 						r->start=p;
 						r->start=p;
 						break;
 						break;
+					case 'l':
+					case 'L':
+						/* short form for Content-Length */
+						r->state=H_L_COLON;
+						r->start=p;
+						break;
 					default:
 					default:
 						r->state=H_SKIP;
 						r->state=H_SKIP;
 						r->start=p;
 						r->start=p;