Skip to content

Commit

Permalink
unify naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqiangxu committed Mar 26, 2020
1 parent 8c72dd7 commit 8d40445
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
42 changes: 21 additions & 21 deletions conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,27 @@ type ServerLifecycleCallbacks struct {

// ServerBinding contains binding infos
type ServerBinding struct {
Addr string
Handler Handler // handler to invoke
DefaultReadTimeout int
DefaultWriteTimeout int
WBufSize int // best effort only, check log for error
RBufSize int // best effort only, check log for error
ReadFrameChSize int
WriteFrameChSize int
MaxFrameSize int
MaxCloseRate int // per second
MaxInboundFramePerSecond int
MaxInboundInflightStreamsPerConn int32 // connection will be closed when exceeded
ListenFunc func(network, address string) (net.Listener, error)
Codec CompressorCodec
OverlayNetwork func(net.Listener, *tls.Config) Listener
OnKickCB func(w FrameWriter)
LatencyMetric metrics.Histogram
CounterMetric metrics.Counter
TLSConf *tls.Config
LifecycleCallbacks ServerLifecycleCallbacks
ln Listener
Addr string
Handler Handler // handler to invoke
DefaultReadTimeout int
DefaultWriteTimeout int
WBufSize int // best effort only, check log for error
RBufSize int // best effort only, check log for error
ReadFrameChSize int
WriteFrameChSize int
MaxFrameSize int
MaxCloseRate int // per second
MaxInboundFramePerSecond int
MaxInboundInflightStreamPerConn int32 // connection will be closed when exceeded
ListenFunc func(network, address string) (net.Listener, error)
Codec CompressorCodec
OverlayNetwork func(net.Listener, *tls.Config) Listener
OnKickCB func(w FrameWriter)
LatencyMetric metrics.Histogram
CounterMetric metrics.Counter
TLSConf *tls.Config
LifecycleCallbacks ServerLifecycleCallbacks
ln Listener
}

// SubFunc for subscribe callback
Expand Down
6 changes: 3 additions & 3 deletions serveconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func (sc *serveconn) serve() {

handler := binding.Handler

checkInflightStreams := binding.MaxInboundInflightStreamsPerConn > 0
checkInflightStreams := binding.MaxInboundInflightStreamPerConn > 0
var inflightStreams int32

for {
Expand All @@ -201,8 +201,8 @@ func (sc *serveconn) serve() {
res.readMore()
} else {
if checkInflightStreams {
if atomic.AddInt32(&inflightStreams, 1) > binding.MaxInboundInflightStreamsPerConn {
l.Error("MaxInboundInflightStreamsPerConn exceeded", zap.String("ip", sc.RemoteAddr()))
if atomic.AddInt32(&inflightStreams, 1) > binding.MaxInboundInflightStreamPerConn {
l.Error("MaxInboundInflightStreamPerConn exceeded", zap.String("ip", sc.RemoteAddr()))
return
}
}
Expand Down

0 comments on commit 8d40445

Please sign in to comment.