From 2f75863ba9bff2d2f3488b70e441b5eefc91dfd2 Mon Sep 17 00:00:00 2001 From: Ondrej Fabry Date: Tue, 5 Nov 2019 00:16:25 +0100 Subject: Begin development of next release 0.3.0 - update info in package ./version - update to Go 1.13 - regenerate ./examples/binapi for latest VPP: 19.08.1-release - clean code in proxy - refactor Makefile Change-Id: Ibf5c2682c2f4b3cbbea4aa1e35d3f02175d40a9b Signed-off-by: Ondrej Fabry --- proxy/client.go | 2 +- proxy/log.go | 5 +++-- proxy/proxy.go | 3 ++- proxy/server.go | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) (limited to 'proxy') diff --git a/proxy/client.go b/proxy/client.go index 7f92946..6f29c71 100644 --- a/proxy/client.go +++ b/proxy/client.go @@ -16,12 +16,12 @@ package proxy import ( "fmt" - "git.fd.io/govpp.git/core" "net/rpc" "reflect" "time" "git.fd.io/govpp.git/api" + "git.fd.io/govpp.git/core" ) type Client struct { diff --git a/proxy/log.go b/proxy/log.go index 2810528..d53e532 100644 --- a/proxy/log.go +++ b/proxy/log.go @@ -1,8 +1,9 @@ package proxy import ( - "github.com/sirupsen/logrus" "os" + + "github.com/sirupsen/logrus" ) var ( @@ -27,4 +28,4 @@ func SetLogger(l *logrus.Logger) { // SetLogLevel sets global logger level to lvl. func SetLogLevel(lvl logrus.Level) { log.Level = lvl -} \ No newline at end of file +} diff --git a/proxy/proxy.go b/proxy/proxy.go index 33cf05f..6656ee5 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -83,10 +83,11 @@ func (p *Server) ListenAndServe(addr string) error { l, e := net.Listen("tcp", addr) if e != nil { - return fmt.Errorf("listen error:", e) + return fmt.Errorf("listen failed: %v", e) } defer l.Close() log.Printf("proxy serving on: %v", addr) + return http.Serve(l, nil) } diff --git a/proxy/server.go b/proxy/server.go index ecb0e8d..472ad16 100644 --- a/proxy/server.go +++ b/proxy/server.go @@ -92,7 +92,7 @@ func (s *StatsRPC) watchConnection() { s.mu.Lock() if err := s.statsConn.GetSystemStats(prev); err != nil { atomic.StoreUint32(&s.available, 0) - log.Warnf("disabling statsRPC service, reason:", err) + log.Warnf("disabling statsRPC service, reason: %v", err) } s.mu.Unlock() @@ -110,7 +110,7 @@ func (s *StatsRPC) watchConnection() { s.mu.Lock() if err := s.statsConn.GetSystemStats(curr); err != nil { atomic.StoreUint32(&s.available, 0) - log.Warnf("disabling statsRPC service, reason:", err) + log.Warnf("disabling statsRPC service, reason: %v", err) } s.mu.Unlock() -- cgit 1.2.3-korg