+++ /dev/null
-#!./perl
-#
-# echo-perl --
-#
-# Produce a page containing all FastCGI inputs
-#
-# Copyright (c) 1996 Open Market, Inc.
-#
-# See the file "LICENSE.TERMS" for information on usage and redistribution
-# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-#
-# $Id: echo-perl,v 1.1 1997/09/16 15:36:28 stanleyg Exp $
-#
-
-use FCGI;
-
-sub print_env {
- my($label, $envp) = @_;
- print("$label:<br>\n<pre>\n");
- my @keys = sort keys(%$envp);
- foreach $key (@keys) {
- print("$key=$$envp{$key}\n");
- }
- print("</pre><p>\n");
-}
-
-while (($key, $val) = each %ENV) {
- $initialEnv{$key} = $val;
-}
-$count = 0;
-while(FCGI::accept() >= 0) {
- print("Content-type: text/html\r\n\r\n",
- "<title>FastCGI echo (Perl)</title>\n",
- "<h1>FastCGI echo (Perl)</h1>\n",
- "Request number ", ++$count, "<p>\n");
- $len = 0 + $ENV{'CONTENT_LENGTH'};
- if($len == 0) {
- print("No data from standard input.<p>\n");
- } else {
- print("Standard input:<br>\n<pre>\n");
- for($i = 0; $i < $len; $i++) {
- $ch = getc(STDIN);
- if($ch eq "") {
- print("Error: Not enough bytes received ",
- "on standard input<p>\n");
- last;
- }
- print($ch);
- }
- print("\n</pre><p>\n");
- }
- print_env("Request environment", \%ENV);
- print_env("Initial environment", \%initialEnv);
-}
+++ /dev/null
-#!./tclsh
-#
-# echo-tcl --
-#
-# Produce a page containing all FastCGI inputs
-#
-# Copyright (c) 1996 Open Market, Inc.
-#
-# See the file "LICENSE.TERMS" for information on usage and redistribution
-# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-#
-# $Id: echo-tcl,v 1.1 1997/09/16 15:36:28 stanleyg Exp $
-#
-
-proc printEnv {label envArrayName} {
- upvar $envArrayName envArray
- puts "$label:<br>\n<pre>"
- foreach name [lsort [array names envArray]] {
- puts "$name=$envArray($name)"
- }
- puts "</pre><p>"
-}
-
-foreach name [array names env] {
- set initialEnv($name) $env($name)
-}
-set count 0
-while {[FCGI_Accept] >= 0 } {
- incr count
- puts -nonewline "Content-type: text/html\r\n\r\n"
- puts "<title>FastCGI echo (Tcl)</title>"
- puts "<h1>FastCGI echo (Tcl)</h1>"
- puts "Request number $count <p>"
- if [info exists env(CONTENT_LENGTH)] {
- set len $env(CONTENT_LENGTH)
- } else {
- set len 0
- }
- if {$len == 0} {
- puts "No data from standard input.<p>"
- } else {
- puts "Standard input:<br>\n<pre>"
- for {set i 0} {$i < $len} {incr i} {
- set ch [read stdin 1]
- if {$ch == ""} {
- puts -nonewline "Error: Not enough bytes received "
- puts "on standard input<p>"
- break
- }
- puts -nonewline $ch
- }
- puts "\n</pre><p>"
- }
- printEnv "Request environment" env
- printEnv "Initial environment" initialEnv
-}
+++ /dev/null
-#!./perl
-#
-# tiny-perl-fcgi --
-#
-# Perl-5 FastCGI example program
-#
-# Copyright (c) 1996 Open Market, Inc.
-#
-# See the file "LICENSE.TERMS" for information on usage and redistribution
-# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-#
-# $Id: tiny-perl-fcgi,v 1.1 1997/09/16 15:36:29 stanleyg Exp $
-#
-
-
-use FCGI;
-#
-# Work around the "empty initial environment" bug
-#
-while (($ignore) = each %ENV) {
-}
-
-$count = 0;
-while(FCGI::accept() >= 0) {
- print("Content-type: text/html\r\n\r\n",
- "<title>FastCGI Hello! (Perl)</title>\n",
- "<h1>FastCGI Hello! (Perl)</h1>\n",
- "Request number ", ++$count,
- " running on host <i>$ENV{'SERVER_NAME'}</i>\n");
-}
+++ /dev/null
-#!./tclsh
-#
-# tiny-tcl-fcgi --
-#
-# Tcl FastCGI example program
-#
-# Copyright (c) 1996 Open Market, Inc.
-#
-# See the file "LICENSE.TERMS" for information on usage and redistribution
-# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-#
-# $Id: tiny-tcl-fcgi,v 1.1 1997/09/16 15:36:29 stanleyg Exp $
-#
-
-set count 0
-while {[FCGI_Accept] >= 0 } {
- incr count
- puts -nonewline "Content-type: text/html\r\n\r\n"
- puts "<title>FastCGI Hello! (Tcl)</title>"
- puts "<h1>FastCGI Hello! (Tcl)</h1>"
- puts "Request number $count running on host <i>$env(SERVER_NAME)</i>"
-}