diff --git a/cmd/lotus-storage-miner/run.go b/cmd/lotus-storage-miner/run.go index 1cc209532..42a26eb23 100644 --- a/cmd/lotus-storage-miner/run.go +++ b/cmd/lotus-storage-miner/run.go @@ -76,7 +76,7 @@ var runCmd = &cli.Command{ ah := &auth.Handler{ Verify: minerapi.AuthVerify, - Next: rpcServer.ServeHTTP, + Next: rpcServer.ServeHTTP, } http.Handle("/rpc/v0", ah) diff --git a/cmd/lotus/rpc.go b/cmd/lotus/rpc.go index a0be6ecbe..68ac13c87 100644 --- a/cmd/lotus/rpc.go +++ b/cmd/lotus/rpc.go @@ -14,7 +14,7 @@ func serveRPC(a api.FullNode, addr string) error { ah := &auth.Handler{ Verify: a.AuthVerify, - Next: rpcServer.ServeHTTP, + Next: rpcServer.ServeHTTP, } http.Handle("/rpc/v0", ah) diff --git a/lib/jsonrpc/client.go b/lib/jsonrpc/client.go index 448418c67..9d1053222 100644 --- a/lib/jsonrpc/client.go +++ b/lib/jsonrpc/client.go @@ -67,7 +67,7 @@ type client struct { namespace string requests chan clientRequest - idCtr int64 + idCtr int64 } // NewMergeClient is like NewClient, but allows to specify multiple structs @@ -143,7 +143,7 @@ func (c *client) makeOutChan(ctx context.Context, ftyp reflect.Type, valOut int) } ch.Send(val.Elem()) // todo: select on ctx is probably a good idea - } + } } return func() reflect.Value { return retVal }, chCtor @@ -192,12 +192,12 @@ type rpcFunc struct { ftyp reflect.Type name string - nout int + nout int valOut int errOut int hasCtx int - retCh bool + retCh bool } func (fn *rpcFunc) processResponse(resp clientResponse, rval reflect.Value) []reflect.Value { @@ -290,8 +290,8 @@ func (c *client) makeRpcFunc(f reflect.StructField) (reflect.Value, error) { fun := &rpcFunc{ client: c, - ftyp: ftyp, - name: f.Name, + ftyp: ftyp, + name: f.Name, } fun.valOut, fun.errOut, fun.nout = processFuncOut(ftyp) diff --git a/lib/jsonrpc/server.go b/lib/jsonrpc/server.go index 18d2da48f..4468c53c4 100644 --- a/lib/jsonrpc/server.go +++ b/lib/jsonrpc/server.go @@ -42,7 +42,6 @@ func (s *RPCServer) handleWS(ctx context.Context, w http.ResponseWriter, r *http w.Header().Set("Sec-WebSocket-Protocol", r.Header.Get("Sec-WebSocket-Protocol")) } - c, err := upgrader.Upgrade(w, r, nil) if err != nil { log.Error(err)