SetAuthentication() public méthode

public SetAuthentication ( string wwwAuthenticateHeader, string userName, string password ) : bool
wwwAuthenticateHeader string
userName string
password string
Résultat bool
 private bool HandleRTSPResponse(RtspProtocol rtspProtocol, Variant requestHeaders,ref string requestContent, Variant responseHeaders,ref string responseContent)
 {
     switch ((uint)responseHeaders[RTSP_FIRST_LINE, RTSP_STATUS_CODE])
     {
         case 200:
             switch ((string)requestHeaders[RTSP_FIRST_LINE,RTSP_METHOD])
             {
                 case RTSP_METHOD_OPTIONS:
                     return HandleRTSPResponse200Options(rtspProtocol,requestHeaders,ref requestContent, responseHeaders,ref responseContent);
                 case RTSP_METHOD_DESCRIBE:
                     return HandleRTSPResponse200Describe(rtspProtocol, requestHeaders, ref requestContent, responseHeaders, ref responseContent);
                 case RTSP_METHOD_SETUP:
                     return HandleRTSPResponse200Setup(rtspProtocol, requestHeaders, ref requestContent, responseHeaders, ref responseContent);
                 case RTSP_METHOD_PLAY:
                     return HandleRTSPResponse200Play(rtspProtocol, requestHeaders, ref requestContent, responseHeaders, ref responseContent);
                 case RTSP_METHOD_ANNOUNCE:
                     return HandleRTSPResponse200Announce(rtspProtocol, requestHeaders, ref requestContent, responseHeaders, ref responseContent);
                 case RTSP_METHOD_RECORD:
                     return HandleRTSPResponse200Record(rtspProtocol, requestHeaders, ref requestContent, responseHeaders, ref responseContent);
                 case RTSP_METHOD_TEARDOWN:
                     return true;
                 default:
                     return false;
             }
         case 401:
             var username = rtspProtocol.CustomParameters["uri", "userName"];
             var password = rtspProtocol.CustomParameters["uri", "password"];
             if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password))
             {
                 FATAL("No username/password provided");
                 return false;
             }
             string auth = responseHeaders[RTSP_HEADERS, HTTP_HEADERS_WWWAUTHENTICATE];
             if (string.IsNullOrEmpty(auth))
             {
                 FATAL("Invalid 401 response: {0}", (responseHeaders.ToString()));
                 return false;
             }
             if (!rtspProtocol.SetAuthentication(auth, username, password))
             {
                 FATAL("Unable to authenticate: request headers:\n{0}\nresponseHeaders:\n{1}",
         (requestHeaders.ToString()),
         (responseHeaders.ToString()));
                 return false;
             }
             return true;
         case 404:
             switch ((string)requestHeaders[RTSP_FIRST_LINE, RTSP_METHOD])
             {
                 case RTSP_METHOD_PLAY:
                     FATAL("PLAY: Resource not found: "+(requestHeaders[RTSP_FIRST_LINE][RTSP_URL]));
                     return false;
                 case RTSP_METHOD_DESCRIBE:
                     FATAL("DESCRIBE: Resource not found: "+(requestHeaders[RTSP_FIRST_LINE][RTSP_URL]));
                     return false;
                 default:
                     FATAL("Response for method {0} not implemented yet\n{1}", ((string)requestHeaders[RTSP_FIRST_LINE, RTSP_METHOD]),
         (responseHeaders.ToString()));
                     return false;
             }
         default:
             return false;
     }
 }