From 6dfa8d22e34da6808e0923f4de12bcc5a1321cce Mon Sep 17 00:00:00 2001 From: crusader Date: Wed, 20 Sep 2017 14:25:52 +0900 Subject: [PATCH] OnConnection changed to OnConnect --- server.go | 6 +++--- server_handler.go | 2 +- server_handlers.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server.go b/server.go index 01e22c5..c47eadf 100644 --- a/server.go +++ b/server.go @@ -81,7 +81,7 @@ func (s *server) onDisconnected(soc Socket) { s._sh.OnDisconnected(soc) } -func (s *server) onConnection(ctx *fasthttp.RequestCtx) { +func (s *server) onConnect(ctx *fasthttp.RequestCtx) { path := string(ctx.Path()) co, ok := s._handlers[path] if !ok { @@ -89,7 +89,7 @@ func (s *server) onConnection(ctx *fasthttp.RequestCtx) { return } - if !s._sh.OnConnection(ctx) { + if !s._sh.OnConnect(ctx) { ctx.Error(http.StatusText(http.StatusNotAcceptable), http.StatusNotAcceptable) return } @@ -140,5 +140,5 @@ func (s *server) HandleSocket(pattern string, soch SocketHandler) { func (s *server) ListenAndServe(addr string) error { go s.listenHandler() - return fasthttp.ListenAndServe(addr, s.onConnection) + return fasthttp.ListenAndServe(addr, s.onConnect) } diff --git a/server_handler.go b/server_handler.go index 3441234..43b6ee6 100644 --- a/server_handler.go +++ b/server_handler.go @@ -12,7 +12,7 @@ type ServerHandler interface { GetWriteBufferSize() int GetEnableCompression() bool - OnConnection(ctx *fasthttp.RequestCtx) bool + OnConnect(ctx *fasthttp.RequestCtx) bool OnConnected(soc Socket) OnDisconnected(soc Socket) OnCheckOrigin(ctx *fasthttp.RequestCtx) bool diff --git a/server_handlers.go b/server_handlers.go index 5018ff8..5ae18a3 100644 --- a/server_handlers.go +++ b/server_handlers.go @@ -42,7 +42,7 @@ func (sh *ServerHandlers) GetEnableCompression() bool { return sh.EnableCompression } -func (sh *ServerHandlers) OnConnection(ctx *fasthttp.RequestCtx) bool { +func (sh *ServerHandlers) OnConnect(ctx *fasthttp.RequestCtx) bool { return true }