diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-07-27 13:54:59 -0400 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-07-27 13:54:59 -0400 |
| commit | e6e825da706f6a59e597aac7ab65b846ea3a7fd4 (patch) | |
| tree | e55018b0c5dbcc7a84d2942ec2a10bca3a269e99 /ext/http-parser/contrib/url_parser.c | |
| parent | 917b95a1d688904ed0ca34b96fafc0849867d9fb (diff) | |
| download | infinitytier-e6e825da706f6a59e597aac7ab65b846ea3a7fd4.tar.gz infinitytier-e6e825da706f6a59e597aac7ab65b846ea3a7fd4.zip | |
Get rid of built-in HTTP. If we do HTTP it will probably be via libcurl to support HTTPS and chunking and other complexities.
Diffstat (limited to 'ext/http-parser/contrib/url_parser.c')
| -rw-r--r-- | ext/http-parser/contrib/url_parser.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/ext/http-parser/contrib/url_parser.c b/ext/http-parser/contrib/url_parser.c deleted file mode 100644 index b1f9c979..00000000 --- a/ext/http-parser/contrib/url_parser.c +++ /dev/null @@ -1,44 +0,0 @@ -#include "http_parser.h" -#include <stdio.h> -#include <string.h> - -void -dump_url (const char *url, const struct http_parser_url *u) -{ - unsigned int i; - - printf("\tfield_set: 0x%x, port: %u\n", u->field_set, u->port); - for (i = 0; i < UF_MAX; i++) { - if ((u->field_set & (1 << i)) == 0) { - printf("\tfield_data[%u]: unset\n", i); - continue; - } - - printf("\tfield_data[%u]: off: %u len: %u part: \"%.*s\n", - i, - u->field_data[i].off, - u->field_data[i].len, - u->field_data[i].len, - url + u->field_data[i].off); - } -} - -int main(int argc, char ** argv) { - 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; - printf("Parsing %s, connect %d\n", argv[2], connect); - - int result = http_parser_parse_url(argv[2], len, connect, &u); - if (result != 0) { - printf("Parse error : %d\n", result); - return result; - } - printf("Parse ok, result : \n"); - dump_url(argv[2], &u); - return 0; -}
\ No newline at end of file |
