optimizations

This commit is contained in:
Me No Dev
2016-08-23 03:10:45 +03:00
parent bfde9bc81a
commit 7110758b5a
2 changed files with 4 additions and 1 deletions

View File

@@ -173,6 +173,9 @@ void AsyncWebServerRequest::_onAck(size_t len, uint32_t time){
if(_response != NULL){ if(_response != NULL){
if(!_response->_finished()){ if(!_response->_finished()){
_response->_ack(this, len, time); _response->_ack(this, len, time);
if(!_response->_finished() && _client->space()){
_response->_ack(this, 0, 0);
}
} else { } else {
AsyncWebServerResponse* r = _response; AsyncWebServerResponse* r = _response;
_response = NULL; _response = NULL;

View File

@@ -397,7 +397,7 @@ AsyncFileResponse::AsyncFileResponse(File content, String path, String contentTy
_content = content; _content = content;
_contentLength = _content.size(); _contentLength = _content.size();
if(!download && String(_content.name()).endsWith(".gz")) if(!download && String(_content.name()).endsWith(".gz") && !path.endsWith(".gz"))
addHeader("Content-Encoding", "gzip"); addHeader("Content-Encoding", "gzip");
if(contentType == "") if(contentType == "")