Does the parser need to see an EOF to find the end of the message? */
| 2086 | |
| 2087 | /* Does the parser need to see an EOF to find the end of the message? */ |
| 2088 | int |
| 2089 | http_message_needs_eof (const http_parser *parser) |
| 2090 | { |
| 2091 | if (parser->type == HTTP_REQUEST) { |
| 2092 | return 0; |
| 2093 | } |
| 2094 | |
| 2095 | /* See RFC 2616 section 4.4 */ |
| 2096 | if (parser->status_code / 100 == 1 || /* 1xx e.g. Continue */ |
| 2097 | parser->status_code == 204 || /* No Content */ |
| 2098 | parser->status_code == 304 || /* Not Modified */ |
| 2099 | parser->flags & F_SKIPBODY) { /* response to a HEAD request */ |
| 2100 | return 0; |
| 2101 | } |
| 2102 | |
| 2103 | if ((parser->flags & F_CHUNKED) || parser->content_length != ULLONG_MAX) { |
| 2104 | return 0; |
| 2105 | } |
| 2106 | |
| 2107 | return 1; |
| 2108 | } |
| 2109 | |
| 2110 | |
| 2111 | int |
no outgoing calls
no test coverage detected