mirror of
https://github.com/lwch/natpass.git
synced 2024-04-21 12:41:54 +00:00
去除手动设置codec的逻辑
This commit is contained in:
@@ -11,7 +11,6 @@ import (
|
||||
"github.com/lwch/logging"
|
||||
"github.com/lwch/natpass/code/client/global"
|
||||
"github.com/lwch/natpass/code/network"
|
||||
"github.com/lwch/natpass/code/network/encoding/proto"
|
||||
"github.com/lwch/natpass/code/utils"
|
||||
"github.com/lwch/runtime"
|
||||
)
|
||||
@@ -82,7 +81,6 @@ func (conn *Conn) connect() error {
|
||||
return err
|
||||
}
|
||||
cn := network.NewConn(dial)
|
||||
cn.SetCodec(proto.New())
|
||||
err = writeHandshake(cn, conn.cfg)
|
||||
if err != nil {
|
||||
logging.Error("write handshake: %v", err)
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
|
||||
"github.com/lwch/logging"
|
||||
"github.com/lwch/natpass/code/network"
|
||||
"github.com/lwch/natpass/code/network/encoding/proto"
|
||||
"github.com/lwch/natpass/code/server/global"
|
||||
)
|
||||
|
||||
@@ -50,7 +49,6 @@ func New(cfg *global.Configure) *Handler {
|
||||
// Handle main loop
|
||||
func (h *Handler) Handle(conn net.Conn) {
|
||||
c := network.NewConn(conn)
|
||||
c.SetCodec(proto.New())
|
||||
var id string
|
||||
defer func() {
|
||||
if len(id) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user