mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-10-30 16:27:36 +08:00
完善代码
This commit is contained in:
parent
98f8024409
commit
6c97338712
@ -83,7 +83,7 @@ extern const char kBroadcastHttpRequest[];
|
||||
|
||||
//该流是否需要认证?是的话调用invoker并传入realm,否则传入空的realm.如果该事件不监听则不认证
|
||||
extern const char kBroadcastOnGetRtspRealm[];
|
||||
#define BroadcastOnGetRtspRealmArgs const string &app,const string &stream,const RtspSession::onGetRealm &invoker,TcpSession &sender
|
||||
#define BroadcastOnGetRtspRealmArgs const MediaInfo &args,const RtspSession::onGetRealm &invoker,TcpSession &sender
|
||||
|
||||
//请求认证用户密码事件,user_name为用户名,must_no_encrypt如果为true,则必须提供明文密码(因为此时是base64认证方式),否则会导致认证失败
|
||||
//获取到密码后请调用invoker并输入对应类型的密码和密码类型,invoker执行时会匹配密码
|
||||
|
@ -226,8 +226,7 @@ bool RtspSession::handleReq_Describe() {
|
||||
|
||||
//广播是否需要认证事件
|
||||
if(!NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastOnGetRtspRealm,
|
||||
m_mediaInfo.m_app,
|
||||
m_mediaInfo.m_streamid,
|
||||
m_mediaInfo,
|
||||
invoker,
|
||||
*this)){
|
||||
//无人监听此事件,说明无需认证
|
||||
|
@ -64,7 +64,7 @@ using namespace ZL::Network;
|
||||
|
||||
static onceToken s_token([](){
|
||||
NoticeCenter::Instance().addListener(nullptr,Config::Broadcast::kBroadcastOnGetRtspRealm,[](BroadcastOnGetRtspRealmArgs){
|
||||
if(string("1") == stream ){
|
||||
if(string("1") == args.m_streamid ){
|
||||
// live/1需要认证
|
||||
EventPoller::Instance().async([invoker](){
|
||||
//该流需要认证,并且设置realm
|
||||
|
Loading…
Reference in New Issue
Block a user