winlin

Merge branch '2.0release' into develop

@@ -403,6 +403,7 @@ Remark: @@ -403,6 +403,7 @@ Remark:
403 ======= 403 =======
404 ## History 404 ## History
405 405
  406 +* v2.0, 2016-09-01, workaround [bug #511] the fly stfd in close. 2.0.211
406 * v2.0, 2016-08-30, comment the pcr. 407 * v2.0, 2016-08-30, comment the pcr.
407 * v2.0, 2016-08-18, fix [srs-librtmp#4](https://github.com/ossrs/srs-librtmp/issues/4) filter frame. 408 * v2.0, 2016-08-18, fix [srs-librtmp#4](https://github.com/ossrs/srs-librtmp/issues/4) filter frame.
408 * v2.0, 2016-08-10, fix socket timeout for librtmp. 409 * v2.0, 2016-08-10, fix socket timeout for librtmp.
@@ -1312,6 +1313,7 @@ Winlin @@ -1312,6 +1313,7 @@ Winlin
1312 [bug #546]: https://github.com/ossrs/srs/issues/546 1313 [bug #546]: https://github.com/ossrs/srs/issues/546
1313 [bug #418]: https://github.com/ossrs/srs/issues/418 1314 [bug #418]: https://github.com/ossrs/srs/issues/418
1314 [bug #509]: https://github.com/ossrs/srs/issues/509 1315 [bug #509]: https://github.com/ossrs/srs/issues/509
  1316 +[bug #511]: https://github.com/ossrs/srs/issues/511
1315 [bug #xxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxx 1317 [bug #xxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxx
1316 1318
1317 [exo #828]: https://github.com/google/ExoPlayer/pull/828 1319 [exo #828]: https://github.com/google/ExoPlayer/pull/828
@@ -479,8 +479,11 @@ int SrsRtmpConn::on_reload_vhost_removed(string vhost) @@ -479,8 +479,11 @@ int SrsRtmpConn::on_reload_vhost_removed(string vhost)
479 // if the vhost connected is removed, disconnect the client. 479 // if the vhost connected is removed, disconnect the client.
480 srs_trace("vhost %s removed/disabled, close client url=%s", 480 srs_trace("vhost %s removed/disabled, close client url=%s",
481 vhost.c_str(), req->get_stream_url().c_str()); 481 vhost.c_str(), req->get_stream_url().c_str());
482 -  
483 - srs_close_stfd(stfd); 482 +
  483 + // should never close the fd in another thread,
  484 + // one fd should managed by one thread, we should use interrupt instead.
  485 + // so we just ignore the vhost enabled event.
  486 + //srs_close_stfd(stfd);
484 487
485 return ret; 488 return ret;
486 } 489 }
@@ -564,13 +564,9 @@ int srs_st_init() @@ -564,13 +564,9 @@ int srs_st_init()
564 void srs_close_stfd(st_netfd_t& stfd) 564 void srs_close_stfd(st_netfd_t& stfd)
565 { 565 {
566 if (stfd) { 566 if (stfd) {
567 - int fd = st_netfd_fileno(stfd);  
568 - st_netfd_close(stfd);  
569 - stfd = NULL;  
570 -  
571 - // st does not close it sometimes,  
572 - // close it manually.  
573 - close(fd); 567 + // we must ensure the close is ok.
  568 + int err = st_netfd_close(stfd);
  569 + srs_assert(err != -1);
574 } 570 }
575 } 571 }
576 572
@@ -254,6 +254,7 @@ public: @@ -254,6 +254,7 @@ public:
254 extern int srs_st_init(); 254 extern int srs_st_init();
255 255
256 // close the netfd, and close the underlayer fd. 256 // close the netfd, and close the underlayer fd.
  257 +// @remark when close, user must ensure io completed.
257 extern void srs_close_stfd(st_netfd_t& stfd); 258 extern void srs_close_stfd(st_netfd_t& stfd);
258 259
259 #endif 260 #endif
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 // current release version 31 // current release version
32 #define VERSION_MAJOR 3 32 #define VERSION_MAJOR 3
33 #define VERSION_MINOR 0 33 #define VERSION_MINOR 0
34 -#define VERSION_REVISION 210 34 +#define VERSION_REVISION 211
35 35
36 // generated by configure, only macros. 36 // generated by configure, only macros.
37 #include <srs_auto_headers.hpp> 37 #include <srs_auto_headers.hpp>