소스 검색

Added comments in read_request()

Sergey Lyubka 13 년 전
부모
커밋
9378946e7d
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      mongoose.c

+ 2 - 0
mongoose.c

@@ -2714,6 +2714,8 @@ static int read_request(FILE *fp, struct mg_connection *conn,
         (n = pull(fp, conn, buf + *nread, bufsiz - *nread)) > 0) {
       *nread += n;
     }
+    // *nread <= bufsiz check is crucial. If client fills up the whole buffer
+    // in one go, we still need to make an iteration and calculate request_len
   } while (*nread <= bufsiz && request_len == 0 && n > 0);
 
   return n < 0 ? -1 : request_len;