mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Simplify SSL_set_mode() calls (#7444)
SSL_set_mode() adds the mode set via bitmask in mode to ssl.
This commit is contained in:
parent
a13730c5e4
commit
aa893c4a71
1 changed files with 2 additions and 9 deletions
|
@ -1758,7 +1758,7 @@ int php_openssl_setup_crypto(php_stream *stream,
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SSL_MODE_RELEASE_BUFFERS
|
#ifdef SSL_MODE_RELEASE_BUFFERS
|
||||||
SSL_set_mode(sslsock->ssl_handle, SSL_get_mode(sslsock->ssl_handle) | SSL_MODE_RELEASE_BUFFERS);
|
SSL_set_mode(sslsock->ssl_handle, SSL_MODE_RELEASE_BUFFERS);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (cparam->inputs.session) {
|
if (cparam->inputs.session) {
|
||||||
|
@ -1861,14 +1861,7 @@ static int php_openssl_enable_crypto(php_stream *stream,
|
||||||
sslsock->s.is_blocked = 0;
|
sslsock->s.is_blocked = 0;
|
||||||
/* The following mode are added only if we are able to change socket
|
/* The following mode are added only if we are able to change socket
|
||||||
* to non blocking mode which is also used for read and write */
|
* to non blocking mode which is also used for read and write */
|
||||||
SSL_set_mode(
|
SSL_set_mode(sslsock->ssl_handle, SSL_MODE_ENABLE_PARTIAL_WRITE | SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
|
||||||
sslsock->ssl_handle,
|
|
||||||
(
|
|
||||||
SSL_get_mode(sslsock->ssl_handle) |
|
|
||||||
SSL_MODE_ENABLE_PARTIAL_WRITE |
|
|
||||||
SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
timeout = sslsock->is_client ? &sslsock->connect_timeout : &sslsock->s.timeout;
|
timeout = sslsock->is_client ? &sslsock->connect_timeout : &sslsock->s.timeout;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue