|
|
@ -25,7 +25,7 @@
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
|
|
|
|
|
|
|
|
static const char data[] =
|
|
|
|
static const char data[] =
|
|
|
|
"GET /joyent/http-parser HTTP/1.1\r\n"
|
|
|
|
"POST /joyent/http-parser HTTP/1.1\r\n"
|
|
|
|
"Host: github.com\r\n"
|
|
|
|
"Host: github.com\r\n"
|
|
|
|
"DNT: 1\r\n"
|
|
|
|
"DNT: 1\r\n"
|
|
|
|
"Accept-Encoding: gzip, deflate, sdch\r\n"
|
|
|
|
"Accept-Encoding: gzip, deflate, sdch\r\n"
|
|
|
@ -37,7 +37,8 @@ static const char data[] =
|
|
|
|
"image/webp,*/*;q=0.8\r\n"
|
|
|
|
"image/webp,*/*;q=0.8\r\n"
|
|
|
|
"Referer: https://github.com/joyent/http-parser\r\n"
|
|
|
|
"Referer: https://github.com/joyent/http-parser\r\n"
|
|
|
|
"Connection: keep-alive\r\n"
|
|
|
|
"Connection: keep-alive\r\n"
|
|
|
|
"Cache-Control: max-age=0\r\n\r\n";
|
|
|
|
"Transfer-Encoding: chunked\r\n"
|
|
|
|
|
|
|
|
"Cache-Control: max-age=0\r\n\r\nb\r\nhello world\r\n0\r\n\r\n";
|
|
|
|
static const size_t data_len = sizeof(data) - 1;
|
|
|
|
static const size_t data_len = sizeof(data) - 1;
|
|
|
|
|
|
|
|
|
|
|
|
static int on_info(http_parser* p) {
|
|
|
|
static int on_info(http_parser* p) {
|
|
|
|