mirror of
https://github.com/caddyserver/caddy.git
synced 2025-06-03 05:34:16 -04:00
set read/write buffer and enable nagle's algorithm for testing
This commit is contained in:
parent
0b2802faa4
commit
8690157240
@ -276,6 +276,18 @@ func (h *HTTPTransport) NewTransport(caddyCtx caddy.Context) (*http.Transport, e
|
|||||||
return nil, DialError{err}
|
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 != "" {
|
if h.ProxyProtocol != "" {
|
||||||
proxyProtocolInfo, ok := caddyhttp.GetVar(ctx, proxyProtocolInfoVarKey).(ProxyProtocolInfo)
|
proxyProtocolInfo, ok := caddyhttp.GetVar(ctx, proxyProtocolInfoVarKey).(ProxyProtocolInfo)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user