mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-24 11:54:49 +00:00
fix WolfSSL not working on built-in TCP/IP
This commit is contained in:
1 parent
2db7119080
commit
6b8d8b5caa
3 files changed
+32
-6
No files matched your search
+6
-1
@@ -315,7 +315,12 @@ size_t mg_tls_pending(struct mg_connection *c) {
|
||||
|
||||
long mg_tls_recv(struct mg_connection *c, void *buf, size_t len) {
|
||||
struct mg_tls *tls = (struct mg_tls *) c->tls;
|
||||
int n = SSL_read(tls->ssl, buf, (int) len);
|
||||
int n;
|
||||
#if MG_TLS == MG_TLS_WOLFSSL
|
||||
uint8_t dummy; // WolfSSL requires destination != NULL
|
||||
if (buf == NULL && len == 0) buf = &dummy;
|
||||
#endif
|
||||
n = SSL_read(tls->ssl, buf, (int) len);
|
||||
if (!c->is_tls_hs && (buf == NULL || len == 0) && n == 0) return 0; // MIP
|
||||
if (n < 0 && mg_tls_err(c, tls, n) == 0) return MG_IO_WAIT;
|
||||
if (n <= 0) return MG_IO_ERR;
|
||||
|
||||
Reference in new issue
Block a user