mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
fix bug for create connection with ip.
This commit is contained in:
parent
a7bf4bfda5
commit
d267b8fa19
2 changed files with 5 additions and 4 deletions
|
@ -71,7 +71,8 @@ int SrsAppCasterFlv::on_tcp_client(st_netfd_t stfd)
|
||||||
{
|
{
|
||||||
int ret = ERROR_SUCCESS;
|
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);
|
conns.push_back(conn);
|
||||||
|
|
||||||
if ((ret = conn->start()) != ERROR_SUCCESS) {
|
if ((ret = conn->start()) != ERROR_SUCCESS) {
|
||||||
|
@ -115,8 +116,8 @@ int SrsAppCasterFlv::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
|
||||||
return conn->proxy(w, r, o);
|
return conn->proxy(w, r, o);
|
||||||
}
|
}
|
||||||
|
|
||||||
SrsDynamicHttpConn::SrsDynamicHttpConn(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m)
|
SrsDynamicHttpConn::SrsDynamicHttpConn(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m, string cip)
|
||||||
: SrsHttpConn(cm, fd, m)
|
: SrsHttpConn(cm, fd, m, cip)
|
||||||
{
|
{
|
||||||
sdk = new SrsSimpleRtmpClient();
|
sdk = new SrsSimpleRtmpClient();
|
||||||
pprint = SrsPithyPrint::create_caster();
|
pprint = SrsPithyPrint::create_caster();
|
||||||
|
|
|
@ -88,7 +88,7 @@ private:
|
||||||
SrsPithyPrint* pprint;
|
SrsPithyPrint* pprint;
|
||||||
SrsSimpleRtmpClient* sdk;
|
SrsSimpleRtmpClient* sdk;
|
||||||
public:
|
public:
|
||||||
SrsDynamicHttpConn(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m);
|
SrsDynamicHttpConn(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m, std::string cip);
|
||||||
virtual ~SrsDynamicHttpConn();
|
virtual ~SrsDynamicHttpConn();
|
||||||
public:
|
public:
|
||||||
virtual int on_got_http_message(ISrsHttpMessage* msg);
|
virtual int on_got_http_message(ISrsHttpMessage* msg);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue