ignore "checkBandwidth" and "_checkbw" command,don't treat them as republish
正在显示
3 个修改的文件
包含
10 行增加
和
1 行删除
| @@ -1225,6 +1225,9 @@ int SrsRtmpConn::handle_publish_message(SrsSource* source, SrsCommonMessage* msg | @@ -1225,6 +1225,9 @@ int SrsRtmpConn::handle_publish_message(SrsSource* source, SrsCommonMessage* msg | ||
| 1225 | srs_error("fmle decode unpublish message failed. ret=%d", ret); | 1225 | srs_error("fmle decode unpublish message failed. ret=%d", ret); |
| 1226 | return ret; | 1226 | return ret; |
| 1227 | } | 1227 | } |
| 1228 | + if(NULL == pkt){ | ||
| 1229 | + return ret;//ignored packets,don't do republish | ||
| 1230 | + } | ||
| 1228 | SrsAutoFree(SrsPacket, pkt); | 1231 | SrsAutoFree(SrsPacket, pkt); |
| 1229 | 1232 | ||
| 1230 | // for flash, any packet is republish. | 1233 | // for flash, any packet is republish. |
| @@ -844,7 +844,11 @@ int SrsProtocol::do_decode_message(SrsMessageHeader& header, SrsBuffer* stream, | @@ -844,7 +844,11 @@ int SrsProtocol::do_decode_message(SrsMessageHeader& header, SrsBuffer* stream, | ||
| 844 | srs_info("decode the AMF0/AMF3 closeStream message."); | 844 | srs_info("decode the AMF0/AMF3 closeStream message."); |
| 845 | *ppacket = packet = new SrsCloseStreamPacket(); | 845 | *ppacket = packet = new SrsCloseStreamPacket(); |
| 846 | return packet->decode(stream); | 846 | return packet->decode(stream); |
| 847 | - } else if (header.is_amf0_command() || header.is_amf3_command()) { | 847 | + }else if (command == RTMP_AMF0_COMMAND_CHECKBANDWIDTH || command == RTMP_AMF0_COMMAND_CHECKBW) { |
| 848 | + //todo: process check bandwidth command,now drop it | ||
| 849 | + return ret; | ||
| 850 | + } | ||
| 851 | + else if (header.is_amf0_command() || header.is_amf3_command()) { | ||
| 848 | srs_info("decode the AMF0/AMF3 call message."); | 852 | srs_info("decode the AMF0/AMF3 call message."); |
| 849 | *ppacket = packet = new SrsCallPacket(); | 853 | *ppacket = packet = new SrsCallPacket(); |
| 850 | return packet->decode(stream); | 854 | return packet->decode(stream); |
| @@ -91,6 +91,8 @@ class IMergeReadHandler; | @@ -91,6 +91,8 @@ class IMergeReadHandler; | ||
| 91 | #define RTMP_AMF0_COMMAND_PUBLISH "publish" | 91 | #define RTMP_AMF0_COMMAND_PUBLISH "publish" |
| 92 | #define RTMP_AMF0_DATA_SAMPLE_ACCESS "|RtmpSampleAccess" | 92 | #define RTMP_AMF0_DATA_SAMPLE_ACCESS "|RtmpSampleAccess" |
| 93 | 93 | ||
| 94 | +#define RTMP_AMF0_COMMAND_CHECKBANDWIDTH "checkBandwidth" | ||
| 95 | +#define RTMP_AMF0_COMMAND_CHECKBW "_checkbw" | ||
| 94 | /** | 96 | /** |
| 95 | * the signature for packets to client. | 97 | * the signature for packets to client. |
| 96 | */ | 98 | */ |
-
请 注册 或 登录 后发表评论