Skip to content

Commit

Permalink
Update http_parser.content_length doc comment.
Browse files Browse the repository at this point in the history
It's -1 when no Content-Length field is present, not 0.

Fixes: nodejs#512
PR-URL: nodejs#513
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
  • Loading branch information
bnoordhuis committed May 11, 2020
1 parent 805a0d1 commit 5c5b3ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion http_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,9 @@ struct http_parser {
unsigned int lenient_http_headers : 1;

uint32_t nread; /* # bytes read in various scenarios */
uint64_t content_length; /* # bytes in body (0 if no Content-Length header) */
uint64_t content_length; /* # bytes in body. `(uint64_t) -1` (all bits one)
* if no Content-Length header.
*/

/** READ-ONLY **/
unsigned short http_major;
Expand Down

0 comments on commit 5c5b3ac

Please sign in to comment.