Skip to content

Simplify SSL_set_mode() calls #7444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions ext/openssl/xp_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1758,7 +1758,7 @@ int php_openssl_setup_crypto(php_stream *stream,
}

#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

if (cparam->inputs.session) {
Expand Down Expand Up @@ -1861,14 +1861,7 @@ static int php_openssl_enable_crypto(php_stream *stream,
sslsock->s.is_blocked = 0;
/* 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 */
SSL_set_mode(
sslsock->ssl_handle,
(
SSL_get_mode(sslsock->ssl_handle) |
SSL_MODE_ENABLE_PARTIAL_WRITE |
SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER
)
);
SSL_set_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;
Expand Down