Async copy.

To improve performance, this results in better consistent average latency but lower throughput in some cases.
This commit is contained in:
FireMasterK 2021-04-09 14:19:38 +05:30
parent 17bc0c3321
commit 916df915b3
No known key found for this signature in database
GPG key ID: 8DFF5DD33E93DB58

View file

@ -101,7 +101,7 @@ func (*requesthandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
w.WriteHeader(resp.StatusCode) w.WriteHeader(resp.StatusCode)
io.Copy(w, resp.Body) go io.Copy(w, resp.Body)
} }
func copyHeaders(from http.Header, to http.Header) { func copyHeaders(from http.Header, to http.Header) {