Skip to content

Commit 61285ec

Browse files
committed
cleanup
1 parent de0a3b0 commit 61285ec

File tree

2 files changed

+2
-3171
lines changed

2 files changed

+2
-3171
lines changed

tutorials/http/http-client/main.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ static void fn(struct mg_connection *c, int ev, void *ev_data) {
3030
struct mg_str host = mg_url_host(s_url);
3131

3232
if (c->is_tls) {
33-
struct mg_tls_opts opts = {.ca = s_ca_pem,
34-
.name = mg_url_host(s_url)};
33+
struct mg_tls_opts opts = {.ca = s_ca_pem, .name = mg_url_host(s_url)};
3534
mg_tls_init(c, &opts);
3635
}
3736

@@ -50,7 +49,7 @@ static void fn(struct mg_connection *c, int ev, void *ev_data) {
5049
// Response is received. Print it
5150
struct mg_http_message *hm = (struct mg_http_message *) ev_data;
5251
printf("%.*s", (int) hm->message.len, hm->message.buf);
53-
c->is_closing = 1; // Tell mongoose to close this connection
52+
c->is_draining = 1; // Tell mongoose to close this connection
5453
*(bool *) c->fn_data = true; // Tell event loop to stop
5554
} else if (ev == MG_EV_ERROR) {
5655
*(bool *) c->fn_data = true; // Error, tell event loop to stop

0 commit comments

Comments
 (0)