Just in case...
This is the resulting patch which is working for us.
LGPL.

With respect,
Max

On 12/08/2015 10:21 AM, Ross Finlayson wrote:
> Thanks for the suggestion, but right now I’m not planning on making such a 
> change to the supplied server code, because this functionality is unlikely to 
> be used very much.
>
> So for now you should just modify your own copy of the code, subject - as 
> always - to the LGPL:
>       http://live555.com/liveMedia/faq.html#copyright-and-license
>
>
> Ross Finlayson
> Live Networks, Inc.
> http://www.live555.com/
>
>
> _______________________________________________
> live-devel mailing list
> live-devel@lists.live555.com
> http://lists.live555.com/mailman/listinfo/live-devel

http://lists.live555.com/pipermail/live-devel/2015-December/019794.html

[Live-devel] RTSP response status codes: 403 Forbidden
Maxim P. DEMENTIEV maxim.dementiev at nexvision.fr
Tue Dec 8 00:50:08 PST 2015

Index: live/liveMedia/RTSPServer.cpp
===================================================================
--- live.orig/liveMedia/RTSPServer.cpp
+++ live/liveMedia/RTSPServer.cpp
@@ -211,6 +211,12 @@ Boolean RTSPServer
   return True;
 }
 
+const char * RTSPServer
+::specialClientAccessCheck_ext(int clientSocket, struct sockaddr_in& clientAddr, char const* urlSuffix) {
+  // default implementation
+  return specialClientAccessCheck(clientSocket, clientAddr, urlSuffix) ? NULL : "401 Unauthorized";
+}
+
 RTSPServer::RTSPServer(UsageEnvironment& env,
 		       int ourSocket, Port ourPort,
 		       UserAuthenticationDatabase* authDatabase,
@@ -917,8 +923,8 @@ static Boolean parseAuthorizationHeader(
 Boolean RTSPServer::RTSPClientConnection
 ::authenticationOK(char const* cmdName, char const* urlSuffix, char const* fullRequestStr) {
 
-  if (!fOurServer.specialClientAccessCheck(fClientInputSocket, fClientAddr, urlSuffix)) {
-    setRTSPResponse("401 Unauthorized");
+  if (const char * resp = fOurServer.specialClientAccessCheck_ext(fClientInputSocket, fClientAddr, urlSuffix)) {
+    setRTSPResponse(resp);
     return False;
   }
 
Index: live/liveMedia/include/RTSPServer.hh
===================================================================
--- live.orig/liveMedia/include/RTSPServer.hh
+++ live/liveMedia/include/RTSPServer.hh
@@ -136,6 +136,8 @@ protected:
       // a hook that allows subclassed servers to do server-specific access checking
       // on each client (e.g., based on client IP address), without using
       // digest authentication.
+  virtual const char * specialClientAccessCheck_ext(int clientSocket, struct sockaddr_in& clientAddr,
+					   char const* urlSuffix);
 
 private: // redefined virtual functions
   virtual Boolean isRTSPServer() const;
_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to