Skip to content

Commit

Permalink
Merge branch 'v1-feature-main'
Browse files Browse the repository at this point in the history
  • Loading branch information
dobyte committed Jul 4, 2023
2 parents 6168122 + f3cbe2d commit 8a3d84a
Show file tree
Hide file tree
Showing 19 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion eventbus/kafka/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.16

require (
github.com/Shopify/sarama v1.38.1
github.com/dobyte/due v0.0.23
github.com/dobyte/due v0.0.24
)

replace github.com/dobyte/due => ./../../
2 changes: 1 addition & 1 deletion eventbus/nats/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/dobyte/due/eventbus/nats
go 1.16

require (
github.com/dobyte/due v0.0.23
github.com/dobyte/due v0.0.24
github.com/nats-io/nats-server/v2 v2.9.14 // indirect
github.com/nats-io/nats.go v1.23.0
)
Expand Down
2 changes: 1 addition & 1 deletion eventbus/redis/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/dobyte/due/eventbus/redis
go 1.16

require (
github.com/dobyte/due v0.0.23
github.com/dobyte/due v0.0.24
github.com/go-redis/redis/v8 v8.11.5
)

Expand Down
2 changes: 1 addition & 1 deletion locate/redis/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/dobyte/due/locate/redis
go 1.16

require (
github.com/dobyte/due v0.0.23
github.com/dobyte/due v0.0.24
github.com/go-redis/redis/v8 v8.11.5
github.com/jonboulle/clockwork v0.3.0 // indirect
golang.org/x/sync v0.1.0
Expand Down
2 changes: 1 addition & 1 deletion log/aliyun/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.16

require (
github.com/aliyun/aliyun-log-go-sdk v0.1.37
github.com/dobyte/due v0.0.23
github.com/dobyte/due v0.0.24
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
Expand Down
2 changes: 1 addition & 1 deletion log/logrus/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/dobyte/due/log/logrus
go 1.16

require (
github.com/dobyte/due v0.0.23
github.com/dobyte/due v0.0.24
github.com/sirupsen/logrus v1.9.0
)

Expand Down
2 changes: 1 addition & 1 deletion log/tencent/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/dobyte/due/log/tencent
go 1.16

require (
github.com/dobyte/due v0.0.23
github.com/dobyte/due v0.0.24
github.com/tencentcloud/tencentcloud-cls-sdk-go v1.0.2
)

Expand Down
2 changes: 1 addition & 1 deletion log/zap/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/dobyte/due/log/zap
go 1.16

require (
github.com/dobyte/due v0.0.23
github.com/dobyte/due v0.0.24
go.uber.org/zap v1.22.0
)

Expand Down
2 changes: 1 addition & 1 deletion network/tcp/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ module github.com/dobyte/due/network/tcp

go 1.16

require github.com/dobyte/due v0.0.23
require github.com/dobyte/due v0.0.24

replace github.com/dobyte/due => ../../
1 change: 1 addition & 0 deletions network/tcp/server_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ func (c *serverConn) init(conn net.Conn, cm *serverConnMgr) {
c.chWrite = make(chan chWrite, 1024)
c.done = make(chan struct{})
c.lastHeartbeatTime = xtime.Now().Unix()
atomic.StoreInt64(&c.uid, 0)
atomic.StoreInt32(&c.state, int32(network.ConnOpened))

if c.connMgr.server.connectHandler != nil {
Expand Down
2 changes: 1 addition & 1 deletion network/ws/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/dobyte/due/network/ws
go 1.16

require (
github.com/dobyte/due v0.0.23
github.com/dobyte/due v0.0.24
github.com/gorilla/websocket v1.5.0
)

Expand Down
1 change: 1 addition & 0 deletions network/ws/server_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ func (c *serverConn) init(conn *websocket.Conn, cm *connMgr) {
c.chWrite = make(chan chWrite, 1024)
c.done = make(chan struct{})
c.lastHeartbeatTime = xtime.Now().Unix()
atomic.StoreInt64(&c.uid, 0)
atomic.StoreInt32(&c.state, int32(network.ConnOpened))

if c.connMgr.server.connectHandler != nil {
Expand Down
7 changes: 2 additions & 5 deletions packet/packer.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,10 @@ func (p *defaultPacker) Pack(message *Message) ([]byte, error) {

var (
err error
buf = p.buffers.Get().(*bytes.Buffer)
buf = bytes.NewBuffer(nil)
)

defer func() {
buf.Reset()
p.buffers.Put(buf)
}()
buf.Grow(p.opts.seqBytesLen + p.opts.routeBytesLen + len(message.Buffer))

switch p.opts.seqBytesLen {
case 1:
Expand Down
2 changes: 1 addition & 1 deletion registry/consul/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/dobyte/due/registry/consul
go 1.16

require (
github.com/dobyte/due v0.0.23
github.com/dobyte/due v0.0.24
github.com/hashicorp/consul/api v1.13.0
)

Expand Down
2 changes: 1 addition & 1 deletion registry/etcd/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/dobyte/due/registry/etcd
go 1.16

require (
github.com/dobyte/due v0.0.23
github.com/dobyte/due v0.0.24
go.etcd.io/etcd/api/v3 v3.5.4
go.etcd.io/etcd/client/v3 v3.5.4
)
Expand Down
3 changes: 3 additions & 0 deletions session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ func (s *Session) Bind(cid, uid int64) error {
}

if oldUID := conn.UID(); oldUID != 0 {
if uid == oldUID {
return nil
}
delete(s.users, oldUID)
}

Expand Down
2 changes: 1 addition & 1 deletion transport/grpc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/dobyte/due/transport/grpc
go 1.16

require (
github.com/dobyte/due v0.0.23
github.com/dobyte/due v0.0.24
github.com/golang/protobuf v1.5.2
google.golang.org/grpc v1.50.1
google.golang.org/protobuf v1.28.1 // indirect
Expand Down
2 changes: 1 addition & 1 deletion transport/rpcx/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/dobyte/due/transport/rpcx
go 1.16

require (
github.com/dobyte/due v0.0.23
github.com/dobyte/due v0.0.24
github.com/smallnest/rpcx v1.7.11
)

Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
package due

// Version 框架版本
const Version = "v0.0.23"
const Version = "v0.0.24"

// Website 框架网址
const Website = "https://github.com/dobyte/due"

0 comments on commit 8a3d84a

Please sign in to comment.