| 2109 | |
| 2110 | |
| 2111 | int |
| 2112 | http_should_keep_alive (const http_parser *parser) |
| 2113 | { |
| 2114 | if (parser->http_major > 0 && parser->http_minor > 0) { |
| 2115 | /* HTTP/1.1 */ |
| 2116 | if (parser->flags & F_CONNECTION_CLOSE) { |
| 2117 | return 0; |
| 2118 | } |
| 2119 | } else { |
| 2120 | /* HTTP/1.0 or earlier */ |
| 2121 | if (!(parser->flags & F_CONNECTION_KEEP_ALIVE)) { |
| 2122 | return 0; |
| 2123 | } |
| 2124 | } |
| 2125 | |
| 2126 | return !http_message_needs_eof(parser); |
| 2127 | } |
| 2128 | |
| 2129 | |
| 2130 | const char * |