mirror of https://github.com/status-im/consul.git
Removes upper end of muxado handler.
This commit is contained in:
parent
406efb5d91
commit
ee999f4dce
|
@ -17,7 +17,6 @@ import (
|
||||||
"github.com/hashicorp/memberlist"
|
"github.com/hashicorp/memberlist"
|
||||||
"github.com/hashicorp/net-rpc-msgpackrpc"
|
"github.com/hashicorp/net-rpc-msgpackrpc"
|
||||||
"github.com/hashicorp/yamux"
|
"github.com/hashicorp/yamux"
|
||||||
"github.com/inconshreveable/muxado"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type RPCType byte
|
type RPCType byte
|
||||||
|
@ -25,7 +24,7 @@ type RPCType byte
|
||||||
const (
|
const (
|
||||||
rpcConsul RPCType = iota
|
rpcConsul RPCType = iota
|
||||||
rpcRaft
|
rpcRaft
|
||||||
rpcMultiplex
|
rpcMultiplex // Old Muxado byte, no longer supported.
|
||||||
rpcTLS
|
rpcTLS
|
||||||
rpcMultiplexV2
|
rpcMultiplexV2
|
||||||
)
|
)
|
||||||
|
@ -108,9 +107,6 @@ func (s *Server) handleConn(conn net.Conn, isTLS bool) {
|
||||||
metrics.IncrCounter([]string{"consul", "rpc", "raft_handoff"}, 1)
|
metrics.IncrCounter([]string{"consul", "rpc", "raft_handoff"}, 1)
|
||||||
s.raftLayer.Handoff(conn)
|
s.raftLayer.Handoff(conn)
|
||||||
|
|
||||||
case rpcMultiplex:
|
|
||||||
s.handleMultiplex(conn)
|
|
||||||
|
|
||||||
case rpcTLS:
|
case rpcTLS:
|
||||||
if s.rpcTLS == nil {
|
if s.rpcTLS == nil {
|
||||||
s.logger.Printf("[WARN] consul.rpc: TLS connection attempted, server not configured for TLS %s", logConn(conn))
|
s.logger.Printf("[WARN] consul.rpc: TLS connection attempted, server not configured for TLS %s", logConn(conn))
|
||||||
|
@ -130,23 +126,6 @@ func (s *Server) handleConn(conn net.Conn, isTLS bool) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// handleMultiplex is used to multiplex a single incoming connection
|
|
||||||
// using the Muxado multiplexer
|
|
||||||
func (s *Server) handleMultiplex(conn net.Conn) {
|
|
||||||
defer conn.Close()
|
|
||||||
server := muxado.Server(conn)
|
|
||||||
for {
|
|
||||||
sub, err := server.Accept()
|
|
||||||
if err != nil {
|
|
||||||
if !strings.Contains(err.Error(), "closed") {
|
|
||||||
s.logger.Printf("[ERR] consul.rpc: multiplex conn accept failed: %v %s", err, logConn(conn))
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
go s.handleConsulConn(sub)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// handleMultiplexV2 is used to multiplex a single incoming connection
|
// handleMultiplexV2 is used to multiplex a single incoming connection
|
||||||
// using the Yamux multiplexer
|
// using the Yamux multiplexer
|
||||||
func (s *Server) handleMultiplexV2(conn net.Conn) {
|
func (s *Server) handleMultiplexV2(conn net.Conn) {
|
||||||
|
|
Loading…
Reference in New Issue