Browse Source

move mux to common

pull/1343/head
Darien Raymond 6 years ago
parent
commit
838f2919ab
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
  1. 2
      app/proxyman/inbound/always.go
  2. 2
      app/proxyman/inbound/dynamic.go
  3. 4
      app/proxyman/outbound/handler.go
  4. 0
      common/mux/errors.generated.go
  5. 0
      common/mux/frame.go
  6. 21
      common/mux/mux.go
  7. 2
      common/mux/mux_test.go
  8. 0
      common/mux/reader.go
  9. 0
      common/mux/session.go
  10. 2
      common/mux/session_test.go
  11. 0
      common/mux/writer.go

2
app/proxyman/inbound/always.go

@ -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"

2
app/proxyman/inbound/dynamic.go

@ -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"

4
app/proxyman/outbound/handler.go

@ -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

0
app/proxyman/mux/errors.generated.go → common/mux/errors.generated.go

0
app/proxyman/mux/frame.go → common/mux/frame.go

21
app/proxyman/mux/mux.go → common/mux/mux.go

@ -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"
@ -30,18 +29,18 @@ const (
)
type ClientManager struct {
access sync.Mutex
clients []*Client
proxy proxy.Outbound
dialer internet.Dialer
config *proxyman.MultiplexingConfig
access sync.Mutex
clients []*Client
proxy proxy.Outbound
dialer internet.Dialer
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,
proxy: p,
dialer: d,
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() {

2
app/proxyman/mux/mux_test.go → common/mux/mux_test.go

@ -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"

0
app/proxyman/mux/reader.go → common/mux/reader.go

0
app/proxyman/mux/session.go → common/mux/session.go

2
app/proxyman/mux/session_test.go → common/mux/session_test.go

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

0
app/proxyman/mux/writer.go → common/mux/writer.go

Loading…
Cancel
Save