[llvm-commits] [llvm] r72532 - /llvm/trunk/utils/NewNightlyTest.pl
Daniel Dunbar
daniel at zuster.org
Thu May 28 11:31:40 PDT 2009
Author: ddunbar
Date: Thu May 28 13:31:40 2009
New Revision: 72532
URL: http://llvm.org/viewvc/llvm-project?rev=72532&view=rev
Log:
NightlyTest: Write "sentdata.txt" files and run the -submit-aux script before
sending data to the server.
- Otherwise if the server connection fails the external script never runs.
Also, create content before initiating connection to try and decrease time we
are connected to llvm.org.
Modified:
llvm/trunk/utils/NewNightlyTest.pl
Modified: llvm/trunk/utils/NewNightlyTest.pl
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/NewNightlyTest.pl?rev=72532&r1=72531&r2=72532&view=diff
==============================================================================
--- llvm/trunk/utils/NewNightlyTest.pl (original)
+++ llvm/trunk/utils/NewNightlyTest.pl Thu May 28 13:31:40 2009
@@ -445,14 +445,21 @@
$file = $_[1];
$variables=$_[2];
- $port=80;
- $socketaddr= sockaddr_in $port, inet_aton $host or die "Bad hostname\n";
- socket SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp') or
- die "Bad socket\n";
- connect SOCK, $socketaddr or die "Bad connection\n";
- select((select(SOCK), $| = 1)[0]);
+ # Write out the "...-sentdata.txt" file.
+
+ my $sentdata="";
+ foreach $x (keys (%$variables)){
+ $value = $variables->{$x};
+ $sentdata.= "$x => $value\n";
+ }
+ WriteFile "$Prefix-sentdata.txt", $sentdata;
+
+ if (!($SUBMITAUX eq "")) {
+ system "$SUBMITAUX \"$Prefix-sentdata.txt\"";
+ }
+
+ # Create the content to send to the server.
- #creating content here
my $content;
foreach $key (keys (%$variables)){
$value = $variables->{$key};
@@ -460,6 +467,17 @@
$content .= "$key=$value&";
}
+ # Send the data to the server.
+ #
+ # FIXME: This code should be more robust?
+
+ $port=80;
+ $socketaddr= sockaddr_in $port, inet_aton $host or die "Bad hostname\n";
+ socket SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp') or
+ die "Bad socket\n";
+ connect SOCK, $socketaddr or die "Bad connection\n";
+ select((select(SOCK), $| = 1)[0]);
+
$length = length($content);
my $send= "POST $file HTTP/1.0\n";
@@ -475,17 +493,6 @@
}
close(SOCK);
- my $sentdata="";
- foreach $x (keys (%$variables)){
- $value = $variables->{$x};
- $sentdata.= "$x => $value\n";
- }
- WriteFile "$Prefix-sentdata.txt", $sentdata;
-
- if (!($SUBMITAUX eq "")) {
- system "$SUBMITAUX \"$Prefix-sentdata.txt\"";
- }
-
return $result;
}
More information about the llvm-commits
mailing list