mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-24 10:07:04 +02:00
only continue to stream when its a stream
This commit is contained in:
parent
58bc4c103f
commit
5a5b1b8f6e
@ -42,6 +42,11 @@ type Proxy struct {
|
||||
|
||||
// read client request and write to server
|
||||
func readLoop(r server.Request, s client.Stream) error {
|
||||
// we don't loop unless its a stream
|
||||
if !r.Stream() {
|
||||
return nil
|
||||
}
|
||||
|
||||
// request to backend server
|
||||
req := s.Request()
|
||||
|
||||
@ -266,6 +271,11 @@ func (p *Proxy) ServeRequest(ctx context.Context, req server.Request, rsp server
|
||||
} else if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// we don't continue unless its a stream
|
||||
if !req.Stream() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user