1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-30 10:10:44 +02:00

[fix] http transport deadlock (#2441)

Co-authored-by: Hunyadvári Péter <peter.hunyadvari@vcc.live>
This commit is contained in:
Ak-Army 2022-02-24 10:32:09 +01:00 committed by GitHub
parent 4154ed6a80
commit dca3a3b553
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -141,6 +141,7 @@ func (h *httpTransportClient) Recv(m *Message) error {
h.Lock()
if h.closed {
h.Unlock()
return io.EOF
}
rsp, err := http.ReadResponse(h.buff, r)

View File

@ -1,7 +1,6 @@
package transport
import (
"fmt"
"io"
"net"
"sync"
@ -303,11 +302,11 @@ func TestHTTPTransportCloseWhenRecv(t *testing.T) {
if err := c.Recv(&rm); err != nil {
if err == io.EOF {
c.Recv(&rm)
return
}
t.Errorf("Unexpected recv err: %v", err)
}
fmt.Println("aa")
}
}()
for i := 1; i < 3; i++ {