From 9e281d40d04586972a7ee4c4caffa5c03666deb2 Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Wed, 25 Nov 2015 11:05:31 -0800 Subject: [PATCH] Remove usage of listenbuffer package It actually adds nothing to queuing requests. Signed-off-by: Alexander Morozov --- sockets/tcp_socket.go | 8 ++------ sockets/unix_socket.go | 7 ++----- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/sockets/tcp_socket.go b/sockets/tcp_socket.go index 9f8319d..6665a3b 100644 --- a/sockets/tcp_socket.go +++ b/sockets/tcp_socket.go @@ -7,17 +7,13 @@ import ( "net" "net/http" "time" - - "github.com/docker/docker/pkg/listenbuffer" ) // NewTCPSocket creates a TCP socket listener with the specified address and // and the specified tls configuration. If TLSConfig is set, will encapsulate the // TCP listener inside a TLS one. -// The channel passed is used to activate the listenbuffer when the caller is ready -// to accept connections. -func NewTCPSocket(addr string, tlsConfig *tls.Config, activate <-chan struct{}) (net.Listener, error) { - l, err := listenbuffer.NewListenBuffer("tcp", addr, activate) +func NewTCPSocket(addr string, tlsConfig *tls.Config) (net.Listener, error) { + l, err := net.Listen("tcp", addr) if err != nil { return nil, err } diff --git a/sockets/unix_socket.go b/sockets/unix_socket.go index a69c28b..c10aced 100644 --- a/sockets/unix_socket.go +++ b/sockets/unix_socket.go @@ -10,20 +10,17 @@ import ( "syscall" "github.com/Sirupsen/logrus" - "github.com/docker/docker/pkg/listenbuffer" "github.com/opencontainers/runc/libcontainer/user" ) // NewUnixSocket creates a unix socket with the specified path and group. -// The channel passed is used to activate the listenbuffer when the caller is ready -// to accept connections. -func NewUnixSocket(path, group string, activate <-chan struct{}) (net.Listener, error) { +func NewUnixSocket(path, group string) (net.Listener, error) { if err := syscall.Unlink(path); err != nil && !os.IsNotExist(err) { return nil, err } mask := syscall.Umask(0777) defer syscall.Umask(mask) - l, err := listenbuffer.NewListenBuffer("unix", path, activate) + l, err := net.Listen("unix", path) if err != nil { return nil, err }