mirror of
https://github.com/cesanta/mongoose.git
synced 2025-06-13 05:12:51 +08:00
Makes sure send file releases resources on close
PUBLISHED_FROM=451d2dd0b55b9fd7dea441a9279f54d0005c97b1
This commit is contained in:
parent
3a9a9c7ad0
commit
22f8d86b05
19
mongoose.c
19
mongoose.c
@ -4030,15 +4030,16 @@ static void http_handler(struct mg_connection *nc, int ev, void *ev_data) {
|
|||||||
#ifndef MG_DISABLE_HTTP_WEBSOCKET
|
#ifndef MG_DISABLE_HTTP_WEBSOCKET
|
||||||
struct mg_str *vec;
|
struct mg_str *vec;
|
||||||
#endif
|
#endif
|
||||||
/*
|
if (ev == MG_EV_CLOSE) {
|
||||||
* For HTTP messages without Content-Length, always send HTTP message
|
/*
|
||||||
* before MG_EV_CLOSE message.
|
* For HTTP messages without Content-Length, always send HTTP message
|
||||||
*/
|
* before MG_EV_CLOSE message.
|
||||||
if (ev == MG_EV_CLOSE && io->len > 0 &&
|
*/
|
||||||
mg_parse_http(io->buf, io->len, &hm, is_req) > 0) {
|
if (io->len > 0 && mg_parse_http(io->buf, io->len, &hm, is_req) > 0) {
|
||||||
hm.message.len = io->len;
|
hm.message.len = io->len;
|
||||||
hm.body.len = io->buf + io->len - hm.body.p;
|
hm.body.len = io->buf + io->len - hm.body.p;
|
||||||
nc->handler(nc, is_req ? MG_EV_HTTP_REQUEST : MG_EV_HTTP_REPLY, &hm);
|
nc->handler(nc, is_req ? MG_EV_HTTP_REQUEST : MG_EV_HTTP_REPLY, &hm);
|
||||||
|
}
|
||||||
free_http_proto_data(nc);
|
free_http_proto_data(nc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user