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

create http handler framework

This commit is contained in:
winlin 2014-04-02 18:07:34 +08:00
parent eae9b94153
commit 341b5151d9
10 changed files with 244 additions and 9 deletions

View file

@ -35,16 +35,30 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
class SrsSocket;
class SrsHttpMessage;
class SrsHttpParser;
class SrsHttpHandler;
#include <srs_app_st.hpp>
#include <srs_app_conn.hpp>
#include <srs_app_http.hpp>
// for http root.
class SrsApiRoot : public SrsHttpHandler
{
public:
SrsApiRoot();
virtual ~SrsApiRoot();
public:
virtual bool can_handle(const char* path, int length);
virtual int process_request(SrsSocket* skt, SrsHttpMessage* req, const char* path, int length);
};
class SrsHttpApi : public SrsConnection
{
private:
SrsHttpParser* parser;
SrsHttpHandler* handler;
public:
SrsHttpApi(SrsServer* srs_server, st_netfd_t client_stfd);
SrsHttpApi(SrsServer* srs_server, st_netfd_t client_stfd, SrsHttpHandler* _handler);
virtual ~SrsHttpApi();
protected:
virtual int do_cycle();