Skip to content

Commit 3ab8313

Browse files
committed
fixed ssl socket recv in thread was blocking gc
1 parent d9a3270 commit 3ab8313

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libs/ssl/ssl.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@ static bool is_block_error() {
145145
}
146146

147147
static int net_read(void *fd, unsigned char *buf, size_t len) {
148-
int r = recv((SOCKET)(int_val)fd, (char *)buf, (int)len, MSG_NOSIGNAL);
148+
int r;
149+
hl_blocking(true);
150+
r = recv((SOCKET)(int_val)fd, (char *)buf, (int)len, MSG_NOSIGNAL);
151+
hl_blocking(false);
149152
if( r == SOCKET_ERROR && is_block_error() )
150153
return MBEDTLS_ERR_SSL_WANT_READ;
151154
return r;

0 commit comments

Comments
 (0)