Ver Fonte

Fix: CompareAndSwap inputs were backwards, so hostname was never set

Rod Hynes há 11 anos atrás
pai
commit
36f9fb772f
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      psiphon/stats_conn.go

+ 1 - 1
psiphon/stats_conn.go

@@ -70,7 +70,7 @@ func (conn *StatsConn) Write(buffer []byte) (n int, err error) {
 	if n > 0 {
 		// If this is the first request, try to determine the hostname to associate
 		// with this connection.
-		if atomic.CompareAndSwapInt32(&conn.firstWrite, 0, 1) {
+		if atomic.CompareAndSwapInt32(&conn.firstWrite, 1, 0) {
 
 			hostname, ok := getHostname(buffer)
 			if ok {