mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 08:49:29 +00:00
Merge b38effb7b0 into d3edc58ef7
This commit is contained in:
commit
85ac5f4211
1 changed files with 4 additions and 5 deletions
|
|
@ -502,6 +502,10 @@ func (h *handler) handleCallMsg(ctx *callProc, msg *jsonrpcMessage) *jsonrpcMess
|
|||
|
||||
// handleCall processes method calls.
|
||||
func (h *handler) handleCall(cp *callProc, msg *jsonrpcMessage) *jsonrpcMessage {
|
||||
// Check method name length
|
||||
if len(msg.Method) > maxMethodNameLength {
|
||||
return msg.errorResponse(&invalidRequestError{fmt.Sprintf("method name too long: %d > %d", len(msg.Method), maxMethodNameLength)})
|
||||
}
|
||||
if msg.isSubscribe() {
|
||||
return h.handleSubscribe(cp, msg)
|
||||
}
|
||||
|
|
@ -512,11 +516,6 @@ func (h *handler) handleCall(cp *callProc, msg *jsonrpcMessage) *jsonrpcMessage
|
|||
}
|
||||
return h.runMethod(cp.ctx, msg, h.unsubscribeCb, args)
|
||||
}
|
||||
|
||||
// Check method name length
|
||||
if len(msg.Method) > maxMethodNameLength {
|
||||
return msg.errorResponse(&invalidRequestError{fmt.Sprintf("method name too long: %d > %d", len(msg.Method), maxMethodNameLength)})
|
||||
}
|
||||
callb, service, method := h.reg.callback(msg.Method)
|
||||
|
||||
// If the method is not found, return an error.
|
||||
|
|
|
|||
Loading…
Reference in a new issue