Refactor HTTP client

This commit is contained in:
cpq committed 2020-12-18 14:29:30 +00:00
1 parent b0a5165b44
commit aede72fa37
6 files changed
+42 -45

No files matched your search

+2 -4
View File
@@ -514,13 +514,11 @@ void mg_mgr_poll(struct mg_mgr *mgr, int ms) {
if (mg_tls_handshake(c)) c->is_tls_hs = 0;
#endif
} else if (c->is_connecting) {
if (c->is_readable || c->is_writable) {
connect_conn(c);
}
if (c->is_readable || c->is_writable) connect_conn(c);
} else if (c->is_tls_hs) {
if ((c->is_readable || c->is_writable) && mg_tls_handshake(c)) {
c->is_tls_hs = 0;
mg_call(c, MG_EV_CONNECT, NULL);
if (c->is_connecting) mg_call(c, MG_EV_CONNECT, NULL);
}
} else {
if (c->is_readable) read_conn(c, ll_read);