forked from OSchip/llvm-project
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. llvm-svn: 72532
This commit is contained in:
parent
ae028d48be
commit
e6986d8e60
|
@ -445,14 +445,21 @@ sub SendData{
|
||||||
$file = $_[1];
|
$file = $_[1];
|
||||||
$variables=$_[2];
|
$variables=$_[2];
|
||||||
|
|
||||||
$port=80;
|
# Write out the "...-sentdata.txt" file.
|
||||||
$socketaddr= sockaddr_in $port, inet_aton $host or die "Bad hostname\n";
|
|
||||||
socket SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp') or
|
my $sentdata="";
|
||||||
die "Bad socket\n";
|
foreach $x (keys (%$variables)){
|
||||||
connect SOCK, $socketaddr or die "Bad connection\n";
|
$value = $variables->{$x};
|
||||||
select((select(SOCK), $| = 1)[0]);
|
$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;
|
my $content;
|
||||||
foreach $key (keys (%$variables)){
|
foreach $key (keys (%$variables)){
|
||||||
$value = $variables->{$key};
|
$value = $variables->{$key};
|
||||||
|
@ -460,6 +467,17 @@ sub SendData{
|
||||||
$content .= "$key=$value&";
|
$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);
|
$length = length($content);
|
||||||
|
|
||||||
my $send= "POST $file HTTP/1.0\n";
|
my $send= "POST $file HTTP/1.0\n";
|
||||||
|
@ -475,17 +493,6 @@ sub SendData{
|
||||||
}
|
}
|
||||||
close(SOCK);
|
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;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue