ing
This commit is contained in:
parent
acbc1b22be
commit
94951d541a
|
@ -343,7 +343,7 @@ func (c *Client) Dial() (*server.Conn, *http.Response, error) {
|
|||
}
|
||||
|
||||
func (c *Client) Validate() error {
|
||||
if err := c.ClientConnectionHandlers.Validate(); nil != err {
|
||||
if err := c.ClientConnHandlers.Validate(); nil != err {
|
||||
return err
|
||||
}
|
||||
if err := c.ReadWriteHandlers.Validate(); nil != err {
|
||||
|
|
|
@ -19,7 +19,7 @@ type Server struct {
|
|||
stopChan chan struct{}
|
||||
stopWg sync.WaitGroup
|
||||
|
||||
srwch server.ServerRWCHandler
|
||||
srw server.ServerReadWriter
|
||||
|
||||
hs *fasthttp.Server
|
||||
upgrader *Upgrader
|
||||
|
@ -73,9 +73,9 @@ func (s *Server) ListenAndServe() error {
|
|||
|
||||
s.stopChan = make(chan struct{})
|
||||
|
||||
s.srwch.ReadwriteHandler = s.ServerHandler
|
||||
s.srwch.ServerStopChan = s.stopChan
|
||||
s.srwch.ServerStopWg = &s.stopWg
|
||||
s.srw.ReadwriteHandler = s.ServerHandler
|
||||
s.srw.ServerStopChan = s.stopChan
|
||||
s.srw.ServerStopWg = &s.stopWg
|
||||
|
||||
s.stopWg.Add(1)
|
||||
return s.handleServer(listener)
|
||||
|
@ -157,7 +157,7 @@ func (s *Server) httpHandler(ctx *fasthttp.RequestCtx) {
|
|||
)
|
||||
|
||||
if 0 < s.ServerHandler.GetConcurrency() {
|
||||
sz := s.srwch.ConnectionSize()
|
||||
sz := s.srw.ConnectionSize()
|
||||
if sz >= s.ServerHandler.GetConcurrency() {
|
||||
logging.Logger().Warnf(s.serverMessage(fmt.Sprintf("max connections size %d, refuse", sz)))
|
||||
s.onError(ctx, fasthttp.StatusServiceUnavailable, err)
|
||||
|
@ -185,7 +185,7 @@ func (s *Server) httpHandler(ctx *fasthttp.RequestCtx) {
|
|||
}
|
||||
|
||||
s.stopWg.Add(1)
|
||||
go s.srwch.HandleConnection(servlet, servletCtx, conn)
|
||||
go s.srw.HandleConnection(servlet, servletCtx, conn)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ func (c *Client) Dial() (net.Conn, error) {
|
|||
}
|
||||
|
||||
func (c *Client) Validate() error {
|
||||
if err := c.ClientConnectionHandlers.Validate(); nil != err {
|
||||
if err := c.ClientConnHandlers.Validate(); nil != err {
|
||||
return err
|
||||
}
|
||||
if err := c.ReadWriteHandlers.Validate(); nil != err {
|
||||
|
|
Loading…
Reference in New Issue
Block a user