winlin

for #742, fix publish recv thread bug.

@@ -305,7 +305,8 @@ SrsRtmpConn::SrsRtmpConn(SrsServer* svr, st_netfd_t c, string cip) @@ -305,7 +305,8 @@ SrsRtmpConn::SrsRtmpConn(SrsServer* svr, st_netfd_t c, string cip)
305 realtime = SRS_PERF_MIN_LATENCY_ENABLED; 305 realtime = SRS_PERF_MIN_LATENCY_ENABLED;
306 send_min_interval = 0; 306 send_min_interval = 0;
307 tcp_nodelay = false; 307 tcp_nodelay = false;
308 - 308 + client_type = SrsRtmpConnUnknown;
  309 +
309 _srs_config->subscribe(this); 310 _srs_config->subscribe(this);
310 } 311 }
311 312
@@ -709,6 +710,7 @@ int SrsRtmpConn::stream_service_cycle() @@ -709,6 +710,7 @@ int SrsRtmpConn::stream_service_cycle()
709 source->source_id(), source->source_id()); 710 source->source_id(), source->source_id());
710 source->set_cache(enabled_cache); 711 source->set_cache(enabled_cache);
711 712
  713 + client_type = type;
712 switch (type) { 714 switch (type) {
713 case SrsRtmpConnPlay: { 715 case SrsRtmpConnPlay: {
714 srs_verbose("start to play stream %s.", req->stream.c_str()); 716 srs_verbose("start to play stream %s.", req->stream.c_str());
@@ -1037,7 +1039,9 @@ int SrsRtmpConn::publishing(SrsSource* source) @@ -1037,7 +1039,9 @@ int SrsRtmpConn::publishing(SrsSource* source)
1037 // use isolate thread to recv, 1039 // use isolate thread to recv,
1038 // @see: https://github.com/ossrs/srs/issues/237 1040 // @see: https://github.com/ossrs/srs/issues/237
1039 SrsPublishRecvThread trd(rtmp, req, 1041 SrsPublishRecvThread trd(rtmp, req,
1040 - st_netfd_fileno(stfd), 0, this, source, true, vhost_is_edge); 1042 + st_netfd_fileno(stfd), 0, this, source,
  1043 + client_type == SrsRtmpConnFMLEPublish,
  1044 + vhost_is_edge);
1041 1045
1042 srs_info("start to publish stream %s success", req->stream.c_str()); 1046 srs_info("start to publish stream %s success", req->stream.c_str());
1043 ret = do_publishing(source, &trd); 1047 ret = do_publishing(source, &trd);
@@ -35,6 +35,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -35,6 +35,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35 #include <srs_app_st.hpp> 35 #include <srs_app_st.hpp>
36 #include <srs_app_conn.hpp> 36 #include <srs_app_conn.hpp>
37 #include <srs_app_reload.hpp> 37 #include <srs_app_reload.hpp>
  38 +#include <srs_rtmp_stack.hpp>
38 39
39 class SrsServer; 40 class SrsServer;
40 class SrsRtmpServer; 41 class SrsRtmpServer;
@@ -150,6 +151,8 @@ private: @@ -150,6 +151,8 @@ private:
150 int publish_normal_timeout; 151 int publish_normal_timeout;
151 // whether enable the tcp_nodelay. 152 // whether enable the tcp_nodelay.
152 bool tcp_nodelay; 153 bool tcp_nodelay;
  154 + // The type of client, play or publish.
  155 + SrsRtmpConnType client_type;
153 public: 156 public:
154 SrsRtmpConn(SrsServer* svr, st_netfd_t c, std::string cip); 157 SrsRtmpConn(SrsServer* svr, st_netfd_t c, std::string cip);
155 virtual ~SrsRtmpConn(); 158 virtual ~SrsRtmpConn();