Add reponse end to the http dir list

This commit is contained in:
cpq 2022-08-28 13:58:41 +01:00
parent 2f3f1357c8
commit ef89776517
2 changed files with 2 additions and 0 deletions

View File

@ -1975,6 +1975,7 @@ static void listdir(struct mg_connection *c, struct mg_http_message *hm,
n = mg_snprintf(tmp, sizeof(tmp), "%lu", (unsigned long) (c->send.len - off));
if (n > sizeof(tmp)) n = 0;
memcpy(c->send.buf + off - 12, tmp, n); // Set content length
c->is_resp = 0; // Mark response end
}
// Resolve requested file into `path` and return its fs->st() result

View File

@ -637,6 +637,7 @@ static void listdir(struct mg_connection *c, struct mg_http_message *hm,
n = mg_snprintf(tmp, sizeof(tmp), "%lu", (unsigned long) (c->send.len - off));
if (n > sizeof(tmp)) n = 0;
memcpy(c->send.buf + off - 12, tmp, n); // Set content length
c->is_resp = 0; // Mark response end
}
// Resolve requested file into `path` and return its fs->st() result