[tor-commits] [snowflake/master] Skip creating the named pipe on the client if we're using http signaling

arlo at torproject.org arlo at torproject.org
Wed Jan 20 05:47:00 UTC 2016


commit 0abb3bd8567aa4dd902030a896ec6edba5b68518
Author: Arlo Breault <arlolra at gmail.com>
Date:   Tue Jan 19 21:44:23 2016 -0800

    Skip creating the named pipe on the client if we're using http signaling
    
     * Blocks waiting on the open for write (`cat > signal`), at least for me.
---
 client/snowflake.go |   22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/client/snowflake.go b/client/snowflake.go
index 61fd46c..076080d 100644
--- a/client/snowflake.go
+++ b/client/snowflake.go
@@ -331,19 +331,21 @@ func main() {
 
 	log.Println("starting")
 
-	// This FIFO receives signaling messages.
-	err = syscall.Mkfifo("signal", 0600)
-	if err != nil {
-		if err.(syscall.Errno) != syscall.EEXIST {
+	if offerURL == "" {
+		// This FIFO receives signaling messages.
+		err = syscall.Mkfifo("signal", 0600)
+		if err != nil {
+			if err.(syscall.Errno) != syscall.EEXIST {
+				log.Fatal(err)
+			}
+		}
+		signalFile, err := os.OpenFile("signal", os.O_RDONLY, 0600)
+		if err != nil {
 			log.Fatal(err)
 		}
+		defer signalFile.Close()
+		go readSignalingMessages(signalFile)
 	}
-	signalFile, err := os.OpenFile("signal", os.O_RDONLY, 0600)
-	if err != nil {
-		log.Fatal(err)
-	}
-	defer signalFile.Close()
-	go readSignalingMessages(signalFile)
 
 	webrtc.SetLoggingVerbosity(1)
 



More information about the tor-commits mailing list