Add function to initialize http_parser_settings

PR-URL: https://github.com/joyent/http-parser/pull/215
Reviewed-By: Fedor Indutny <fedor@indutny.com>
make-http-max-header-size-gyp-configurable
Romain Giraud 10 years ago committed by Fedor Indutny
parent 1b31580893
commit 53063b780b

@ -2136,6 +2136,12 @@ http_parser_init (http_parser *parser, enum http_parser_type t)
parser->http_errno = HPE_OK; parser->http_errno = HPE_OK;
} }
void
http_parser_settings_init(http_parser_settings *settings)
{
memset(settings, 0, sizeof(*settings));
}
const char * const char *
http_errno_name(enum http_errno err) { http_errno_name(enum http_errno err) {
assert(err < (sizeof(http_strerror_tab)/sizeof(http_strerror_tab[0]))); assert(err < (sizeof(http_strerror_tab)/sizeof(http_strerror_tab[0])));

@ -288,6 +288,11 @@ unsigned long http_parser_version(void);
void http_parser_init(http_parser *parser, enum http_parser_type type); void http_parser_init(http_parser *parser, enum http_parser_type type);
/* Initialize http_parser_settings members to 0
*/
void http_parser_settings_init(http_parser_settings *settings);
/* Executes the parser. Returns number of parsed bytes. Sets /* Executes the parser. Returns number of parsed bytes. Sets
* `parser->http_errno` on error. */ * `parser->http_errno` on error. */
size_t http_parser_execute(http_parser *parser, size_t http_parser_execute(http_parser *parser,

Loading…
Cancel
Save