Changeset 14236 for gsdl/trunk


Ignore:
Timestamp:
2007-07-09T14:44:19+12:00 (17 years ago)
Author:
mdewsnip
Message:

Added a bunch more code to deal with IIS 6 craziness, thanks to Stefan Boddie.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/cgi-bin/gliserver.pl

    r14235 r14236  
    264264    my $installation_status = "";
    265265
     266    print STDOUT "Content-type:text/plain\n\n";
     267
    266268    # Check that Java is installed and accessible
    267269    my $java = $gsdl_cgi->get_java_path();
    268270    my $java_command = "$java -version 2>&1";
     271
     272    # IIS 6: redirecting output from STDERR to STDOUT just doesn't work, so we have to let it go
     273    #   directly out to the page
     274    if ($iis6_mode)
     275    {
     276    $java_command = "java -version";
     277    }
     278
    269279    my $java_output = `$java_command`;
    270280    my $java_status = $?;
     
    285295
    286296    if ($installation_ok) {
    287     $gsdl_cgi->generate_ok_message($installation_status . "\nInstallation OK!");
     297    print STDOUT $installation_status . "\nInstallation OK!";
    288298    }
    289299    else {
    290     $gsdl_cgi->generate_error($installation_status);
     300    print STDOUT $installation_status;
    291301    }
    292302}
     
    594604    }
    595605
     606    print STDOUT "Content-type:text/plain\n\n";
     607
    596608    my $perl_command = "perl -S $script $perl_args 2>&1";
     609
     610    # IIS 6: redirecting output from STDERR to STDOUT just doesn't work, so we have to let it go
     611    #   directly out to the page
     612    if ($iis6_mode)
     613    {
     614    $perl_command = "perl -S $script $perl_args";
     615    }
     616
    597617    my $perl_output = `$perl_command`;
    598618    my $perl_status = $?;
     
    601621    }
    602622
    603     print STDOUT "Content-type:text/plain\n\n";
    604     print STDOUT $perl_output;
     623    if (defined($perl_output))
     624    {
     625    print STDOUT $perl_output;
     626    }
    605627}
    606628
     
    746768    }
    747769
     770    print STDOUT "Content-type:text/plain\n\n";
     771
    748772    my $perl_command = "perl -S $script $perl_args 2>&1";
     773
     774    # IIS 6: redirecting output from STDERR to STDOUT just doesn't work, so we have to let it go
     775    #   directly out to the page
     776    if ($iis6_mode)
     777    {
     778    $perl_command = "perl -S $script $perl_args";
     779    }
     780
    749781    if (!open(PIN, "$perl_command |")) {
    750782    $gsdl_cgi->generate_error("Unable to execute command: $perl_command");
    751783    }
    752784
    753     print STDOUT "Content-type:text/plain\n\n";
    754785    while (defined (my $perl_output_line = <PIN>)) {
    755786    print STDOUT $perl_output_line;
Note: See TracChangeset for help on using the changeset viewer.