mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-05-04 06:28:02 +00:00
Previously we had a per-connection bytes.Buffer // to be written to the connection sync.Cond // to allow us to Wait for more data This had the major disadvantage that the buffer was unbounded and so a slow client could cause memory exhaustion in the server. This patch replaces these with a single chan *logEntry which is naturally bounded and supports blocking read. We make write non-blocking using select i.e. we drop messages rather than allocate more space. Signed-off-by: David Scott <dave.scott@docker.com>