[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit 0abb3bd8567aa4dd902030a896ec6edba5b68518
Author: Arlo Breault <arlolra@xxxxxxxxx>
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)
 

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits