mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 18:37:45 +08:00
commands/http: client: Close output channel on decoder EOF
This commit is contained in:
parent
0452a5f75e
commit
5d3bc652cb
@ -150,10 +150,12 @@ func getResponse(httpRes *http.Response, req cmds.Request) (cmds.Response, error
|
||||
|
||||
for {
|
||||
err := dec.Decode(&v)
|
||||
if err != nil {
|
||||
if err != io.EOF {
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
if err != nil && err != io.EOF {
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
if err == io.EOF {
|
||||
close(outChan)
|
||||
return
|
||||
}
|
||||
outChan <- v
|
||||
|
||||
Loading…
Reference in New Issue
Block a user