Skip to content

Commit b95d5df

Browse files
committed
CDRIVER-770: BIO_clear_retry_flags()/BIO_set_retry_read() on the BIO we got, not point to
1 parent 2ae1e8b commit b95d5df

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/mongoc/mongoc-stream-tls.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,23 +206,25 @@ _mongoc_stream_tls_bio_read (BIO *b,
206206

207207
BSON_ASSERT (b);
208208
BSON_ASSERT (buf);
209+
ENTRY;
209210

210211
tls = (mongoc_stream_tls_t *)b->ptr;
211212

212213
if (!tls) {
213-
return -1;
214+
RETURN (-1);
214215
}
215216

216217
errno = 0;
217218
ret = (int)mongoc_stream_read (tls->base_stream, buf, len, 0,
218219
tls->timeout_msec);
219-
BIO_clear_retry_flags (tls->bio);
220+
BIO_clear_retry_flags (b);
220221

221222
if ((ret <= 0) && MONGOC_ERRNO_IS_AGAIN (errno)) {
222-
BIO_set_retry_read (tls->bio);
223+
MONGOC_DEBUG("set_retry_read");
224+
BIO_set_retry_read (b);
223225
}
224226

225-
return ret;
227+
RETURN (ret);
226228
}
227229

228230

0 commit comments

Comments
 (0)