Merge pull request #230 from 9seconds/simplify-sockopts

Simplify sockopts
This commit is contained in:
Sergey Arkhipov
2021-12-01 16:03:52 +04:00
committed by GitHub
49 changed files with 478 additions and 290 deletions
+2 -8
View File
@@ -50,6 +50,8 @@ type ProxyOpts struct {
// buffers: to and from.
//
// This is an optional setting.
//
// Deprecated: this setting is no longer makes any effect.
BufferSize uint
// Concurrency is a size of the worker pool for connection management.
@@ -134,14 +136,6 @@ func (p ProxyOpts) valid() error {
return nil
}
func (p ProxyOpts) getBufferSize() int {
if p.BufferSize < 1 {
return DefaultBufferSize
}
return int(p.BufferSize)
}
func (p ProxyOpts) getConcurrency() int {
if p.Concurrency == 0 {
return DefaultConcurrency