Просмотр исходного кода

Rewrite request parsing (Step 9/?)

Closes #484
bel2125 8 лет назад
Родитель
Сommit
489684da03
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      src/civetweb.c

+ 2 - 2
src/civetweb.c

@@ -8740,7 +8740,7 @@ parse_http_request(char *buf, int len, struct mg_request_info *ri)
 	ri->num_headers = 0;
 
 	/* Ignore leading \r and \n */
-	while ((len > 0) && (*buf == '\r') && (*buf == '\n')) {
+    while ((len > 0) && ((*buf == '\r') || (*buf == '\n'))) {
 		buf++;
 		len--;
 	}
@@ -8817,7 +8817,7 @@ parse_http_response(char *buf, int len, struct mg_response_info *ri)
 	ri->num_headers = ri->status_code = 0;
 
 	/* Ignore leading \r and \n */
-	while ((len > 0) && (*buf == '\r') && (*buf == '\n')) {
+    while ((len > 0) && ((*buf == '\r') || (*buf == '\n'))) {
 		buf++;
 		len--;
 	}