mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-03 20:22:59 -05:00 
			
		
		
		
	Move call to ssl_consume_current_message()
Subsequent commits will potentially inject buffered messages after the last incoming message has been consumed, but before a new one is fetched. As a preparatory step to this, this commit moves the call to ssl_consume_current_message() from ssl_read_record_layer() to the calling function mbedtls_ssl_read_record().
This commit is contained in:
		
							parent
							
								
									1097b34022
								
							
						
					
					
						commit
						2699459529
					
				@ -4299,6 +4299,10 @@ int mbedtls_ssl_read_record( mbedtls_ssl_context *ssl,
 | 
			
		||||
    {
 | 
			
		||||
        do {
 | 
			
		||||
 | 
			
		||||
            ret = ssl_consume_current_message( ssl );
 | 
			
		||||
            if( ret != 0 )
 | 
			
		||||
                return( ret );
 | 
			
		||||
 | 
			
		||||
            ret = ssl_read_record_layer( ssl );
 | 
			
		||||
            if( ret == MBEDTLS_ERR_SSL_CONTINUE_PROCESSING )
 | 
			
		||||
                continue;
 | 
			
		||||
@ -4429,22 +4433,7 @@ static int ssl_read_record_layer( mbedtls_ssl_context *ssl )
 | 
			
		||||
    int ret;
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * Step A
 | 
			
		||||
     *
 | 
			
		||||
     * Consume last content-layer message and potentially
 | 
			
		||||
     * update in_msglen which keeps track of the contents'
 | 
			
		||||
     * consumption state.
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    ret = ssl_consume_current_message( ssl );
 | 
			
		||||
    if( ret != 0 )
 | 
			
		||||
        return( ret );
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * Step B
 | 
			
		||||
     *
 | 
			
		||||
     * Fetch and decode new record if current one is fully consumed.
 | 
			
		||||
     *
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    if( ssl->in_msglen > 0 )
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user