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

[or-cvs] r17875: {torflow} Fix for redirection for non-bash bourne shells by Karsten. (torflow/trunk)



Author: mikeperry
Date: 2009-01-04 09:14:29 -0500 (Sun, 04 Jan 2009)
New Revision: 17875

Modified:
   torflow/trunk/speedracer.pl
Log:

Fix for redirection for non-bash bourne shells by Karsten.



Modified: torflow/trunk/speedracer.pl
===================================================================
--- torflow/trunk/speedracer.pl	2009-01-04 14:11:28 UTC (rev 17874)
+++ torflow/trunk/speedracer.pl	2009-01-04 14:14:29 UTC (rev 17875)
@@ -11,12 +11,9 @@
 
 my $USER_AGENT = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)";
 
-my $SOCKS_PROXY = "127.0.0.1:9060";
-my $CURL_PROXY = "--socks5 $SOCKS_PROXY";
-
 # http://bitter.stalin.se/torfile
 # http://www.sigma.su.se/~who/torfile
-my $URL = "http://bitter.stalin.se/torfile1";; 
+my $URL = "https://svn.torproject.org/svn/tor/trunk/doc/design-paper/roadmap-future.pdf";; 
 my $COUNT = 200;
 my $START_PCT = 0;
 my $STOP_PCT = 80;
@@ -36,7 +33,7 @@
     $year += 1900; # lame.
     $mon += 1;
     
-    print "$level \[" . localtime() . "\]: " . $msg if($log_levels{$level} >= $log_levels{$LOG_LEVEL})
+    print "$level \[" . localtime() . "\]: " . $msg if($msg && $log_levels{$level} >= $log_levels{$LOG_LEVEL})
     #print "$level\[$year-$mon-$mday $hour:$min:$sec\]: " . $msg if($log_levels{$level} >= $log_levels{$LOG_LEVEL})
 }
 
@@ -122,7 +119,7 @@
             
             $t0 = [gettimeofday()];
             $ret = 
-                system("tsocks wget -U \"$USER_AGENT\" \'$URL\' -O - >& /dev/null");
+                system("tsocks wget -U \"$USER_AGENT\" \'$URL\' -O - 2>&1 > /dev/null");
 #                system("curl $CURL_PROXY -m 600 -A \"$USER_AGENT\" \'$URL\' >& /dev/null");
 
             if($ret == 2) {
@@ -148,7 +145,7 @@
                 $i++;
                 $t0 = [gettimeofday()];
                 $ret = 
-                system("tsocks wget -U \"$USER_AGENT\" \'$URL\' -O - >& /dev/null");
+                system("tsocks wget -U \"$USER_AGENT\" \'$URL\' -O - 2>&1 > /dev/null");
 #                    system("curl $CURL_PROXY -m 600 -A \"$USER_AGENT\" \'$URL\' >& /dev/null");
 
                 if($ret == 2) {