Fix issue with non-blocking I/O & record splitting
This commit is contained in:
parent
d5746b36f9
commit
a852cf4833
@ -4846,19 +4846,16 @@ int ssl_write( ssl_context *ssl, const unsigned char *buf, size_t len )
|
||||
return( ssl_write_real( ssl, buf, len ) );
|
||||
}
|
||||
|
||||
if( ssl->split_done != 1 )
|
||||
if( ssl->split_done == 0 )
|
||||
{
|
||||
ssl->split_done = 1;
|
||||
if( ( ret = ssl_write_real( ssl, buf, 1 ) ) < 0 )
|
||||
if( ( ret = ssl_write_real( ssl, buf, 1 ) ) <= 0 )
|
||||
return( ret );
|
||||
ssl->split_done = 1;
|
||||
}
|
||||
|
||||
if( ssl->split_done == 1 )
|
||||
{
|
||||
ssl->split_done = 0;
|
||||
if( ( ret = ssl_write_real( ssl, buf + 1, len - 1 ) ) < 0 )
|
||||
return( ret );
|
||||
}
|
||||
if( ( ret = ssl_write_real( ssl, buf + 1, len - 1 ) ) <= 0 )
|
||||
return( ret );
|
||||
ssl->split_done = 0;
|
||||
|
||||
return( ret + 1 );
|
||||
}
|
||||
|
@ -718,6 +718,15 @@ run_test "CBC Record splitting: TLS 1.0, splitting disabled" \
|
||||
-S "Read from client: 1 bytes read" \
|
||||
-S "122 bytes read"
|
||||
|
||||
run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \
|
||||
"$P_SRV nbio=2" \
|
||||
"$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \
|
||||
request_size=123 force_version=tls1" \
|
||||
0 \
|
||||
-S "Read from client: 123 bytes read" \
|
||||
-s "Read from client: 1 bytes read" \
|
||||
-s "122 bytes read"
|
||||
|
||||
# Tests for Session Tickets
|
||||
|
||||
run_test "Session resume using tickets: basic" \
|
||||
|
Loading…
Reference in New Issue
Block a user