1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

refine http framework, use http message

This commit is contained in:
winlin 2014-04-02 12:03:49 +08:00
parent e70609cea3
commit ec6d696565
7 changed files with 347 additions and 318 deletions

View file

@ -38,28 +38,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <http_parser.h>
class SrsSocket;
class SrsHttpParser;
class SrsHttpMessage;
class SrsHttpConn : public SrsConnection
{
private:
SrsHttpMessage* req;
SrsHttpParser* parser;
public:
SrsHttpConn(SrsServer* srs_server, st_netfd_t client_stfd);
virtual ~SrsHttpConn();
protected:
virtual int do_cycle();
private:
virtual int parse_request(SrsSocket* skt, http_parser* parser, http_parser_settings* settings);
virtual int process_request(SrsSocket* skt);
private:
static int on_message_begin(http_parser* parser);
static int on_headers_complete(http_parser* parser);
static int on_message_complete(http_parser* parser);
static int on_url(http_parser* parser, const char* at, size_t length);
static int on_header_field(http_parser* parser, const char* at, size_t length);
static int on_header_value(http_parser* parser, const char* at, size_t length);
static int on_body(http_parser* parser, const char* at, size_t length);
virtual int process_request(SrsSocket* skt, SrsHttpMessage* req);
};
#endif