mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-27 12:26:24 +00:00
Fix fd leak for cached static files
This commit is contained in:
1 parent
e135743efa
commit
117aeaa15d
2 files changed
+2
No files matched your search
@@ -786,6 +786,7 @@ void mg_http_serve_file(struct mg_connection *c, struct mg_http_message *hm,
|
||||
mg_http_etag(etag, sizeof(etag), &st) != etag) {
|
||||
mg_http_reply(c, 404, "", "%s", "Not found\n");
|
||||
} else if (inm != NULL && mg_vcasecmp(inm, etag) == 0) {
|
||||
fclose(fp);
|
||||
mg_printf(c, "HTTP/1.1 304 Not Modified\r\nContent-Length: 0\r\n\r\n");
|
||||
} else {
|
||||
mg_printf(c,
|
||||
|
||||
@@ -372,6 +372,7 @@ void mg_http_serve_file(struct mg_connection *c, struct mg_http_message *hm,
|
||||
mg_http_etag(etag, sizeof(etag), &st) != etag) {
|
||||
mg_http_reply(c, 404, "", "%s", "Not found\n");
|
||||
} else if (inm != NULL && mg_vcasecmp(inm, etag) == 0) {
|
||||
fclose(fp);
|
||||
mg_printf(c, "HTTP/1.1 304 Not Modified\r\nContent-Length: 0\r\n\r\n");
|
||||
} else {
|
||||
mg_printf(c,
|
||||
|
||||
Reference in new issue
Block a user