To prevent assidental disappearance of the stream while it's in use.
Also, the caller can create and forget - we'll do the cleanup later.
Signed-off-by: Phil Carmody <phil@dovecot.fi>
{
memset(parser, 0, sizeof(*parser));
parser->input = input;
+ i_stream_ref(parser->input);
if (hdr_limits != NULL)
parser->header_limits = *hdr_limits;
parser->max_payload_size = max_payload_size;
pool_unref(&parser->msg.pool);
if (parser->payload != NULL)
i_stream_unref(&parser->payload);
+ if (parser->input != NULL)
+ i_stream_unref(&parser->input);
}
void http_message_parser_restart(struct http_message_parser *parser,