Browse Source

Don't allocate unnecessary FragmentorConn

Rod Hynes 7 years ago
parent
commit
b92b511c3d
1 changed files with 4 additions and 0 deletions
  1. 4 0
      psiphon/fragmentor.go

+ 4 - 0
psiphon/fragmentor.go

@@ -89,6 +89,10 @@ func DialTCPFragmentor(
 		NoticeAlert("MakeSecureRandomRange failed: %s", common.ContextError(err))
 	}
 
+	if totalBytes == 0 {
+		return conn, nil
+	}
+
 	runCtx, stopRunning := context.WithCancel(context.Background())
 
 	return &FragmentorConn{