[tor-commits] [flashproxy/master] Flush stdout after each PT line.

dcf at torproject.org dcf at torproject.org
Wed Jul 17 18:22:50 UTC 2013


commit 17c412fb385708e31c44f8eca9a5779305f4a7f3
Author: David Fifield <david at bamsoftware.com>
Date:   Wed Jul 17 10:47:15 2013 -0700

    Flush stdout after each PT line.
    
    This hadn't been causing a problem when websocket-server was run
    directly by Tor, but I tried running websocket-server as a shell
    subprocess, and the shell wasn't seeing its PT negotiation.
---
 websocket-transport/pt.go |    1 +
 1 file changed, 1 insertion(+)

diff --git a/websocket-transport/pt.go b/websocket-transport/pt.go
index 0ff1644..1319198 100644
--- a/websocket-transport/pt.go
+++ b/websocket-transport/pt.go
@@ -89,6 +89,7 @@ func PtLine(keyword string, v ...string) {
 		buf.WriteString(" " + escape(x))
 	}
 	fmt.Println(buf.String())
+	os.Stdout.Sync()
 }
 
 // All of the Pt*Error functions call os.Exit(1).



More information about the tor-commits mailing list