mirror of
https://github.com/cesanta/mongoose.git
synced 2024-11-28 05:39:00 +08:00
Fix fd leak for cached static files
This commit is contained in:
parent
e135743efa
commit
117aeaa15d
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user