serve: send response headers even if response has no body
The headers would usually be sent anyway because the app did a number of writes
of empty strings.
hgweb: simplify wsgirequest header handling
Remove leaky header abstraction and prepare for other encodings.
hgweb: make type a mandatory parameter to request.respond
There will thus always be headers and the runtime check can be removed.
hgweb: use Content-Length for pushres
This prevents some unnecessary http connection close.
hgweb: send Content-Length 0 for zero length response
Before, Content-Length wasn't sent for 0 length responses. Now it is.
This could in principle prevent some unnecessary http connection close.
archival: tarit should never close the dest passed to it
Some archive types closed the open file passed to it, some didn't.
This could cause either missing or duplicate close and cause problems in hgweb.
The fix in
14f3795a5ed7 should only have closed the compressors and archivers -
not the underlying file itself if no compressor is used.