when auth is needed, try command again before dying.

pull/739/head
Isaac Connor 2015-03-02 10:47:52 -05:00
parent 0346aab075
commit 084e2a8b8f
1 changed files with 13 additions and 2 deletions

View File

@ -340,8 +340,19 @@ int RtspThread::run()
message = "OPTIONS "+mUrl+" RTSP/1.0\r\n";
if ( !sendCommand( message ) )
return( -1 );
if ( !recvResponse( response ) )
return( -1 );
// A negative return here may indicate auth failure, but we will have setup the auth mechanisms so we need to retry.
if ( !recvResponse( response ) ) {
if ( mNeedAuth ) {
Debug( 2, "Resending OPTIONS due to possible auth requirement" );
if ( !sendCommand( message ) )
return( -1 );
if ( !recvResponse( response ) )
return( -1 );
} else {
return( -1 );
}
} // end if failed response maybe due to auth
char publicLine[256] = "";
StringVector lines = split( response, "\r\n" );