mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-06 15:51:25 +00:00
Add smtp client example
This commit is contained in:
1 parent
f94a019733
commit
48800504be
9 files changed
+114
-2
No files matched your search
+2
-1
@@ -48,6 +48,7 @@ void mg_tls_handshake(struct mg_connection *c) {
|
||||
if (rc == 0) { // Success
|
||||
MG_DEBUG(("%lu success", c->id));
|
||||
c->is_tls_hs = 0;
|
||||
mg_call(c, MG_EV_TLS_HS, NULL);
|
||||
} else if (rc == MBEDTLS_ERR_SSL_WANT_READ ||
|
||||
rc == MBEDTLS_ERR_SSL_WANT_WRITE) { // Still pending
|
||||
MG_VERBOSE(("%lu pending, %d%d %d (-%#x)", c->id, c->is_connecting,
|
||||
@@ -185,7 +186,7 @@ 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;
|
||||
long n = mbedtls_ssl_read(&tls->ssl, (unsigned char *) buf, len);
|
||||
if (n == MBEDTLS_ERR_SSL_WANT_READ || n == MBEDTLS_ERR_SSL_WANT_WRITE)
|
||||
if (n == MBEDTLS_ERR_SSL_WANT_READ || n == MBEDTLS_ERR_SSL_WANT_WRITE)
|
||||
return MG_IO_WAIT;
|
||||
if (n <= 0) return MG_IO_ERR;
|
||||
return n;
|
||||
|
||||
Reference in new issue
Block a user