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

change to 0.9.42, add http parse framework

This commit is contained in:
winlin 2014-04-01 12:36:56 +08:00
parent 5aa0043934
commit 51c1615173
8 changed files with 214 additions and 37 deletions

View file

@ -33,13 +33,30 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_app_st.hpp>
#include <srs_app_conn.hpp>
#include <http_parser.h>
class SrsSocket;
class SrsHttpConn : public SrsConnection
{
private:
http_parser* http_header;
public:
SrsHttpConn(SrsServer* srs_server, st_netfd_t client_stfd);
virtual ~SrsHttpConn();
protected:
virtual int do_cycle();
private:
virtual int process_request(SrsSocket* skt, http_parser* parser, http_parser_settings* settings);
virtual int complete_header(SrsSocket* skt, http_parser* header, char* body, int nb_body);
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);
};
#endif