commit febb4936f6cf1d066ef87a936e3f92d28c4295e1
Author: David Fifield <david(a)bamsoftware.com>
Date: Tue Dec 24 19:02:01 2019 -0700
Refactor SOCKS-related logging.
---
client/snowflake.go | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/client/snowflake.go b/client/snowflake.go
index b807c8d..1d7907b 100644
--- a/client/snowflake.go
+++ b/client/snowflake.go
@@ -47,9 +47,7 @@ func ConnectLoop(snowflakes sf.SnowflakeCollector) {
// Accept local SOCKS connections and pass them to the handler.
func socksAcceptLoop(ln *pt.SocksListener, snowflakes sf.SnowflakeCollector) {
defer ln.Close()
- log.Println("Started SOCKS listener.")
for {
- log.Println("SOCKS listening...")
conn, err := ln.AcceptSocks()
if err != nil {
if err, ok := err.(net.Error); ok && err.Temporary() {
@@ -58,7 +56,7 @@ func socksAcceptLoop(ln *pt.SocksListener, snowflakes sf.SnowflakeCollector) {
log.Printf("SOCKS accept error: %s", err)
break
}
- log.Println("SOCKS accepted: ", conn.Req)
+ log.Printf("SOCKS accepted: %v", conn.Req)
err = sf.Handler(conn, snowflakes)
if err != nil {
log.Printf("handler error: %s", err)
@@ -167,6 +165,7 @@ func main() {
pt.CmethodError(methodName, err.Error())
break
}
+ log.Printf("Started SOCKS listener at %v.", ln.Addr())
go socksAcceptLoop(ln, snowflakes)
pt.Cmethod(methodName, ln.Version(), ln.Addr())
listeners = append(listeners, ln)