MCPcopy Create free account
hub / github.com/apache/brpc / http_message_needs_eof

Function http_message_needs_eof

src/brpc/details/http_parser.cpp:2126–2152  ·  view source on GitHub ↗

Does the parser need to see an EOF to find the end of the message? */

Source from the content-addressed store, hash-verified

2124
2125/* Does the parser need to see an EOF to find the end of the message? */
2126int
2127http_message_needs_eof (const http_parser *parser)
2128{
2129 if (parser->type == HTTP_REQUEST) {
2130 return 0;
2131 }
2132
2133 /* See RFC 2616 section 4.4 */
2134 if (parser->status_code / 100 == 1 || /* 1xx e.g. Continue */
2135 parser->status_code == 204 || /* No Content */
2136 parser->status_code == 304 || /* Not Modified */
2137 parser->flags & F_SKIPBODY) { /* response to a HEAD request */
2138 return 0;
2139 }
2140
2141 /* RFC 7230 3.3.3, see `s_headers_almost_done` */
2142 if ((parser->uses_transfer_encoding == 1) &&
2143 (parser->flags & F_CHUNKED) == 0) {
2144 return 1;
2145 }
2146
2147 if ((parser->flags & F_CHUNKED) || parser->content_length != ULLONG_MAX) {
2148 return 0;
2149 }
2150
2151 return 1;
2152}
2153
2154
2155int

Callers 2

http_parser_executeFunction · 0.85
http_should_keep_aliveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected