Skip to content

Commit 92b7f0f

Browse files
committed
HACK: make br_sslio_read(ctx, dst, len) return buffered length if dst is NULL
This let’s us use it in Client::available()
1 parent cfcfac2 commit 92b7f0f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/bearssl/ssl_io.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ br_sslio_read(br_sslio_context *ctx, void *dst, size_t len)
156156
return -1;
157157
}
158158
buf = br_ssl_engine_recvapp_buf(ctx->engine, &alen);
159+
#ifdef ARDUINO
160+
if (dst == NULL) {
161+
return (int)alen;
162+
}
163+
#endif
159164
if (alen > len) {
160165
alen = len;
161166
}

0 commit comments

Comments
 (0)