ing
This commit is contained in:
parent
cbd9ce0150
commit
9f519e728e
|
@ -3,6 +3,7 @@ package json
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"io"
|
"io"
|
||||||
|
"log"
|
||||||
|
|
||||||
"git.loafle.net/commons_go/rpc/encode"
|
"git.loafle.net/commons_go/rpc/encode"
|
||||||
"git.loafle.net/commons_go/rpc/protocol"
|
"git.loafle.net/commons_go/rpc/protocol"
|
||||||
|
@ -84,6 +85,7 @@ func newCodecRequest(r io.Reader, encoder encode.Encoder) protocol.CodecRequest
|
||||||
// Decode the request body and check if RPC method is valid.
|
// Decode the request body and check if RPC method is valid.
|
||||||
req := new(serverRequest)
|
req := new(serverRequest)
|
||||||
err := json.NewDecoder(r).Decode(req)
|
err := json.NewDecoder(r).Decode(req)
|
||||||
|
log.Printf("NewRequest err: %v", err)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = &Error{
|
err = &Error{
|
||||||
Code: E_PARSE,
|
Code: E_PARSE,
|
||||||
|
|
|
@ -103,7 +103,7 @@ func (rr *rpcRegistry) Invoke(contentType string, r io.Reader, w io.Writer, befo
|
||||||
// Create a new codec request.
|
// Create a new codec request.
|
||||||
codecReq := codec.NewRequest(r)
|
codecReq := codec.NewRequest(r)
|
||||||
// Get service method to be called.
|
// Get service method to be called.
|
||||||
log.Print("codecReq.Method")
|
log.Printf("codecReq.Method: %v", codecReq)
|
||||||
method, errMethod := codecReq.Method()
|
method, errMethod := codecReq.Method()
|
||||||
if errMethod != nil {
|
if errMethod != nil {
|
||||||
return write(codecReq, w, beforeWrite, afterWrite, nil, errMethod)
|
return write(codecReq, w, beforeWrite, afterWrite, nil, errMethod)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user