Last active
December 19, 2015 06:39
-
-
Save kellabyte/5912838 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct | |
{ | |
unsigned short http_major; | |
unsigned short http_minor; | |
unsigned char method; | |
int keep_alive; | |
char *url; | |
void *headers; | |
int body_length; | |
char *body; | |
} http_request; | |
int http_request_on_body(http_parser *parser, const char *at, size_t length) | |
{ | |
/* No Copy! Will this work? */ | |
http_request_context *context = (http_request_context *)parser->data; | |
if (context->request->body == NULL) | |
{ | |
context->request->body = at; | |
} | |
context->request->body_length += length; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment