mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-19 17:26:28 +00:00
logread: do not close socket too early
only close socket once reading is finished Signed-off-by: Christoph Ostarek <christoph@zededa.com>
This commit is contained in:
parent
3a0405298a
commit
cc374a5ea8
@ -67,7 +67,6 @@ func StreamLogs(socketPath string, follow, dump bool) (<-chan LogEntry, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
var n int
|
||||
switch {
|
||||
@ -85,6 +84,7 @@ func StreamLogs(socketPath string, follow, dump bool) (<-chan LogEntry, error) {
|
||||
|
||||
c := make(chan LogEntry)
|
||||
go func(c chan<- LogEntry) {
|
||||
defer conn.Close()
|
||||
var (
|
||||
entry LogEntry
|
||||
decoder = json.NewDecoder(conn)
|
||||
|
Loading…
Reference in New Issue
Block a user