Hi again.
I believe this had to do with my server attempting to apply 'Transfer-Encoding":"chunked" headers to gzip where the client only supported HTTP 1.0, thus causing an exception...
HttpException: Trying to set 'Transfer-Encoding: Chunked' on HTTP 1.0 headers
...which then suspended the code so that the connection was never closed.
I added a if (request.protocolVersion == '1.1') condition. I believe the issue went away – so far it looks good.
Future<shelf.Response> _handleFile(shelf.Request request) async {
shelf.Response response = await this.staticHandler(request);
if (request.protocolVersion == '1.1') {
response = response.change(headers: {'Transfer-Encoding': 'chunked'});
}
return response;
}
Can anyone confirm that such an exception would in fact prevent the connection from closing, resulting in a CLOSE_WAIT?
--D