From df35f75df1b1fa2c1ffedb24f637a6ef1430baa7 Mon Sep 17 00:00:00 2001 From: winlin Date: Tue, 18 Nov 2014 17:55:38 +0800 Subject: [PATCH] refine response call, 2.0.24 --- trunk/src/app/srs_app_rtmp_conn.cpp | 20 +++++++++++--------- trunk/src/core/srs_core.hpp | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/trunk/src/app/srs_app_rtmp_conn.cpp b/trunk/src/app/srs_app_rtmp_conn.cpp index 165fa0eee..8b6304fa7 100644 --- a/trunk/src/app/srs_app_rtmp_conn.cpp +++ b/trunk/src/app/srs_app_rtmp_conn.cpp @@ -922,15 +922,17 @@ int SrsRtmpConn::process_play_control_msg(SrsConsumer* consumer, SrsMessage* msg // @see https://github.com/winlinvip/simple-rtmp-server/issues/106 // TODO: FIXME: response in right way, or forward in edge mode. SrsCallPacket* call = dynamic_cast(pkt); - // only response it when transaction id not zero, - // for the zero means donot need response. - if (call && call->transaction_id > 0) { - SrsCallResPacket* res = new SrsCallResPacket(call->transaction_id); - res->command_object = SrsAmf0Any::null(); - res->response = SrsAmf0Any::null(); - if ((ret = rtmp->send_and_free_packet(res, 0)) != ERROR_SUCCESS) { - srs_warn("response call failed. ret=%d", ret); - return ret; + if (call) { + // only response it when transaction id not zero, + // for the zero means donot need response. + if (call->transaction_id > 0) { + SrsCallResPacket* res = new SrsCallResPacket(call->transaction_id); + res->command_object = SrsAmf0Any::null(); + res->response = SrsAmf0Any::null(); + if ((ret = rtmp->send_and_free_packet(res, 0)) != ERROR_SUCCESS) { + srs_warn("response call failed. ret=%d", ret); + return ret; + } } return ret; } diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 274a50761..7f454aaa7 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 23 +#define VERSION_REVISION 24 // server info. #define RTMP_SIG_SRS_KEY "SRS" #define RTMP_SIG_SRS_ROLE "origin/edge server"