perf: further optimize http and body buffer handling

This commit is contained in:
yusing
2025-10-12 20:57:51 +08:00
parent eef994082c
commit c66de99fcb
9 changed files with 97 additions and 42 deletions

View File

@@ -106,8 +106,9 @@ func (ep *Entrypoint) ServeHTTP(w http.ResponseWriter, r *http.Request) {
func (ep *Entrypoint) serveHTTP(w http.ResponseWriter, r *http.Request) {
if ep.accessLogger != nil {
w = accesslog.NewResponseRecorder(w)
defer ep.accessLogger.Log(r, w.(*accesslog.ResponseRecorder).Response())
rec := accesslog.NewResponseRecorder(w)
w = rec
defer ep.accessLogger.Log(r, rec.Response())
}
route := ep.findRouteFunc(r.Host)