diff --git a/README.md b/README.md index 2ead68451..075ebe014 100755 --- a/README.md +++ b/README.md @@ -337,6 +337,7 @@ Remark: ## History +* v2.0, 2015-12-22, for [#418][bug #418] ignore null connect props to make RED5 happy. 2.0.204 * v2.0, 2015-12-22, for [#546][bug #546] thread terminate normally dispose bug. 2.0.203 * 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 @@ -1211,6 +1212,7 @@ Winlin [bug #518]: https://github.com/ossrs/srs/issues/518 [bug #541]: https://github.com/ossrs/srs/issues/541 [bug #546]: https://github.com/ossrs/srs/issues/546 +[bug #418]: https://github.com/ossrs/srs/issues/418 [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 c747e5839..4033b2f51 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 203 +#define VERSION_REVISION 204 // 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 049f2eba6..0a0f7a5c1 100644 --- a/trunk/src/protocol/srs_rtmp_stack.cpp +++ b/trunk/src/protocol/srs_rtmp_stack.cpp @@ -3289,9 +3289,24 @@ int SrsConnectAppResPacket::decode(SrsStream* stream) ret = ERROR_SUCCESS; } - if ((ret = props->read(stream)) != ERROR_SUCCESS) { - srs_error("amf0 decode connect props failed. ret=%d", ret); - return ret; + // for RED5(1.0.6), the props is NULL, we must ignore it. + // @see https://github.com/ossrs/srs/issues/418 + if (!stream->empty()) { + SrsAmf0Any* p = NULL; + if ((ret = srs_amf0_read_any(stream, &p)) != ERROR_SUCCESS) { + srs_error("amf0 decode connect props failed. ret=%d", ret); + return ret; + } + + // ignore when props is not amf0 object. + if (!p->is_object()) { + srs_warn("ignore connect response props marker=%#x.", (u_int8_t)p->marker); + srs_freep(p); + } else { + srs_freep(props); + props = p->to_object(); + srs_info("accept amf0 object connect response props"); + } } if ((ret = info->read(stream)) != ERROR_SUCCESS) {