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

use SrsTcpClient instead raw socket.

This commit is contained in:
winlin 2015-10-14 10:48:08 +08:00
parent a9bb6061c3
commit 24b3899972
16 changed files with 107 additions and 153 deletions

View file

@ -120,7 +120,7 @@ public:
class SrsHttpResponseReader : virtual public ISrsHttpResponseReader
{
private:
SrsStSocket* skt;
ISrsProtocolReaderWriter* skt;
SrsHttpMessage* owner;
SrsFastStream* buffer;
bool is_eof;
@ -131,7 +131,7 @@ private:
// already read total bytes.
int64_t nb_total_read;
public:
SrsHttpResponseReader(SrsHttpMessage* msg, SrsStSocket* io);
SrsHttpResponseReader(SrsHttpMessage* msg, ISrsProtocolReaderWriter* io);
virtual ~SrsHttpResponseReader();
public:
/**
@ -208,7 +208,7 @@ private:
// the method in QueryString will override the HTTP method.
std::string jsonp_method;
public:
SrsHttpMessage(SrsStSocket* io, SrsConnection* c);
SrsHttpMessage(ISrsProtocolReaderWriter* io, SrsConnection* c);
virtual ~SrsHttpMessage();
public:
/**
@ -332,12 +332,12 @@ public:
* or error and *ppmsg must be NULL.
* @remark, if success, *ppmsg always NOT-NULL, *ppmsg always is_complete().
*/
virtual int parse_message(SrsStSocket* skt, SrsConnection* conn, ISrsHttpMessage** ppmsg);
virtual int parse_message(ISrsProtocolReaderWriter* io, SrsConnection* conn, ISrsHttpMessage** ppmsg);
private:
/**
* parse the HTTP message to member field: msg.
*/
virtual int parse_message_imp(SrsStSocket* skt);
virtual int parse_message_imp(ISrsProtocolReaderWriter* io);
private:
static int on_message_begin(http_parser* parser);
static int on_headers_complete(http_parser* parser);