Skip to content

Commit 0f45f09

Browse files
committed
CDRIVER-1409 openssl_check_closed was always true
BIO_get_shutdown doesn't do what I thought: it doesn't check whether the socket has been closed, it returns the state of a config flag, which was always true. Caused /Client/exhaust_cursor/single tests to fail with "error: connection closed". It was only this test that failed because the driver only calls check_closed in single-client mode on a socket idle for 1 second, and only since #3c81f4f6 does this test pause a full second.
1 parent 003623e commit 0f45f09

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

src/mongoc/mongoc-stream-tls-openssl.c

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,6 @@ BIO_meth_free(BIO_METHOD *meth)
4949
{
5050
/* Nothing to free pre OpenSSL 1.1.0 */
5151
}
52-
53-
static int
54-
BIO_get_shutdown (BIO *bio)
55-
{
56-
return bio->shutdown;
57-
}
5852
#endif
5953

6054

@@ -527,20 +521,9 @@ _mongoc_stream_tls_openssl_get_base_stream (mongoc_stream_t *stream)
527521
static bool
528522
_mongoc_stream_tls_openssl_check_closed (mongoc_stream_t *stream) /* IN */
529523
{
530-
mongoc_stream_tls_t *tls;
531-
mongoc_stream_tls_openssl_t *openssl;
532-
533-
ENTRY;
524+
mongoc_stream_tls_t *tls = (mongoc_stream_tls_t *)stream;
534525
BSON_ASSERT (stream);
535-
536-
tls = (mongoc_stream_tls_t *) stream;
537-
openssl = (mongoc_stream_tls_openssl_t *) tls->ctx;
538-
539-
if (BIO_get_shutdown (openssl->bio)) {
540-
RETURN (true);
541-
}
542-
543-
RETURN (mongoc_stream_check_closed (tls->base_stream));
526+
return mongoc_stream_check_closed (tls->base_stream);
544527
}
545528

546529

0 commit comments

Comments
 (0)