This commit is contained in:
Me No Dev
2015-12-22 01:41:57 +02:00
parent c2d0b1496f
commit f505be9a08
3 changed files with 10 additions and 8 deletions

View File

@@ -218,11 +218,11 @@ size_t AsyncAbstractResponse::_ack(AsyncWebServerRequest *request, size_t len, u
if(_state == RESPONSE_CONTENT){
size_t remaining = _contentLength - _sentLength;
size_t outLen = (remaining > space)?space:remaining;
uint8_t *buf = (uint8_t *)os_malloc(outLen);
uint8_t *buf = (uint8_t *)malloc(outLen);
outLen = _fillBuffer(buf, outLen);
request->client()->write((const char*)buf, outLen);
_sentLength += outLen;
os_free(buf);
free(buf);
if(_sentLength == _contentLength){
_state = RESPONSE_WAIT_ACK;
}