Lint fixes
This commit is contained in:
parent
3fca70f112
commit
661043f5c8
@ -35,9 +35,13 @@ func (s *RPCServer) handleWS(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(500)
|
||||
return
|
||||
}
|
||||
defer c.Close()
|
||||
|
||||
handleWsConn(r.Context(), c, s.methods, nil, nil)
|
||||
|
||||
if err := c.Close(); err != nil {
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: return errors to clients per spec
|
||||
|
@ -137,11 +137,10 @@ func handleWsConn(ctx context.Context, conn *websocket.Conn, handler handlers, r
|
||||
nw := func(cb func(io.Writer)) {
|
||||
cb(ioutil.Discard)
|
||||
}
|
||||
done := func(){}
|
||||
done := cf
|
||||
if frame.ID != nil {
|
||||
nw = nextWriter
|
||||
|
||||
|
||||
handlingLk.Lock()
|
||||
handling[*frame.ID] = cf
|
||||
handlingLk.Unlock()
|
||||
@ -150,7 +149,6 @@ func handleWsConn(ctx context.Context, conn *websocket.Conn, handler handlers, r
|
||||
handlingLk.Lock()
|
||||
defer handlingLk.Unlock()
|
||||
|
||||
cf := handling[*frame.ID]
|
||||
cf()
|
||||
delete(handling, *frame.ID)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user