Implement xop::Authenticator::GetFailedResponse to return a 401
This commit is contained in:
parent
874e61d681
commit
f2553220b6
|
@ -1 +1 @@
|
||||||
Subproject commit 75c20b450fdf00c120b9a917f48abd96095b665b
|
Subproject commit 20846b25ffc0c9a1de1b6701ca99425ef39e9f3f
|
|
@ -17,7 +17,7 @@ class ZM_RtspServer_Authenticator : public xop::Authenticator {
|
||||||
ZM_RtspServer_Authenticator() {};
|
ZM_RtspServer_Authenticator() {};
|
||||||
~ZM_RtspServer_Authenticator() {};
|
~ZM_RtspServer_Authenticator() {};
|
||||||
|
|
||||||
virtual bool Authenticate(std::shared_ptr<xop::RtspRequest> request, std::string &nonce) {
|
bool Authenticate(std::shared_ptr<xop::RtspRequest> request, std::string &nonce) {
|
||||||
|
|
||||||
if (!config.opt_use_auth) {
|
if (!config.opt_use_auth) {
|
||||||
Debug(1, "Not doing auth");
|
Debug(1, "Not doing auth");
|
||||||
|
@ -77,6 +77,14 @@ class ZM_RtspServer_Authenticator : public xop::Authenticator {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t GetFailedResponse(
|
||||||
|
std::shared_ptr<xop::RtspRequest> request,
|
||||||
|
std::shared_ptr<char> buf,
|
||||||
|
size_t size) {
|
||||||
|
return request->BuildUnauthorizedRes(buf.get(), size);
|
||||||
|
}
|
||||||
|
|
||||||
}; // end class ZM_RtspServer_Authenticator
|
}; // end class ZM_RtspServer_Authenticator
|
||||||
|
|
||||||
#endif // HAVE_RTSP_SERVER
|
#endif // HAVE_RTSP_SERVER
|
||||||
|
|
Loading…
Reference in New Issue