Skip to content

Commit b355917

Browse files
committed
Add fd check back to CONNECTED macro
1 parent 37fc49d commit b355917

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/mysql2/client.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ static ID intern_brackets, intern_merge, intern_merge_bang, intern_new_with_args
3333
#endif
3434

3535
#if defined(HAVE_MYSQL_NET_VIO) || defined(HAVE_ST_NET_VIO)
36-
#define CONNECTED(wrapper) (wrapper->client->net.vio != NULL && VIO_IS_CONNECTED(wrapper))
36+
#define CONNECTED(wrapper) (wrapper->client->net.vio != NULL && wrapper->client->net.fd != -1 && VIO_IS_CONNECTED(wrapper))
3737
#elif defined(HAVE_MYSQL_NET_PVIO) || defined(HAVE_ST_NET_PVIO)
38-
#define CONNECTED(wrapper) (wrapper->client->net.pvio != NULL && VIO_IS_CONNECTED(wrapper))
38+
#define CONNECTED(wrapper) (wrapper->client->net.pvio != NULL && wrapper->client->net.fd != -1 && VIO_IS_CONNECTED(wrapper))
3939
#endif
4040

4141
#define REQUIRE_CONNECTED(wrapper) \

0 commit comments

Comments
 (0)