From cee8c3d07d3b866e14e6144ec2ea3e5970a2883b Mon Sep 17 00:00:00 2001 From: winlin Date: Tue, 22 Dec 2015 15:39:12 +0800 Subject: [PATCH] fix #541, failed when chunk size too small. 2.0.202 --- README.md | 2 ++ trunk/src/core/srs_core.hpp | 2 +- trunk/src/protocol/srs_rtmp_stack.cpp | 11 +++++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1ae751434..5b285fe79 100755 --- a/README.md +++ b/README.md @@ -337,6 +337,7 @@ Remark: ## History +* v2.0, 2015-12-22, for [#541][bug #541] failed when chunk size too small. 2.0.202 * v2.0, 2015-12-15, default hls_on_error to continue. 2.0.201 * v2.0, 2015-11-16, for [#518][bug #518] fix fd leak bug when fork. 2.0.200 * v2.0, 2015-11-05, for [#511][bug #511] fix bug for restart thread. 2.0.199 @@ -1207,6 +1208,7 @@ Winlin [bug #515]: https://github.com/ossrs/srs/issues/515 [bug #511]: https://github.com/ossrs/srs/issues/511 [bug #518]: https://github.com/ossrs/srs/issues/518 +[bug #541]: https://github.com/ossrs/srs/issues/541 [bug #xxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxx [exo #828]: https://github.com/google/ExoPlayer/pull/828 diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 1c16f7f9d..575b33cb6 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // current release version #define VERSION_MAJOR 2 #define VERSION_MINOR 0 -#define VERSION_REVISION 201 +#define VERSION_REVISION 202 // server info. #define RTMP_SIG_SRS_KEY "SRS" diff --git a/trunk/src/protocol/srs_rtmp_stack.cpp b/trunk/src/protocol/srs_rtmp_stack.cpp index aac2d8e73..049f2eba6 100644 --- a/trunk/src/protocol/srs_rtmp_stack.cpp +++ b/trunk/src/protocol/srs_rtmp_stack.cpp @@ -1514,10 +1514,17 @@ int SrsProtocol::on_recv_message(SrsCommonMessage* msg) { srs_warn("accept chunk size %d, but should in [%d, %d], " "@see: https://github.com/ossrs/srs/issues/160", - pkt->chunk_size, SRS_CONSTS_RTMP_MIN_CHUNK_SIZE, - SRS_CONSTS_RTMP_MAX_CHUNK_SIZE); + pkt->chunk_size, SRS_CONSTS_RTMP_MIN_CHUNK_SIZE, SRS_CONSTS_RTMP_MAX_CHUNK_SIZE); } + // @see: https://github.com/ossrs/srs/issues/541 + if (pkt->chunk_size < SRS_CONSTS_RTMP_MIN_CHUNK_SIZE) { + ret = ERROR_RTMP_CHUNK_SIZE; + srs_error("chunk size should be %d+, value=%d. ret=%d", + SRS_CONSTS_RTMP_MIN_CHUNK_SIZE, pkt->chunk_size, ret); + return ret; + } + in_chunk_size = pkt->chunk_size; srs_trace("input chunk size to %d", pkt->chunk_size);