From f7cd07b3cc2a11ec9263cb3f6485cba7677f010c Mon Sep 17 00:00:00 2001 From: crusader Date: Fri, 27 Oct 2017 14:24:46 +0900 Subject: [PATCH] ing --- protocol/codec.go | 2 ++ protocol/json/server.go | 2 -- registry.go | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/protocol/codec.go b/protocol/codec.go index cad843a..02f7642 100644 --- a/protocol/codec.go +++ b/protocol/codec.go @@ -10,6 +10,8 @@ import ( // Codec creates a CodecRequest to process each request. type Codec interface { + // NewRequest is constructor of new request object + // error io.ErrUnexpectedEOF or io.EOF NewRequest(rc io.Reader) (CodecRequest, error) } diff --git a/protocol/json/server.go b/protocol/json/server.go index cd80a00..6327a8f 100644 --- a/protocol/json/server.go +++ b/protocol/json/server.go @@ -3,7 +3,6 @@ package json import ( "encoding/json" "io" - "log" "git.loafle.net/commons_go/rpc/encode" "git.loafle.net/commons_go/rpc/protocol" @@ -86,7 +85,6 @@ func newCodecRequest(r io.Reader, encoder encode.Encoder) (protocol.CodecRequest req := new(serverRequest) err := json.NewDecoder(r).Decode(req) if err == io.ErrUnexpectedEOF || err == io.EOF { - log.Printf("NewRequest err: %v", err) return nil, err } if err != nil { diff --git a/registry.go b/registry.go index 25ce4b4..5135e30 100644 --- a/registry.go +++ b/registry.go @@ -3,7 +3,6 @@ package rpc import ( "fmt" "io" - "log" "reflect" "strings" @@ -99,19 +98,16 @@ func (rr *rpcRegistry) Invoke(contentType string, r io.Reader, w io.Writer, befo return fmt.Errorf("Unrecognized Content-Type: %s", contentType) } - log.Print("codec.NewRequest") // Create a new codec request. codecReq, errNew := codec.NewRequest(r) if nil != errNew { return errNew } // Get service method to be called. - log.Printf("codecReq.Method: %v", codecReq) method, errMethod := codecReq.Method() if errMethod != nil { return write(codecReq, w, beforeWrite, afterWrite, nil, errMethod) } - log.Print("rr.services.get") serviceSpec, methodSpec, errGet := rr.services.get(method) if errGet != nil { return write(codecReq, w, beforeWrite, afterWrite, nil, errGet)