Changeset 14266 for misc/runpugs

Show
Ignore:
Timestamp:
10/12/06 02:11:11 (2 years ago)
Author:
andara
Message:

[runpugs]
some stability fixes; better (or more friendly) error messages; warning on
main page.

Location:
misc/runpugs
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • misc/runpugs/cgi-bin/runpugs

    r14233 r14266  
    8484    my $ip=shift; 
    8585    my $reply='pugs> '; 
    86     if ("$ip" ne "130.209.241.223") { 
     86    my $testing=$query->param('testing')||1; 
     87    if (not $testing) { 
    8788    $reply = "Sorry, runpugs is not available at the moment."; 
    8889    } else { 
     
    9798    open(HTML,"<../data/runpugs.html"); 
    9899    while(<HTML>) { 
    99  
     100    s/_TESTING_/$testing/; 
    100101        /input.*name=\"sessionid\"/ && do {$html.='<input type="hidden" name="sessionid" value="'.$sessionid.'">'."\n";next }; 
    101102        /(pugs\&gt\;\&nbsp\;)/ && do {$html.=$cmd.$reply;next}; 
  • misc/runpugs/data/runpugs.html

    r14233 r14266  
    2626 
    2727</head> 
    28  
    2928<body> 
     29<!-- 
     30<body onLoad="closing=true" onUnload="if (closing){alert(42); 
     31window.open('feather.perl6.nl:8080/cgi-bin/runpugs?action=runpugs&sessionid='+document.terminal.sessionid.value+'&testing=1&cmd=pugs%3E%20%3Aq','newwin');}"> 
     32--> 
    3033<div id="mainwindow"> 
    3134<h1>Run Perl6 now -- in your browser!</h1> 
    32 <form style="text-align: center" name="terminal" action="/cgi-bin/runpugs" method="POST">                   
     35<p class="warning">Thank you for trying runpugs, a web terminal for pugs.<br> 
     36* This is a test run, it might die unexpectedly!<br> 
     37* pugs runs in safe mode<br> 
     38* Unicode is not supported 
     39</p> 
     40<form style="text-align: center" id="term" name="terminal" action="/cgi-bin/runpugs" method="POST">                   
    3341                                
     42<input type="hidden" name="testing" value="_TESTING_"> 
    3443<input type="hidden" name="sessionid" value=""> 
    3544<input type="hidden"    name="action" value="runpugs"> 
  • misc/runpugs/htdocs/runpugs.css

    r14202 r14266  
    1 BODY {width=100%;margin-left:10%;margin-right:10%; margin-top: 10px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12pt; line-height: normal; background-color:#FFFFFF;} 
     1BODY {width:100%;margin-left:10%;margin-right:10%; margin-top: 10px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12pt; line-height: normal; background-color:#FFFFFF;} 
    22H1 {font-size: 24pt;  
    33    font-family: Georgia, Serif, Times;  
     
    1010LABEL {font-weight: bold; } 
    1111.copyright {font-size: 9pt} 
     12.warning { 
     13border: solid 2px #204a87; 
     14padding: 5px; 
     15} 
    1216#mainwindow { 
    1317width: 750px  
  • misc/runpugs/lib/WebTerminal/Server.pm

    r14233 r14266  
    4747                        delete $terminals{$id}; 
    4848            delete $lastcalled{$id}; 
     49            $sessions_per_ip{$ip}--; 
    4950                } 
    5051        if ($lines=~/Aborted/s) { 
    5152             delete $terminals{$id}; 
    5253             delete $lastcalled{$id}; 
     54            $sessions_per_ip{$ip}--; 
    5355        } 
    5456                return $lines; 
     
    102104} elsif (defined $pid) { 
    103105   # child here 
    104    while (getppid()) { 
    105        sleep 600; 
    106        kill 'USR1',getppid(); 
     106   while (getppid()>10) { # a bit ad-hoc. 
     107       sleep 300; 
     108print getppid(),"\n"; 
     109kill 'USR1',getppid(); 
    107110    } 
    108111} elsif ($! == EAGAIN) { 
     
    120123        my $then=$lastcalled{$id}; 
    121124        if ($now-$then>600) { 
     125        if(exists $terminals{$id}) { 
    122126            $terminals{$id}->write(':q'); 
    123127            delete $terminals{$id}; 
     128            } 
     129            if (exists $lastcalled{$id}) { 
    124130            delete $lastcalled{$id}; 
     131            } 
    125132        } 
    126133    } 
  • misc/runpugs/lib/WebTerminal/Server/Terminal.pm

    r14233 r14266  
    6060#           print "L:",$line,":",$msg; 
    6161            if($msg=~/timed/) { 
    62         $lline="pugs> Aborted!\n"; 
     62        $msg=''; 
     63        $pugs->errmsg([]); 
     64        $lline="pugs> Sorry, that took too long! Aborted.\n"; 
    6365        $ps='pugs'; 
    6466        last;