move mux to common

pull/1343/head
Darien Raymond 6 years ago
parent c2566e1331
commit 838f2919ab
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

@ -5,9 +5,9 @@ import (
"v2ray.com/core"
"v2ray.com/core/app/proxyman"
"v2ray.com/core/app/proxyman/mux"
"v2ray.com/core/common"
"v2ray.com/core/common/dice"
"v2ray.com/core/common/mux"
"v2ray.com/core/common/net"
"v2ray.com/core/common/serial"
"v2ray.com/core/features/policy"

@ -7,8 +7,8 @@ import (
"v2ray.com/core"
"v2ray.com/core/app/proxyman"
"v2ray.com/core/app/proxyman/mux"
"v2ray.com/core/common/dice"
"v2ray.com/core/common/mux"
"v2ray.com/core/common/net"
"v2ray.com/core/common/task"
"v2ray.com/core/proxy"

@ -5,8 +5,8 @@ import (
"v2ray.com/core"
"v2ray.com/core/app/proxyman"
"v2ray.com/core/app/proxyman/mux"
"v2ray.com/core/common"
"v2ray.com/core/common/mux"
"v2ray.com/core/common/net"
"v2ray.com/core/common/session"
"v2ray.com/core/common/vio"
@ -72,7 +72,7 @@ func NewHandler(ctx context.Context, config *core.OutboundHandlerConfig) (outbou
if config.Concurrency < 1 || config.Concurrency > 1024 {
return nil, newError("invalid mux concurrency: ", config.Concurrency).AtWarning()
}
h.mux = mux.NewClientManager(proxyHandler, h, config)
h.mux = mux.NewClientManager(proxyHandler, h, config.Concurrency)
}
h.proxy = proxyHandler

@ -9,7 +9,6 @@ import (
"time"
"v2ray.com/core"
"v2ray.com/core/app/proxyman"
"v2ray.com/core/common"
"v2ray.com/core/common/buf"
"v2ray.com/core/common/errors"
@ -34,14 +33,14 @@ type ClientManager struct {
clients []*Client
proxy proxy.Outbound
dialer internet.Dialer
config *proxyman.MultiplexingConfig
concurrency uint32
}
func NewClientManager(p proxy.Outbound, d internet.Dialer, c *proxyman.MultiplexingConfig) *ClientManager {
func NewClientManager(p proxy.Outbound, d internet.Dialer, c uint32) *ClientManager {
return &ClientManager{
proxy: p,
dialer: d,
config: c,
concurrency: c,
}
}
@ -108,7 +107,7 @@ func NewClient(pctx context.Context, p proxy.Outbound, dialer internet.Dialer, m
},
done: done.New(),
manager: m,
concurrency: m.config.Concurrency,
concurrency: m.concurrency,
}
go func() {

@ -4,8 +4,8 @@ import (
"io"
"testing"
. "v2ray.com/core/app/proxyman/mux"
"v2ray.com/core/common/buf"
. "v2ray.com/core/common/mux"
"v2ray.com/core/common/net"
"v2ray.com/core/common/protocol"
"v2ray.com/core/transport/pipe"

@ -3,7 +3,7 @@ package mux_test
import (
"testing"
. "v2ray.com/core/app/proxyman/mux"
. "v2ray.com/core/common/mux"
. "v2ray.com/ext/assert"
)
Loading…
Cancel
Save