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.
()
| 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. |
| 139 | func (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 |
nothing calls this directly
no test coverage detected