File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -189,8 +189,16 @@ void AsyncWebServerRequest::_removeNotInterestingHeaders(){
189
189
190
190
void AsyncWebServerRequest::_onPoll (){
191
191
// os_printf("p\n");
192
- if (_response != NULL && _client != NULL && _client->canSend () && !_response->_finished ()){
193
- _response->_ack (this , 0 , 0 );
192
+ if (_response != NULL && _client != NULL && _client->canSend ()){
193
+ if (!_response->_finished ()){
194
+ _response->_ack (this , 0 , 0 );
195
+ } else {
196
+ AsyncWebServerResponse* r = _response;
197
+ _response = NULL ;
198
+ delete r;
199
+
200
+ _client->close ();
201
+ }
194
202
}
195
203
}
196
204
@@ -199,10 +207,13 @@ void AsyncWebServerRequest::_onAck(size_t len, uint32_t time){
199
207
if (_response != NULL ){
200
208
if (!_response->_finished ()){
201
209
_response->_ack (this , len, time);
202
- } else {
210
+ }
211
+ if (_response->_finished ()){
203
212
AsyncWebServerResponse* r = _response;
204
213
_response = NULL ;
205
214
delete r;
215
+
216
+ _client->close ();
206
217
}
207
218
}
208
219
}
You can’t perform that action at this time.
0 commit comments