From 991142cd5737d2a667bfc3f249ac899b3b548c1b Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Fri, 16 Aug 2019 14:42:45 +0100 Subject: [PATCH] No need to set request in the buffer --- server/rpc_codec.go | 2 +- server/rpc_server.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server/rpc_codec.go b/server/rpc_codec.go index ff2e4261..19cdc564 100644 --- a/server/rpc_codec.go +++ b/server/rpc_codec.go @@ -154,7 +154,7 @@ func setupProtocol(msg *transport.Message) codec.NewCodec { func newRpcCodec(req *transport.Message, socket transport.Socket, c codec.NewCodec) codec.Codec { rwc := &readWriteCloser{ - rbuf: bytes.NewBuffer(req.Body), + rbuf: bytes.NewBuffer(nil), wbuf: bytes.NewBuffer(nil), } r := &rpcCodec{ diff --git a/server/rpc_server.go b/server/rpc_server.go index 0b9883c2..5fb4af29 100644 --- a/server/rpc_server.go +++ b/server/rpc_server.go @@ -81,12 +81,13 @@ func (s *rpcServer) ServeConn(sock transport.Socket) { return } - // use Micro-Id as the stream identifier + // use Micro-Stream as the stream identifier // in the event its blank we'll always process // on the same socket id := msg.Header["Micro-Stream"] // if there's no stream id then its a standard request + // use the Micro-Id if len(id) == 0 { id = msg.Header["Micro-Id"] }