fix the tunnel execution
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -146,6 +146,7 @@ func (s *rpcServer) ServeConn(sock transport.Socket) {
|
||||
body: msg.Body,
|
||||
socket: sock,
|
||||
stream: true,
|
||||
first: true,
|
||||
}
|
||||
|
||||
// internal response
|
||||
|
||||
Reference in New Issue
Block a user