mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-20 09:39:08 +00:00
Merge pull request #3968 from christoph-zededa/fix_logread_socket_closed_too_early
logread: do not close socket too early
This commit is contained in:
commit
59245e88e8
@ -67,7 +67,6 @@ func StreamLogs(socketPath string, follow, dump bool) (<-chan LogEntry, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer conn.Close()
|
|
||||||
|
|
||||||
var n int
|
var n int
|
||||||
switch {
|
switch {
|
||||||
@ -85,6 +84,7 @@ func StreamLogs(socketPath string, follow, dump bool) (<-chan LogEntry, error) {
|
|||||||
|
|
||||||
c := make(chan LogEntry)
|
c := make(chan LogEntry)
|
||||||
go func(c chan<- LogEntry) {
|
go func(c chan<- LogEntry) {
|
||||||
|
defer conn.Close()
|
||||||
var (
|
var (
|
||||||
entry LogEntry
|
entry LogEntry
|
||||||
decoder = json.NewDecoder(conn)
|
decoder = json.NewDecoder(conn)
|
||||||
|
Loading…
Reference in New Issue
Block a user