正在显示
2 个修改的文件
包含
5 行增加
和
4 行删除
| @@ -71,7 +71,8 @@ int SrsAppCasterFlv::on_tcp_client(st_netfd_t stfd) | @@ -71,7 +71,8 @@ int SrsAppCasterFlv::on_tcp_client(st_netfd_t stfd) | ||
| 71 | { | 71 | { |
| 72 | int ret = ERROR_SUCCESS; | 72 | int ret = ERROR_SUCCESS; |
| 73 | 73 | ||
| 74 | - SrsHttpConn* conn = new SrsDynamicHttpConn(this, stfd, http_mux); | 74 | + string ip = srs_get_peer_ip(st_netfd_fileno(stfd)); |
| 75 | + SrsHttpConn* conn = new SrsDynamicHttpConn(this, stfd, http_mux, ip); | ||
| 75 | conns.push_back(conn); | 76 | conns.push_back(conn); |
| 76 | 77 | ||
| 77 | if ((ret = conn->start()) != ERROR_SUCCESS) { | 78 | if ((ret = conn->start()) != ERROR_SUCCESS) { |
| @@ -115,8 +116,8 @@ int SrsAppCasterFlv::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r) | @@ -115,8 +116,8 @@ int SrsAppCasterFlv::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r) | ||
| 115 | return conn->proxy(w, r, o); | 116 | return conn->proxy(w, r, o); |
| 116 | } | 117 | } |
| 117 | 118 | ||
| 118 | -SrsDynamicHttpConn::SrsDynamicHttpConn(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m) | ||
| 119 | - : SrsHttpConn(cm, fd, m) | 119 | +SrsDynamicHttpConn::SrsDynamicHttpConn(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m, string cip) |
| 120 | + : SrsHttpConn(cm, fd, m, cip) | ||
| 120 | { | 121 | { |
| 121 | sdk = new SrsSimpleRtmpClient(); | 122 | sdk = new SrsSimpleRtmpClient(); |
| 122 | pprint = SrsPithyPrint::create_caster(); | 123 | pprint = SrsPithyPrint::create_caster(); |
| @@ -88,7 +88,7 @@ private: | @@ -88,7 +88,7 @@ private: | ||
| 88 | SrsPithyPrint* pprint; | 88 | SrsPithyPrint* pprint; |
| 89 | SrsSimpleRtmpClient* sdk; | 89 | SrsSimpleRtmpClient* sdk; |
| 90 | public: | 90 | public: |
| 91 | - SrsDynamicHttpConn(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m); | 91 | + SrsDynamicHttpConn(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m, std::string cip); |
| 92 | virtual ~SrsDynamicHttpConn(); | 92 | virtual ~SrsDynamicHttpConn(); |
| 93 | public: | 93 | public: |
| 94 | virtual int on_got_http_message(ISrsHttpMessage* msg); | 94 | virtual int on_got_http_message(ISrsHttpMessage* msg); |
-
请 注册 或 登录 后发表评论