Skip to content

Commit

Permalink
Support BoringSSL as well as OpenSSL (#312)
Browse files Browse the repository at this point in the history
In BoringSSL this is defined as 0 in order to disable this.  In
OpenSSL this is a non-zero value.  So a simple #if check supports both
of these.
  • Loading branch information
flub authored and dinhvh committed Nov 10, 2018
1 parent ee87746 commit b84742d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/data-types/mailstream_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ static struct mailstream_ssl_data * ssl_data_new_full(int fd, time_t timeout,
SSL_CTX * tmp_ctx;
struct mailstream_cancel * cancel;
struct mailstream_ssl_context * ssl_context = NULL;
#ifdef SSL_MODE_RELEASE_BUFFERS
#if SSL_MODE_RELEASE_BUFFERS
long mode = 0;
#endif

Expand All @@ -459,7 +459,7 @@ static struct mailstream_ssl_data * ssl_data_new_full(int fd, time_t timeout,
SSL_CTX_set_client_cert_cb(tmp_ctx, mailstream_openssl_client_cert_cb);
ssl_conn = (SSL *) SSL_new(tmp_ctx);

#ifdef SSL_MODE_RELEASE_BUFFERS
#if SSL_MODE_RELEASE_BUFFERS
mode = SSL_get_mode(ssl_conn);
SSL_set_mode(ssl_conn, mode | SSL_MODE_RELEASE_BUFFERS);
#endif
Expand Down

0 comments on commit b84742d

Please sign in to comment.