Skip to content

Commit

Permalink
Merge pull request #76 from marcel-dancak/main
Browse files Browse the repository at this point in the history
possible fix of invalid memory address dereference (#74 and #48)
  • Loading branch information
yookoala authored Aug 3, 2022
2 parents 8fd9156 + 8884676 commit f049dc0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@ func (c *client) readResponse(ctx context.Context, resp *ResponsePipe, req *Requ
done := make(chan int)

// readloop in goroutine
go func() {
go func(rwc io.ReadWriteCloser) {
readLoop:
for {
if err := rec.read(c.conn.rwc); err != nil {
if err := rec.read(rwc); err != nil {
break
}

Expand All @@ -228,7 +228,7 @@ func (c *client) readResponse(ctx context.Context, resp *ResponsePipe, req *Requ
}
}
close(done)
}()
}(c.conn.rwc)

select {
case <-ctx.Done():
Expand Down

0 comments on commit f049dc0

Please sign in to comment.