url_parser: remove mixed declarations

(dump_url)
- Remove erroneous quote in output.

(main)
- Remove mixed declarations for compatibility with pre-c99 compilers
like msvc.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/joyent/http-parser/pull/224
make-http-max-header-size-gyp-configurable
Jay Satiro 10 years ago committed by Fedor Indutny
parent 7ecf775d71
commit d547f3b1a9

@ -14,7 +14,7 @@ dump_url (const char *url, const struct http_parser_url *u)
continue;
}
printf("\tfield_data[%u]: off: %u len: %u part: \"%.*s\n",
printf("\tfield_data[%u]: off: %u, len: %u, part: %.*s\n",
i,
u->field_data[i].off,
u->field_data[i].len,
@ -24,16 +24,18 @@ dump_url (const char *url, const struct http_parser_url *u)
}
int main(int argc, char ** argv) {
struct http_parser_url u;
int len, connect, result;
if (argc != 3) {
printf("Syntax : %s connect|get url\n", argv[0]);
return 1;
}
struct http_parser_url u;
int len = strlen(argv[2]);
int connect = strcmp("connect", argv[1]) == 0 ? 1 : 0;
len = strlen(argv[2]);
connect = strcmp("connect", argv[1]) == 0 ? 1 : 0;
printf("Parsing %s, connect %d\n", argv[2], connect);
int result = http_parser_parse_url(argv[2], len, connect, &u);
result = http_parser_parse_url(argv[2], len, connect, &u);
if (result != 0) {
printf("Parse error : %d\n", result);
return result;

Loading…
Cancel
Save