Compare commits

...

1 Commits

Author SHA1 Message Date
WeidiDeng 8690157240 set read/write buffer and enable nagle's algorithm for testing 2025-04-18 08:21:55 +08:00
@@ -276,6 +276,18 @@ func (h *HTTPTransport) NewTransport(caddyCtx caddy.Context) (*http.Transport, e
return nil, DialError{err}
}
// set read/write buffer, enable nagle's algorithm
if srb, ok := conn.(interface{ SetReadBuffer(int) error }); ok {
_ = srb.SetReadBuffer(4096)
}
if swb, ok := conn.(interface{ SetWriteBuffer(int) error }); ok {
_ = swb.SetWriteBuffer(4096)
}
if snd, ok := conn.(interface{ SetNoDelay(bool) error }); ok {
_ = snd.SetNoDelay(false)
}
if h.ProxyProtocol != "" {
proxyProtocolInfo, ok := caddyhttp.GetVar(ctx, proxyProtocolInfoVarKey).(ProxyProtocolInfo)
if !ok {