Implement xop::Authenticator::GetFailedResponse to return a 401

This commit is contained in:
Isaac Connor 2021-03-11 11:45:39 -05:00
parent 874e61d681
commit f2553220b6
2 changed files with 10 additions and 2 deletions

@ -1 +1 @@
Subproject commit 75c20b450fdf00c120b9a917f48abd96095b665b Subproject commit 20846b25ffc0c9a1de1b6701ca99425ef39e9f3f

View File

@ -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