fix the tunnel execution

This commit is contained in:
Asim Aslam
2019-08-11 18:11:33 +01:00
parent 113d87d855
commit d0d729a789
5 changed files with 34 additions and 6 deletions

View File

@@ -16,6 +16,7 @@ type rpcRequest struct {
body []byte
rawBody interface{}
stream bool
first bool
}
type rpcMessage struct {
@@ -54,9 +55,9 @@ func (r *rpcRequest) Body() interface{} {
func (r *rpcRequest) Read() ([]byte, error) {
// got a body
if r.body != nil {
if r.first {
b := r.body
r.body = nil
r.first = false
return b, nil
}

View File

@@ -146,6 +146,7 @@ func (s *rpcServer) ServeConn(sock transport.Socket) {
body: msg.Body,
socket: sock,
stream: true,
first: true,
}
// internal response