fix built-in TLS not calling MG_EV_TLS_HS; uniformize mg_tls_init() #3023
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
mg_tls_handshake()
from built-in TLS was not firing theMG_EV_TLS_HS
event; the SMTP example was not working because of this. FixedWe seem to have leftovers from our attempt to make TLS start automagically:
mg_tls_init()
in both MbedTLS and OpenSSL hadif (c->is_client && c->is_resolving == 0 && c->is_connecting == 0) mg_tls_handshake(c);
. Built.in TLS did not do this. Obviously c->is_resolving = 0 and c->is_connecting = 0 at client connect, when mg_tls_init() is called. Besides that, connect_conn and its MIP equivalent call mg_tls_handshake(c) right after the event call to EV_CONNECT returns.Removed