fix for nil channel
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
This commit is contained in:
parent
a9b36a4d3a
commit
7915e89e38
@ -244,7 +244,9 @@ func Serve(ctx context.Context, ln net.Listener, cfg *ServerConfig) error {
|
|||||||
handlerLoop:
|
handlerLoop:
|
||||||
for _, h := range cfg.Handlers {
|
for _, h := range cfg.Handlers {
|
||||||
if err := h.Handle(conn); err != nil {
|
if err := h.Handle(conn); err != nil {
|
||||||
cfg.ErrorCh <- err
|
if cfg.ErrorCh != nil {
|
||||||
|
cfg.ErrorCh <- err
|
||||||
|
}
|
||||||
conn.Close()
|
conn.Close()
|
||||||
break handlerLoop
|
break handlerLoop
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user