1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

merge from srs2

This commit is contained in:
winlin 2015-12-22 17:01:06 +08:00
commit 65b81a4e68
3 changed files with 24 additions and 3 deletions

View file

@ -3300,9 +3300,24 @@ int SrsConnectAppResPacket::decode(SrsBuffer* 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) {