}
parser->msg.date = (time_t)-1;
parser->msg.header = http_header_create(parser->msg.pool, 32);
- p_array_init(&parser->msg.connection_options, parser->msg.pool, 4);
}
int http_message_parse_version(struct http_message_parser *parser)
num_tokens++;
if (strcasecmp(option, "close") == 0)
parser->msg.connection_close = TRUE;
+ if (!array_is_created(&parser->msg.connection_options))
+ p_array_init(&parser->msg.connection_options, parser->msg.pool, 4);
opt_idx = array_append_space(&parser->msg.connection_options);
*opt_idx = p_strdup(parser->msg.pool, option);
}
!msg->connection_close) {
const char *const *option;
- msg->connection_close = TRUE;
- array_foreach(&msg->connection_options, option) {
- if (strcasecmp(*option, "Keep-Alive") == 0) {
- msg->connection_close = FALSE;
- break;
+ msg->connection_close = TRUE;
+ if (array_is_created(&parser->msg.connection_options)) {
+ array_foreach(&msg->connection_options, option) {
+ if (strcasecmp(*option, "Keep-Alive") == 0) {
+ msg->connection_close = FALSE;
+ break;
+ }
}
- }
+ }
}
return 1;
}
{
const char *const *opt_idx;
+ if (!array_is_created(&req->connection_options))
+ return FALSE;
array_foreach(&req->connection_options, opt_idx) {
if (strcasecmp(*opt_idx, option) == 0)
return TRUE;