MCPcopy Create free account
hub / github.com/CPChain/chain / ReadRequestHeaders

Method ReadRequestHeaders

api/rpc/json.go:139–151  ·  view source on GitHub ↗

ReadRequestHeaders will read new requests without parsing the arguments. It will return a collection of requests, an indication if these requests are in batch form or an error when the incoming message could not be read/parsed.

()

Source from the content-addressed store, hash-verified

137// return a collection of requests, an indication if these requests are in batch
138// form or an error when the incoming message could not be read/parsed.
139func (c *jsonCodec) ReadRequestHeaders() ([]rpcRequest, bool, Error) {
140 c.decMu.Lock()
141 defer c.decMu.Unlock()
142
143 var incomingMsg json.RawMessage
144 if err := c.decode(&incomingMsg); err != nil {
145 return nil, false, &invalidRequestError{err.Error()}
146 }
147 if isBatch(incomingMsg) {
148 return parseBatchRequest(incomingMsg)
149 }
150 return parseRequest(incomingMsg)
151}
152
153// checkReqId returns an error when the given reqId isn't valid for RPC method calls.
154// valid id's are strings, numbers or null

Callers

nothing calls this directly

Calls 7

isBatchFunction · 0.85
parseBatchRequestFunction · 0.85
parseRequestFunction · 0.85
LockMethod · 0.80
UnlockMethod · 0.80
decodeMethod · 0.80
ErrorMethod · 0.65

Tested by

no test coverage detected