mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-03 20:22:59 -05:00 
			
		
		
		
	Address review comments for code-style issues
This commit is contained in:
		
							parent
							
								
									378d64daad
								
							
						
					
					
						commit
						93c6ff2392
					
				@ -2925,23 +2925,27 @@ send_request:
 | 
			
		||||
        opt.serialize = 0;
 | 
			
		||||
        mbedtls_printf( " Serializing live connection..." );
 | 
			
		||||
 | 
			
		||||
        if( ( ret = mbedtls_ssl_context_save( &ssl, NULL, 0, &len) ) != MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL )
 | 
			
		||||
        if( ( ret = mbedtls_ssl_context_save( &ssl, NULL, 0, &len ) )
 | 
			
		||||
                != MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL )
 | 
			
		||||
        {
 | 
			
		||||
            mbedtls_printf( " failed\n  ! mbedtls_ssl_context_save returned -0x%x\n\n", -ret );
 | 
			
		||||
            mbedtls_printf( " failed\n  ! mbedtls_ssl_context_save returned "
 | 
			
		||||
                            "-0x%x\n\n", -ret );
 | 
			
		||||
 | 
			
		||||
            goto exit;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if( ( buf = mbedtls_calloc(1, len) ) == NULL )
 | 
			
		||||
        if( ( buf = mbedtls_calloc( 1, len ) ) == NULL )
 | 
			
		||||
        {
 | 
			
		||||
            mbedtls_printf( " failed\n  ! Couldn't allocate buffer for serialized context" );
 | 
			
		||||
            mbedtls_printf( " failed\n  ! Couldn't allocate buffer for "
 | 
			
		||||
                            "serialized context" );
 | 
			
		||||
 | 
			
		||||
            goto exit;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if( ( ret = mbedtls_ssl_context_save( &ssl, buf, len, &len ) ) != 0 )
 | 
			
		||||
        {
 | 
			
		||||
            mbedtls_printf( "failed\n  ! mbedtls_ssl_context_save returned -0x%x\n\n", -ret );
 | 
			
		||||
            mbedtls_printf( "failed\n  ! mbedtls_ssl_context_save returned "
 | 
			
		||||
                            "-0x%x\n\n", -ret );
 | 
			
		||||
 | 
			
		||||
            goto exit;
 | 
			
		||||
        }
 | 
			
		||||
@ -2950,12 +2954,13 @@ send_request:
 | 
			
		||||
 | 
			
		||||
        if( ( ret = mbedtls_ssl_context_load( &ssl, buf, len ) ) != 0 )
 | 
			
		||||
        {
 | 
			
		||||
            mbedtls_printf( "failed\n  ! mbedtls_ssl_context_load returned -0x%x\n\n", -ret );
 | 
			
		||||
            mbedtls_printf( "failed\n  ! mbedtls_ssl_context_load returned "
 | 
			
		||||
                            "-0x%x\n\n", -ret );
 | 
			
		||||
 | 
			
		||||
            goto exit;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
#endif
 | 
			
		||||
#endif /* MBEDTLS_SSL_CONTEXT_SERIALIZATION */
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * 7d. Continue doing data exchanges?
 | 
			
		||||
 | 
			
		||||
@ -3936,23 +3936,27 @@ data_exchange:
 | 
			
		||||
        opt.serialize = 0;
 | 
			
		||||
        mbedtls_printf( " Serializing live connection..." );
 | 
			
		||||
 | 
			
		||||
        if( ( ret = mbedtls_ssl_context_save( &ssl, NULL, 0, &len) ) != MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL )
 | 
			
		||||
        if( ( ret = mbedtls_ssl_context_save( &ssl, NULL, 0, &len ) )
 | 
			
		||||
                != MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL )
 | 
			
		||||
        {
 | 
			
		||||
            mbedtls_printf( " failed\n  ! mbedtls_ssl_context_save returned -0x%x\n\n", -ret );
 | 
			
		||||
            mbedtls_printf( " failed\n  ! mbedtls_ssl_context_save returned "
 | 
			
		||||
                            "-0x%x\n\n", -ret );
 | 
			
		||||
 | 
			
		||||
            goto exit;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if( ( buf = mbedtls_calloc(1, len) ) == NULL )
 | 
			
		||||
        {
 | 
			
		||||
            mbedtls_printf( " failed\n  ! Couldn't allocate buffer for serialized context" );
 | 
			
		||||
            mbedtls_printf( " failed\n  ! Couldn't allocate buffer for "
 | 
			
		||||
                            "serialized context" );
 | 
			
		||||
 | 
			
		||||
            goto exit;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if( ( ret = mbedtls_ssl_context_save( &ssl, buf, len, &len ) ) != 0 )
 | 
			
		||||
        {
 | 
			
		||||
            mbedtls_printf( "failed\n  ! mbedtls_ssl_context_save returned -0x%x\n\n", -ret );
 | 
			
		||||
            mbedtls_printf( "failed\n  ! mbedtls_ssl_context_save returned "
 | 
			
		||||
                            "-0x%x\n\n", -ret );
 | 
			
		||||
 | 
			
		||||
            goto exit;
 | 
			
		||||
        }
 | 
			
		||||
@ -3961,12 +3965,13 @@ data_exchange:
 | 
			
		||||
 | 
			
		||||
        if( ( ret = mbedtls_ssl_context_load( &ssl, buf, len ) ) != 0 )
 | 
			
		||||
        {
 | 
			
		||||
            mbedtls_printf( "failed\n  ! mbedtls_ssl_context_load returned -0x%x\n\n", -ret );
 | 
			
		||||
            mbedtls_printf( "failed\n  ! mbedtls_ssl_context_load returned "
 | 
			
		||||
                            "-0x%x\n\n", -ret );
 | 
			
		||||
 | 
			
		||||
            goto exit;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
#endif
 | 
			
		||||
#endif /* MBEDTLS_SSL_CONTEXT_SERIALIZATION */
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * 7c. Continue doing data exchanges?
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user