mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-18 08:26:38 +02:00
Fix panic in httpTransportClient.Recv (#2530)
* [fix] http transport can send when wait for recv * [fix] http transport can send multiple message and recevie them. Do not block send and receive on stream mode * [fix] http transport can close the connection when recv is in progress, add tests * [fix] Read buff before reset it, when the connection is closed Co-authored-by: Hunyadvári Péter <peter.hunyadvari@vcc.live>
This commit is contained in:
parent
ec6a47c894
commit
48ba9f91b4
@ -159,13 +159,14 @@ func (h *httpTransportClient) Recv(m *Message) error {
|
||||
return io.EOF
|
||||
}
|
||||
rsp, err := http.ReadResponse(h.buff, r)
|
||||
h.Unlock()
|
||||
if err != nil {
|
||||
h.Unlock()
|
||||
return err
|
||||
}
|
||||
defer rsp.Body.Close()
|
||||
|
||||
b, err := ioutil.ReadAll(rsp.Body)
|
||||
h.Unlock()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user