winlin

refine forward, use utility to generate the tcUrl

@@ -100,14 +100,7 @@ int SrsForwarder::on_publish(SrsRequest* req, std::string forward_server) @@ -100,14 +100,7 @@ int SrsForwarder::on_publish(SrsRequest* req, std::string forward_server)
100 port = ::atoi(s_port.c_str()); 100 port = ::atoi(s_port.c_str());
101 101
102 // generate tcUrl 102 // generate tcUrl
103 - tc_url = "rtmp://";  
104 - if (vhost == RTMP_VHOST_DEFAULT) {  
105 - tc_url += forward_server;  
106 - } else {  
107 - tc_url += vhost;  
108 - }  
109 - tc_url += "/";  
110 - tc_url += req->app; 103 + tc_url = srs_generate_tc_url(forward_server, vhost, req->app, s_port);
111 104
112 // dead loop check 105 // dead loop check
113 std::string source_ep = "rtmp://"; 106 std::string source_ep = "rtmp://";