[Popcon-commits] cvs commit to popularity-contest by pere

popcon-commits@lists.alioth.debian.org popcon-commits@lists.alioth.debian.org
Sun, 03 Jul 2005 10:50:00 +0000


Update of /cvsroot/popcon/popularity-contest
In directory haydn:/tmp/cvs-serv4942

Modified Files:
	popcon-upload 
Log Message:
Added 30 second timeout in the http upload script.

Index: popcon-upload
===================================================================
RCS file: /cvsroot/popcon/popularity-contest/popcon-upload,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- popcon-upload	2 Jul 2005 17:18:05 -0000	1.1
+++ popcon-upload	3 Jul 2005 10:49:57 -0000	1.2
@@ -34,6 +34,10 @@
 close(GZIP);
 $len = length($str);
 
+# 30 second timeout on http connections
+$SIG{ALRM} = sub { die "timeout\n" };
+alarm(30);
+
 # Connect to server
 $remote = IO::Socket::INET->new(Proto => "tcp", PeerAddr => $proxy, 
                                                 PeerPort => $port);