From 8174842b052574f8abeb3af10d40f59e50a6c107 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Sun, 24 Apr 2022 11:39:54 +0100 Subject: [PATCH] docs --- docs/README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/README.md b/docs/README.md index 953801cb..7ebd5984 100644 --- a/docs/README.md +++ b/docs/README.md @@ -225,10 +225,11 @@ struct mg_connection { c->label[0] = 'W'; // Established websocket connection, store something ... ``` -- If you need to close the connection, set `c->draining = 1;` flag in your +- If you need to close the connection, set `c->is_draining = 1;` in your event handler function. That tells the event manager to send all remaining - data in a send buffer, then close the connection. If you need to close - the connection immediately without sending data, use `c->is_closing = 1;` + data in a send buffer ("drain" the connection), then close the connection. + If you need to close + the connection immediately without draining, use `c->is_closing = 1;` - Use `mg_http_reply()` function to create HTTP responses. That function properly sets the `Content-Length` header, which is important. Of course you can create responses manually, e.g. with `mg_printf()` function,