Browse Source

fixed bug that failed to parse Context-Length header when same string appeared in another header

cecylia 6 years ago
parent
commit
b0461011c5
2 changed files with 2 additions and 2 deletions
  1. 1 1
      relay_station/Makefile
  2. 1 1
      relay_station/relay.c

+ 1 - 1
relay_station/Makefile

@@ -1,4 +1,4 @@
-CFLAGS=-g -ggdb -Wall -std=gnu99 #-DDEBUG_DOWN -DDEBUG_PROXY -DRESOURCE_DEBUG -DDEBUG_HS
+CFLAGS=-g -ggdb -Wall -std=gnu99 -DDEBUG_DOWN -DDEBUG_PROXY -DRESOURCE_DEBUG -DDEBUG_HS
 
 TARGETS=slitheen-proxy
 

+ 1 - 1
relay_station/relay.c

@@ -1144,7 +1144,7 @@ int process_downstream(flow *f, int32_t offset, struct packet_info *info){
                                                     f->httpstate = FORFEIT_REST;
                                                 }
 					} else {
-						len_ptr = strstr((const char *) p, "Content-Length");
+						len_ptr = strstr((const char *) p, "Content-Length:");
 						if(len_ptr != NULL){
 							len_ptr += 15;
 							f->remaining_response_len = strtol((const char *) len_ptr, NULL, 10);