Commit cb8fb01b authored by Leigh Stoller's avatar Leigh Stoller

Dopey little hack to get the browser to draw something when the log

file is open and still smaller then 1024 chars. Serious ick factor.
parent 73bce9f5
......@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2002 University of Utah and the Flux Group.
# Copyright (c) 2000-2002, 2005 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -25,7 +25,8 @@ sub usage()
"Spew the logfile for an experiment.\n";
exit(-1);
}
my $optlist = "";
my $optlist = "w";
my $fromweb = 0;
#
# Configure variables
......@@ -59,6 +60,9 @@ $| = 1;
if (! getopts($optlist, \%options)) {
usage();
}
if (defined($options{"w"})) {
$fromweb = 1;
}
if (@ARGV != 2) {
usage();
}
......@@ -129,6 +133,21 @@ if (TBAdmin($UID)) {
$EUID = $UID;
}
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks) = stat(LOG);
#
# Icky. If the file is open and less then 1024 bytes, send out some
# stuff at the beginning to make the browser do something. This terrible,
# but not sure what else to do.
#
if ($fromweb && $isopen && $size < 1024) {
for ($i = $size; $i < 1024; $i++) {
print " ";
}
print "\n";
}
#
# Loop reading the file in nonblocking mode. Sleep between loops, and
# check for a change in status.
......
......@@ -73,7 +73,7 @@ function SPEWCLEANUP()
ignore_user_abort(1);
register_shutdown_function("SPEWCLEANUP");
if ($fp = popen("$TBSUEXEC_PATH $uid $pid spewlogfile $pid $eid", "r")) {
if ($fp = popen("$TBSUEXEC_PATH $uid $pid spewlogfile -w $pid $eid", "r")) {
header("Content-Type: text/plain");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache, must-revalidate");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment