Properly close files served by debug HTTP server.
This commit is contained in:
parent
1798496ea7
commit
14a58560e1
1 changed files with 9 additions and 2 deletions
|
@ -119,7 +119,10 @@ public:
|
||||||
s += "\r\n";
|
s += "\r\n";
|
||||||
CharString cs = s.utf8();
|
CharString cs = s.utf8();
|
||||||
Error err = connection->put_data((const uint8_t *)cs.get_data(), cs.size() - 1);
|
Error err = connection->put_data((const uint8_t *)cs.get_data(), cs.size() - 1);
|
||||||
ERR_FAIL_COND(err != OK);
|
if (err != OK) {
|
||||||
|
memdelete(f);
|
||||||
|
ERR_FAIL();
|
||||||
|
}
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
uint8_t bytes[4096];
|
uint8_t bytes[4096];
|
||||||
|
@ -128,8 +131,12 @@ public:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
err = connection->put_data(bytes, read);
|
err = connection->put_data(bytes, read);
|
||||||
ERR_FAIL_COND(err != OK);
|
if (err != OK) {
|
||||||
|
memdelete(f);
|
||||||
|
ERR_FAIL();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
memdelete(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void poll() {
|
void poll() {
|
||||||
|
|
Loading…
Reference in a new issue