tcl7.5 port

Wessel Kraaij (kraaij@tpd.tno.nl)
Tue, 8 Apr 1997 16:03:46 +0200

Date: Tue, 8 Apr 1997 16:03:46 +0200
Message-Id: <9704081403.AA20945@tpdalf.tpd.tno.nl>
From: Wessel Kraaij <kraaij@tpd.tno.nl>
To: fcgi-developers@OpenMarket.com
Subject: tcl7.5 port


Hi Stanley,

I am considering a tcl7.5 port.

What I did so far:

1. I  built a shared library version of fcgi which can be loaded dynamically.

2. I implemented a new tcl command: FCGI_puts which maps straight to
FCGI_puts (cf. fcgi_stdio.h) 

This seems to work only partially:

Here's some output from the Apache log file:

[Tue Apr  8 15:47:44 1997] access to /usr/local/lib/httpd/fcgi/tiny-tcl-fcgi failed for tpdkra, reason: mod_fastcgi: Unterminated CGI response headers, 124 bytes received from app

So it did receive **124 bytes** from the following app:

#!/bin/sh
#\
exec /usr/local/bin/itclsh  $0 $*
#TCL_LIBRARY=/data3/src/tcl7.4-fcgi/lib/tcl7.4; export TCL_LIBRARY; exec /data3/src/tcl7.4-fcgi/bin/tclsh7.4 $0 $*
#exec /data3/src/fcgi/tcl/common/tclsh $0 $*
#
# if { ![info exists env(OS)] } {
#     set env(OS) solaris
# }

# source /nfs/tpdalf/data/kraaij/.mytclsettings
#         set tcl_lib $tcltest
#         set package_lib $packagestest
# set auto_path \
#     [linsert $auto_path 0 $tcl_lib $package_lib]

#  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: 0702.html,v 1.1.1.1 2001/04/25 00:44:08 robs Exp $
#
#package require fcgi
#load /data/kraaij/src/vsm/packages/osf/libFcgi.so
load /data3/src/fcgi/tcl/common/libFcgi.so
set count 0 
while {[FCGI_Accept] >= 0 } {
    incr count
#    FCGI_puts -nonewline "Content-type: text/html\r\n\r\n"
    FCGI_puts "<title>FastCGI Hello! (Tcl)</title>"
    FCGI_puts "<h1>FastCGI Hello! (Tcl)</h1>"
    FCGI_puts "Request number $count running on host <i>$env(SERVER_NAME)</i>"
}


I guess I have to modify FCGI_Accept a bit to fix CGI header
termination ?

---
Wessel Kraaij, TNO-TPD 				Phone:
     							+31-(0)15-2692259 
Address: 					Fax:
     TNO-TPD TU-Delft 					+31-(0)15-2692111
     Stieltjesweg 1 				Email:
     2628 CK Delft   					kraaij@tpd.tno.nl
     The Netherlands					kraaijw@acm.org