mirror of
				https://github.com/ossrs/srs.git
				synced 2025-03-09 15:49:59 +00:00 
			
		
		
		
	RTC: Refine code
This commit is contained in:
		
							parent
							
								
									92b59e308c
								
							
						
					
					
						commit
						761c880e55
					
				
					 2 changed files with 13 additions and 10 deletions
				
			
		| 
						 | 
				
			
			@ -259,7 +259,7 @@ SrsDtls::SrsDtls(ISrsDtlsCallback* cb)
 | 
			
		|||
    version_ = SrsDtlsVersionAuto;
 | 
			
		||||
 | 
			
		||||
    trd = NULL;
 | 
			
		||||
    client_state_ = SrsDtlsStateInit;
 | 
			
		||||
    state_ = SrsDtlsStateInit;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SrsDtls::~SrsDtls()
 | 
			
		||||
| 
						 | 
				
			
			@ -409,8 +409,11 @@ srs_error_t SrsDtls::on_dtls(char* data, int nb_data)
 | 
			
		|||
{
 | 
			
		||||
    srs_error_t err = srs_success;
 | 
			
		||||
 | 
			
		||||
    // When got packet, always stop the ARQ.
 | 
			
		||||
    if (role_ == SrsDtlsRoleClient && client_state_ == SrsDtlsStateServerHello) {
 | 
			
		||||
    // When got packet, stop the ARQ if server in the first ARQ state SrsDtlsStateServerHello.
 | 
			
		||||
    // @note But for ARQ state, we should never stop the ARQ, for example, we are in the second ARQ sate
 | 
			
		||||
    //      SrsDtlsStateServerDone, but we got previous late wrong packet ServeHello, which is not the expect
 | 
			
		||||
    //      packet SessionNewTicket, we should never stop the ARQ thread.
 | 
			
		||||
    if (role_ == SrsDtlsRoleClient && state_ == SrsDtlsStateServerHello) {
 | 
			
		||||
        stop_arq();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue