Split TLS files and introduce MG_ENABLE_CUSTOM_TLS

This commit is contained in:
Sergey Lyubka committed 2021-12-14 12:42:41 +00:00
1 parent 84f3fb0ba5
commit 755bf3c412
13 files changed
+496 -445

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
#include "tls.h"
#if !MG_ENABLE_MBEDTLS && !MG_ENABLE_OPENSSL && !MG_ENABLE_CUSTOM_TLS
void mg_tls_init(struct mg_connection *c, struct mg_tls_opts *opts) {
(void) opts;
mg_error(c, "TLS is not enabled");
}
void mg_tls_handshake(struct mg_connection *c) {
(void) c;
}
void mg_tls_free(struct mg_connection *c) {
(void) c;
}
long mg_tls_recv(struct mg_connection *c, void *buf, size_t len) {
return c == NULL || buf == NULL || len == 0 ? 0 : -1;
}
long mg_tls_send(struct mg_connection *c, const void *buf, size_t len) {
return c == NULL || buf == NULL || len == 0 ? 0 : -1;
}
#endif