fix bug for create connection with ip.

pull/556/head^2
winlin 9 years ago
parent a7bf4bfda5
commit d267b8fa19

@ -71,7 +71,8 @@ int SrsAppCasterFlv::on_tcp_client(st_netfd_t stfd)
{
int ret = ERROR_SUCCESS;
SrsHttpConn* conn = new SrsDynamicHttpConn(this, stfd, http_mux);
string ip = srs_get_peer_ip(st_netfd_fileno(stfd));
SrsHttpConn* conn = new SrsDynamicHttpConn(this, stfd, http_mux, ip);
conns.push_back(conn);
if ((ret = conn->start()) != ERROR_SUCCESS) {
@ -115,8 +116,8 @@ int SrsAppCasterFlv::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
return conn->proxy(w, r, o);
}
SrsDynamicHttpConn::SrsDynamicHttpConn(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m)
: SrsHttpConn(cm, fd, m)
SrsDynamicHttpConn::SrsDynamicHttpConn(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m, string cip)
: SrsHttpConn(cm, fd, m, cip)
{
sdk = new SrsSimpleRtmpClient();
pprint = SrsPithyPrint::create_caster();

@ -88,7 +88,7 @@ private:
SrsPithyPrint* pprint;
SrsSimpleRtmpClient* sdk;
public:
SrsDynamicHttpConn(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m);
SrsDynamicHttpConn(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m, std::string cip);
virtual ~SrsDynamicHttpConn();
public:
virtual int on_got_http_message(ISrsHttpMessage* msg);

Loading…
Cancel
Save