限制rtsp/rtmp推流url合法性

This commit is contained in:
xiongziliang
2020-05-25 16:40:41 +08:00
parent 5ae887a279
commit 68d910e229
2 changed files with 12 additions and 0 deletions

View File

@@ -158,6 +158,12 @@ void RtmpSession::onCmd_publish(AMFDecoder &dec) {
setSocketFlags();
};
if(_mediaInfo._app.empty() || _mediaInfo._streamid.empty()){
//不允许莫名其妙的推流url
onRes("rtmp推流url非法", false, false, false);
return;
}
Broadcast::PublishAuthInvoker invoker = [weakSelf,onRes,pToken](const string &err,bool enableRtxp,bool enableHls,bool enableMP4){
auto strongSelf = weakSelf.lock();
if(!strongSelf){