You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
703 B
32 lines
703 B
#ifndef __HTTP_REQUEST_PARSER_H__
|
|
#define __HTTP_REQUEST_PARSER_H__
|
|
|
|
#include "cclass.h"
|
|
#include "server.h"
|
|
#include "http/request.h"
|
|
#include "http/request_queue.h"
|
|
|
|
#define HTTP_REQUEST_PARSER_READ_CHUNK 1024
|
|
|
|
#define HTTP_REQUEST_PARSER_START 0
|
|
#define HTTP_REQUEST_PARSER_REQUEST_LINE_DONE 1
|
|
#define HTTP_REQUEST_PARSER_HEADERS_DONE 2
|
|
#define HTTP_REQUEST_PARSER_DONE 3
|
|
|
|
|
|
CLASS(HTTP_REQUEST_PARSER) {
|
|
server_read_hook get_data;
|
|
|
|
char * buffer;
|
|
size_t buffer_used;
|
|
|
|
HTTP_REQUEST_QUEUE request_queue;
|
|
|
|
unsigned char state;
|
|
};
|
|
|
|
void http_request_parser_parse(const char * buffer, size_t size);
|
|
|
|
#endif /* __HTTP_REQUEST_PARSER_H__ */
|
|
|
|
// vim: set ts=4 sw=4:
|