This patch is a workaround for an issue that causes an intermittent failure
in test_trr_case_sensitivity.js.
I was able to reproduce the bug locally with some logging, but not with
nsHttp:5 or under rr, which made it difficult to diagnose the root cause.
What I was able to determine using logging and timestamps in the nodejs code
is that we would not get the "end" event for a request, to which we were
reacting to send back the DoH response. The request has a timer, and
eventually that timer would fire and cancel the request. At that point
we would see the "end" event in nodejs but it's too late to actually process
the response.
It's not clear if this was a bug in Firefox's HTTP2 implementation
(maybe the end isn't signaled properly) or in nodejs.
This fix makes it so we send back the response when the number of bytes
specified in contentLength reaches the server.
We should investigate in a follow-up bug if there's another Necko bug
involved here.
Differential Revision: https://phabricator.services.mozilla.com/D78676
CLOSED TREE
Backed out changeset 03c4c517ee37 (bug 1640091)
Backed out changeset a1d86c177d79 (bug 1640091)
Backed out changeset f481d4ec255a (bug 1640091)