From wurobert@example.net Fri May 22 09:39:58 2009
Return-Path: <wurobert@example.net>
Delivered-To: wurobert@example.net
Received: (qmail 79379 invoked from network); 22 May 2009 09:39:58 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur.apache.org with SMTP; 22 May 2009 09:39:58 -0000
Received: (qmail 38240 invoked by uid 500); 22 May 2009 09:40:11 -0000
Delivered-To: wurobert@example.net
Received: (qmail 38224 invoked by uid 500); 22 May 2009 09:40:11 -0000
Mailing-List: contact wurobert@example.net; run by ezmlm
Precedence: bulk
List-Help: <mailto:wurobert@example.net>
List-Unsubscribe: <mailto:wurobert@example.net>
List-Post: <mailto:wurobert@example.net>
List-Id: <websh-cvs.tcl.apache.org>
Delivered-To: mailing list wurobert@example.net
Received: (qmail 38211 invoked by uid 99); 22 May 2009 09:40:11 -0000
Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 May 2009 09:40:11 +0000
X-ASF-Spam-Status: No, hits=-2000.0 required=10.0
	tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 May 2009 09:40:08 +0000
Received: by eris.apache.org (Postfix, from userid 65534)
	id 027F0238888E; Fri, 22 May 2009 09:39:47 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r777439 - /tcl/websh/trunk/src/apachetests/test/headers.test
Date: Fri, 22 May 2009 09:39:46 -0000
To: wurobert@example.net
From: wurobert@example.net
X-Mailer: svnmailer-1.0.8
Message-Id: <wurobert@example.net>
X-Virus-Checked: Checked by ClamAV on apache.org

Author: ronnie
Date: Fri May 22 09:39:45 2009
New Revision: 777439

URL: http://svn.apache.org/viewvc?rev=777439&view=rev
Log:
- proper URL in header-1.1 test

Modified:
    tcl/websh/trunk/src/apachetests/test/headers.test

Modified: tcl/websh/trunk/src/apachetests/test/headers.test
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/apachetests/test/headers.test?rev=777439&r1=777438&r2=777439&view=diff
==============================================================================
--- tcl/websh/trunk/src/apachetests/test/headers.test (original)
+++ tcl/websh/trunk/src/apachetests/test/headers.test Fri May 22 09:39:45 2009
@@ -41,10 +41,10 @@
 
     888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4tcltest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4test header-1.1 {websh Basic auth header test (pass through Authorization)} {
 	set auth [list Authorization {Basic d2Vic2g6cGFzcw==}]
-	set page [888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4http888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4geturl "${urlbase}/$testfilename1?cmd=auth" -headers $auth]
+	set page [888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4http888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4geturl "${urlbase}$testfilename1?cmd=auth" -headers $auth]
 	set match [888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4http888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4ta $page]
 	set auth [list Authorization {Basic d2Vic2g6cGFzczp3b3Jk}]
-	set page [888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4http888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4geturl "${urlbase}/$testfilename1?cmd=auth" -headers $auth]
+	set page [888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4http888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4geturl "${urlbase}$testfilename1?cmd=auth" -headers $auth]
 	append match ! [888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4http888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4ta $page]
     } {websh*pass!websh*pass:word}
 



---------------------------------------------------------------------
To unsubscribe, e-mail: wurobert@example.net
For additional commands, e-mail: wurobert@example.net


From wurobert@example.net Fri May 22 10:13:58 2009
Return-Path: <wurobert@example.net>
Delivered-To: wurobert@example.net
Received: (qmail 96846 invoked from network); 22 May 2009 10:13:58 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur.apache.org with SMTP; 22 May 2009 10:13:58 -0000
Received: (qmail 76497 invoked by uid 500); 22 May 2009 10:14:11 -0000
Delivered-To: wurobert@example.net
Received: (qmail 76481 invoked by uid 500); 22 May 2009 10:14:11 -0000
Mailing-List: contact wurobert@example.net; run by ezmlm
Precedence: bulk
List-Help: <mailto:wurobert@example.net>
List-Unsubscribe: <mailto:wurobert@example.net>
List-Post: <mailto:wurobert@example.net>
List-Id: <websh-cvs.tcl.apache.org>
Delivered-To: mailing list wurobert@example.net
Received: (qmail 76472 invoked by uid 99); 22 May 2009 10:14:11 -0000
Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 May 2009 10:14:11 +0000
X-ASF-Spam-Status: No, hits=-2000.0 required=10.0
	tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 May 2009 10:13:59 +0000
Received: by eris.apache.org (Postfix, from userid 65534)
	id B2E942388830; Fri, 22 May 2009 10:13:37 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r777449 - in /tcl/websh/trunk: ./ doc/mod_websh/ src/
 src/generic/ src/unix/ src/win/
Date: Fri, 22 May 2009 10:13:36 -0000
To: wurobert@example.net
From: wurobert@example.net
X-Mailer: svnmailer-1.0.8
Message-Id: <wurobert@example.net>
X-Virus-Checked: Checked by ClamAV on apache.org

Author: ronnie
Date: Fri May 22 10:13:35 2009
New Revision: 777449

URL: http://svn.apache.org/viewvc?rev=777449&view=rev
Log:
- dynamic linking of libwebsh.so|dll to websh binary and mod_websh.so
  (check src/ChangeLog for individual commit messages)

Added:
    tcl/websh/trunk/src/generic/modwebsh_cgi.h
Modified:
    tcl/websh/trunk/CHANGES
    tcl/websh/trunk/INSTALL
    tcl/websh/trunk/README
    tcl/websh/trunk/doc/mod_websh/README
    tcl/websh/trunk/src/ChangeLog
    tcl/websh/trunk/src/generic/dispatch.c
    tcl/websh/trunk/src/generic/interpool.c
    tcl/websh/trunk/src/generic/interpool.h
    tcl/websh/trunk/src/generic/modwebsh.h
    tcl/websh/trunk/src/generic/modwebsh_ap.c
    tcl/websh/trunk/src/generic/modwebsh_cgi.c
    tcl/websh/trunk/src/generic/request.c
    tcl/websh/trunk/src/generic/request.h
    tcl/websh/trunk/src/generic/request_ap.c
    tcl/websh/trunk/src/generic/request_cgi.c
    tcl/websh/trunk/src/generic/response_ap.c
    tcl/websh/trunk/src/generic/response_cgi.c
    tcl/websh/trunk/src/generic/web.c
    tcl/websh/trunk/src/generic/webout.c
    tcl/websh/trunk/src/generic/webout.h
    tcl/websh/trunk/src/unix/Makefile.in
    tcl/websh/trunk/src/win/Makefile
    tcl/websh/trunk/src/win/README

Modified: tcl/websh/trunk/CHANGES
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/CHANGES?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/CHANGES (original)
+++ tcl/websh/trunk/CHANGES Fri May 22 10:13:35 2009
@@ -9,6 +9,8 @@
 Trunk
 -----
 
+- Dynamic linking of libwebsh.so|dll to websh binary and mod_websh.so
+
 - Improved Cookie handling (deal with unusual format)
 
 - Enabled mod_websh tests for Windows platform

Modified: tcl/websh/trunk/INSTALL
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/INSTALL?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/INSTALL (original)
+++ tcl/websh/trunk/INSTALL Fri May 22 10:13:35 2009
@@ -1,13 +1,12 @@
-Notes
-=====
-
-Please note that we use some GNU make extensions, so make sure that 
-you try to compile Websh using a GNU version of make (or gmake) when
-compiling under UNIX.
-
+Unix
+====
 
 Compile Websh 3.6
-=================
+-----------------
+
+Please note that we use some GNU make extensions, so make sure that 
+you compile Websh using a GNU version of make (or gmake) when compiling 
+under UNIX.
 
 from the top level directory,
 
@@ -15,27 +14,56 @@
 autoconf
 ./configure
 make
+make test;        # runs test suite on websh
+make apachetest;  # runs test suite on mod_websh running within Apache
+make install
 
 You may have to pass special options to configure, such as
 
---with-tcl to indicate where tclConfig.sh is located.
-
---with-tclinclude to indicate where the Tcl header files are.
-
---with-httpdinclude to indicate where the Apache header files are
-
---enable-threads if you plan to use it with Apache 2 
-  (don't forget to also compile Tcl with threads enabled).
+--with-tcl
+  to indicate where tclConfig.sh is located. (You can provide a 
+  path to tcl where lib/tclConfig.sh and also include/tcl.h is
+  found so that you don't need to specify --with-tclinclude
+  separately)
+
+--with-tclinclude
+  to indicate where the Tcl header files are. (overwrites 
+  --with-tcl for header files)
+
+--with-httpdinclude 
+  to indicate where the Apache header files are
+
+--enable-threads
+  if you plan to use it with Apache 2 (don't forget to also 
+  compile Tcl with threads enabled).
+
+--httpd 
+  to indicate where the apache httpd binary resides (only
+  needed to compile Websh on Max OSX)
+
+--with-aprinclude
+--with-apuinclude
+  to indicate where the Apache portable runtime resides if
+  these are not included with the httpd header files  
 
 
 Websh provides the following targets
-====================================
+------------------------------------
 
 websh3.6.<patch>
   standalone tclsh with websh package already loaded
+  (dynamically linked to libwebsh3.6.<patch>.so and Tcl)
 
 libwebsh3.6.<patch>.so
   Tcl package shared object (provides package websh)
 
 mod_websh3.6.<patch>.so
   Apache module for Apache 1.3 and Apache 2.0 respectively
+  (dynamically linked to libwebsh3.6.<patch>.so and Tcl)
+
+
+
+Windows
+=======
+
+Please refer to the file src\win\README.

Modified: tcl/websh/trunk/README
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/README?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/README (original)
+++ tcl/websh/trunk/README Fri May 22 10:13:35 2009
@@ -21,7 +21,7 @@
     2. Documentation
     3. Compiling and installing Websh (Unix)
     4. mod_websh: Websh as Apache Module (Unix)
-    5. Compiling and installing Websh (Windows XP)
+    5. Compiling and installing Websh and mod_websh (Windows XP)
     6. Support
 
 
@@ -72,21 +72,23 @@
   ./configure
   make
   make test
+  make apachetest
   make install
 
 Make will create three targets: websh3.6.<patch>, which is the standalone 
-Websh application (dynamically linked to Tcl) and libwebsh3.6.<patch>.so,
-which is a TEA (Tcl Extension Architecture) shared object that can
-be dynamically loaded from within Tcl using [load libwebsh3.6.<patch>.so].
-Both provide the Tcl package websh. The third target is 
-mod_websh3.6.<patch>.so, which is the Websh Apache module
+Websh application (dynamically linked to Tcl and libwebsh3.6.<patch>.so)
+and libwebsh3.6.<patch>.so, which is a TEA (Tcl Extension Architecture)
+compliant shared object that can be dynamically loaded from within Tcl
+using [load libwebsh3.6.<patch>.so]. Both provide the Tcl package
+websh. The third target is  mod_websh3.6.<patch>.so (also dynamically
+linked to Tcl and libwebsh3.6.<patch>.so), which is the Websh Apache
+module.
 
 If you have several versions of Tcl and Apache installed on your system,
 you might want to specify which one should be used for Websh, e.g.
 
-  ./configure --with-tcl=/usr/local/tcl8.3.4/lib \
-      --with-tclinclude=/usr/local/tcl8.3.4/include \
-      --with-httpdinclude=/usr/local/apache_1.3.29/include
+  ./configure --with-tcl=/usr/local/tcl8.4.19 \
+      --with-httpdinclude=/usr/local/httpd-2.0.63/include
 
 Note that to compile mod_websh for Apache 2, the corresponding Tcl
 library must be compiled using threads and threads should be enabled
@@ -99,16 +101,12 @@
 
   ./configure --prefix=/opt
 
-Note that Websh will install all files in <prefix>/websh and will then 
-try to add symbolic links in <prefix>/bin and <prefix>/lib if these
-directories exist.
-
 
 4. mod_websh: Websh as Apache Module
 ------------------------------------
 
 Websh applications can both run in CGI mode and in mod_websh, the
-module for Apache 1.3 and Apache 2.0. In order to build mod_websh,
+module for Apache 1.3 to Apache 2.2. In order to build mod_websh,
 you have to use the following configure option:
 
   --with-httpdinclude=/path/to/apache/header/files
@@ -124,32 +122,18 @@
 will compile and build mod_websh. Note that mod_websh3.6.<patch>.so will
 also be compiled by default when 'make all' is invoked.
 
-In order to use mod_websh in your Apache web server, you have
-to do the following:
-
-1) cp mod_websh.so somewhere where Apache can find it.
-   E.g. SERVER_ROOT/libexec/
-2) edit the httpd.conf file and add the following lines:
-     LoadModule websh_module /path/to/apache/libexec/mod_websh.so
-     AddHandler websh .ws3
-3) Optionally, you can specify a mod_websh configuration file using the
-   following directive:
-     WebshConfig /path/to/websh.conf
-   This configuration file is primarily used to configure the interpreter
-   classes (see documentation)
-4) HUP/restart httpd
-
-From now on, httpd will pass files ending in .ws3 to mod_websh.
+In order to use mod_websh in your Apache web server, please refer
+to the file doc/mod_websh/README
 
-A sample setup to server SSI-type HTML with Websh-snipplets and CGI-type
+A sample setup to serve SSI-type HTML with Websh-snipplets and CGI-type
 scripts is found in doc/mod_websh and will be installed with the 
 'make install' command.
 
 
-5. Compiling and installing Websh (Windows XP)
-----------------------------------------------
+5. Compiling and installing Websh and mod_websh (Windows XP)
+------------------------------------------------------------
 
-Websh currently provides a Makefile forMicrosoft Visual Studio 6.0 nmake.
+Websh currently provides a Makefile for Microsoft Visual Studio 6.0 nmake.
 
 Please refer to the file src/win/README for details.
 

Modified: tcl/websh/trunk/doc/mod_websh/README
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/doc/mod_websh/README?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/doc/mod_websh/README (original)
+++ tcl/websh/trunk/doc/mod_websh/README Fri May 22 10:13:35 2009
@@ -37,7 +37,7 @@
 	websh.exe               (Windows)
 	websh<version>.exe      (Windows)
 
-- Tcl extension (to be loaded into a Tclsh):
+- Tcl extension (loaded by Websh and loadable into a plain Tclsh):
 	libwebsh.so             (Unix symbolic link)
 	libwebsh<version>.so    (Unix)
 	websh.dll               (Windows)
@@ -46,5 +46,7 @@
 Note
 ====
 
-To run the Apache module, only modules/mod_websh.so (or 
-mod_websh<version>.so respectively) is needed.
+To run the Apache module, modules/mod_websh.so (or 
+mod_websh<version>.so respectively), libwebsh.so (or
+libwebsh<version>.so respectively), and the Tcl installation is needed.
+

Modified: tcl/websh/trunk/src/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/ChangeLog?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/ChangeLog (original)
+++ tcl/websh/trunk/src/ChangeLog Fri May 22 10:13:35 2009
@@ -1,6 +1,86 @@
+2009-05-22 Brunner Ronnie <wurobert@example.net>
+	* <all changes>:
+	- allow dynamic linking of libwebsh.so|dll to websh, websh.exe and
+	  mod_websh.so
+	* doc_mod_websh/README, INSTALL, README, src/win/README:
+	- adapted to new dynamic linking
+	- reduced some redundancy
+	- documented (n)make apachetest target
+	* src/unix/Makefile.in, src/win/Makefile:
+	- dynamic linking of libwebsh.so|dll to websh, websh.exe and 
+	  mod_websh.so
+	* src/generic/modwebsh_cgi.h:
+	- created for ApFuncs: a struct with pointers to the
+	  mod_websh implementations of various websh commands that
+	  differ from the CGI implementation.
+	* src/generic/modwebsh_cgi.c:
+	- implemented a switch in all functions according to ApFuncs
+	  content -> call either mod_websh or CGI implementation.
+	* src/generic/request_cgi.c:
+	- implemented a switch in all functions according to ApFuncs
+	  content -> call either mod_websh or CGI implementation.
+	- changed signature in some funtcions to include interp to
+	  allow mod_websh / CGI switch depending on context (ApFuncs)
+	* src/generic/displatch.c:
+	- added interp as parameter to requestGetDefaultChannelName
+	  to allow mod_websh / CGI switch depending on context (ApFuncs)
+	* src/generic/response_ap.c:
+	- changed isDefaultResponseObj to isDefaultResponseObj_AP
+	  to distinguish functions since with dynamic linking, both
+	  versions CGI and mod_websh are present in the code.
+	- added interp as parameter to isDefaultResponseObj_AP
+	  to allow mod_websh / CGI switch depending on context (ApFuncs)
+	* src/generic/request_ap.c:
+	- changed requestGetDefaultChannelName to
+	  requestGetDefaultChannelName_AP and requestFillRequestValues to
+	  requestFillRequestValues_AP to distinguish functions since with
+	  dynamic linking, both versions CGI and mod_websh are present in
+	  the code.
+	- remove duplicate check for requestData->requestIsInitialized
+	* src/generic/interpool.c:
+	- setup apFuncs function pointers for mod_websh interps and set
+	  the struct as Tcl AssocData to the interp (Note: this is how at
+	  runtime, Websh distinguishes whether the CGI or the mod_websh
+	  implementation of certain functions must be invoked)
+	* src/generic/interpool.h:
+	- define prototypes for createApFuncs and destroyApFuncs
+	* src/generic/response_cgi.c:
+	- implemented a switch in all functions according to ApFuncs
+	  content -> call either mod_websh or CGI implementation.
+	- added interp as parameter to isDefaultResponseObj
+	  to allow mod_websh / CGI switch depending on context (ApFuncs)
+	* src/generic/modwebsh_ap.c:
+	- changed various functions from <func> to <func>_AP to allow
+	  mod_websh / CGI switch depending on context (ApFuncs)
+	- removed modwebsh_createcmd, since it's now redundant to the CGI
+	  implementation.
+	* src/generic/request.c:
+	- call requestGetDefaultChannelName with interp as parameter
+	* src/generic/request.h:
+	- changed prototypes for requestGetDefaultChannelName and
+	  requestGetDefaultOutChannelName: both now include interp as
+	  parameter
+	* src/generic/modwebsh.h:
+	- changed prototypes from <func> to <func>_AP for mod_websh
+	  implementation
+	* src/generic/webout.c:
+	- call isDefaultResponseObj and requestGetDefaultOutChannelName
+	  with interp as argument
+	* src/generic/webout.h:
+	- changed prototype of isDefaultResponseObj (added interp as
+	  argument)
+	* src/generic/web.c:
+	- added prototype of modwebsh_createcmd
+
+2009-05-22 Brunner Ronnie <wurobert@example.net>
+	* src/apachetests/test/headers.test:
+	- proper URL in header-1.1 test
+
 2009-04-16 Brunner Ronnie <wurobert@example.net>
 	* src/generic/cookie.ws3:
 	- improved Cookie handling (deal with unusual formats)
+	* src/tests/cookiecontext.test:
+	- added test for the above fix
 
 2009-04-14 Brunner Ronnie <wurobert@example.net>
 	* src/unix/Makefile.in:

Modified: tcl/websh/trunk/src/generic/dispatch.c
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/dispatch.c?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/dispatch.c (original)
+++ tcl/websh/trunk/src/generic/dispatch.c Fri May 22 10:13:35 2009
@@ -24,8 +24,6 @@
 #define FORM_MULTIPART_LEN 19
 #define FORM_DEFAULT_TYPE  FORM_URLENCODED
 
-Tcl_Obj *requestGetDefaultChannelName();
-
 int parsePostData(Tcl_Interp * interp, Tcl_Obj * name,
 		  Tcl_Obj * type, Tcl_Obj * len, RequestData * requestData);
 
@@ -195,7 +193,7 @@
 
 	    Tcl_Obj *tmp = NULL;
 
-	    tmp = requestGetDefaultChannelName();
+	    tmp = requestGetDefaultChannelName(interp);
 
 	    Tcl_IncrRefCount(tmp);
 

Modified: tcl/websh/trunk/src/generic/interpool.c
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/interpool.c?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/interpool.c (original)
+++ tcl/websh/trunk/src/generic/interpool.c Fri May 22 10:13:35 2009
@@ -110,6 +110,7 @@
     int result = 0;
     LogPlugIn *logtoap = NULL;
     Tcl_Obj *code = NULL;
+    ApFuncs *apFuncs = NULL;
 
     WebInterp *webInterp = (WebInterp *) Tcl_Alloc(sizeof(WebInterp));
 
@@ -135,6 +136,12 @@
     /* now register here all websh modules */
     result = Tcl_Init(webInterp->interp);
     /* checkme: test result */
+
+    apFuncs = Tcl_GetAssocData(conf->mainInterp, WEB_APFUNCS_ASSOC_DATA, NULL);
+    if (apFuncs == NULL)
+	return NULL;
+    Tcl_SetAssocData(webInterp->interp, WEB_APFUNCS_ASSOC_DATA, NULL, (ClientData *) apFuncs);
+
     result = Websh_Init(webInterp->interp);
 
     /* also register the destrcutor, etc. functions, passing webInterp as
@@ -594,6 +601,7 @@
 
     LogPlugIn *logtoap = NULL;
     Tcl_Interp *mainInterp = Tcl_CreateInterp();
+    ApFuncs *apFuncs;
 
     if (mainInterp == NULL)
 	return NULL;
@@ -611,6 +619,13 @@
     }
 #endif
 
+    apFuncs = createApFuncs();
+    if (apFuncs == NULL) {
+        Tcl_DeleteInterp(mainInterp);
+	return NULL;
+    }
+    Tcl_SetAssocData(mainInterp, WEB_APFUNCS_ASSOC_DATA, destroyApFuncs, (ClientData *) apFuncs);
+
     /* standard Init */
     if (Tcl_Init(mainInterp) == TCL_ERROR) {
 	Tcl_DeleteInterp(mainInterp);
@@ -774,3 +789,27 @@
     Tcl_DecrRefCount(objPtr);
     return TCL_ERROR;
 }
+
+ApFuncs *createApFuncs() {
+  ApFuncs *apFuncs = (ApFuncs *) Tcl_Alloc(sizeof(ApFuncs));
+  if (apFuncs == NULL)
+    return NULL;
+  apFuncs->createDefaultResponseObj = createDefaultResponseObj_AP;
+  apFuncs->isDefaultResponseObj = isDefaultResponseObj_AP;
+  apFuncs->requestGetDefaultChannelName = requestGetDefaultChannelName_AP;
+  apFuncs->requestGetDefaultOutChannelName = requestGetDefaultOutChannelName_AP;
+  apFuncs->requestFillRequestValues = requestFillRequestValues_AP;
+  apFuncs->Web_Initializer = Web_Initializer_AP;
+  apFuncs->Web_Finalizer = Web_Finalizer_AP;
+  apFuncs->Web_Finalize = Web_Finalize_AP;
+  apFuncs->Web_InterpCfg = Web_InterpCfg_AP;
+  apFuncs->Web_InterpClassCfg = Web_InterpClassCfg_AP;
+  apFuncs->Web_MainEval = Web_MainEval_AP;
+  apFuncs->Web_ConfigPath = Web_ConfigPath_AP;
+  return apFuncs;
+}
+
+void destroyApFuncs(ClientData apFuncs, Tcl_Interp * interp) {
+  if (apFuncs != NULL)
+    Tcl_Free((char *) apFuncs);
+}

Modified: tcl/websh/trunk/src/generic/interpool.h
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/interpool.h?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/interpool.h (original)
+++ tcl/websh/trunk/src/generic/interpool.h Fri May 22 10:13:35 2009
@@ -23,6 +23,7 @@
 
 #include "modwebsh.h"
 #include "mod_websh.h"
+#include "modwebsh_cgi.h"
 
 /* ----------------------------------------------------------------------------
  * the interp-pool is kept in a hash table where
@@ -145,4 +146,7 @@
 void deleteInterpClass(WebInterpClass * webInterpClass);
 int readWebInterpCode(WebInterp * wi, char *filename);
 
+ApFuncs* createApFuncs();
+void destroyApFuncs(ClientData apFuncs, Tcl_Interp *interp);
+
 #endif

Modified: tcl/websh/trunk/src/generic/modwebsh.h
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/modwebsh.h?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/modwebsh.h (original)
+++ tcl/websh/trunk/src/generic/modwebsh.h Fri May 22 10:13:35 2009
@@ -14,29 +14,62 @@
  */
 
 #include "tcl.h"
-#include "cfg.h"
+#include "webout.h"
 
 #ifndef MODWEBSH_H
 #define MODWEBSH_H
 
-int Web_Initializer(ClientData clientData,
+/* declarations for command registration */
+
+int __declspec(dllexport) Web_Initializer(ClientData clientData,
+		    Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
+
+int __declspec(dllexport) Web_Finalizer(ClientData clientData,
+		  Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
+
+int __declspec(dllexport) Web_Finalize(ClientData clientData,
+		 Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
+
+int __declspec(dllexport) Web_MainEval(ClientData clientData,
+		 Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
+
+int __declspec(dllexport) Web_InterpCfg(ClientData clientData,
+		  Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
+
+int __declspec(dllexport) Web_InterpClassCfg(ClientData clientData,
+		       Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
+
+/* declarations for local (mod_websh) implementation */
+
+int Web_Initializer_AP(ClientData clientData,
 		    Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
-int Web_Finalizer(ClientData clientData,
+
+int Web_Finalizer_AP(ClientData clientData,
 		  Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
 
-int Web_Finalize(ClientData clientData,
+int Web_Finalize_AP(ClientData clientData,
 		 Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
 
-int Web_MainEval(ClientData clientData,
+int Web_MainEval_AP(ClientData clientData,
 		 Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
 
-int Web_InterpCfg(ClientData clientData,
+int Web_InterpCfg_AP(ClientData clientData,
 		  Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
 
-int Web_InterpClassCfg(ClientData clientData,
+int Web_InterpClassCfg_AP(ClientData clientData,
 		       Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]);
 
-int modwebsh_createcmd(Tcl_Interp * interp);
+ResponseObj* createDefaultResponseObj_AP(Tcl_Interp * interp);
+
+int isDefaultResponseObj_AP(Tcl_Interp * interp, char *name);
+
+Tcl_Obj* requestGetDefaultChannelName_AP(Tcl_Interp * interp);
+
+char* requestGetDefaultOutChannelName_AP(Tcl_Interp * interp);
+
+int requestFillRequestValues_AP(Tcl_Interp *interp, RequestData *requestData);
+
+int Web_ConfigPath_AP(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
 
 
 #endif

Modified: tcl/websh/trunk/src/generic/modwebsh_ap.c
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/modwebsh_ap.c?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/modwebsh_ap.c (original)
+++ tcl/websh/trunk/src/generic/modwebsh_ap.c Fri May 22 10:13:35 2009
@@ -22,7 +22,7 @@
 /* -------------------------------------------------------------------------
  * Web_Initializer -- if request counter is 0, eval the code
  * ------------------------------------------------------------------------- */
-int Web_Initializer(ClientData clientData,
+int Web_Initializer_AP(ClientData clientData,
 		    Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
 {
 
@@ -77,7 +77,7 @@
 /* ----------------------------------------------------------------------------
  * Web_Finalizer -- register the destructor (to be called when WebInterp dies)
  * ------------------------------------------------------------------------- */
-int Web_Finalizer(ClientData clientData,
+int Web_Finalizer_AP(ClientData clientData,
 		  Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
 {
 
@@ -125,7 +125,7 @@
 /* -------------------------------------------------------------------------
  * Web_Finalize -- call registered finalizers, in turn
  * ------------------------------------------------------------------------- */
-int Web_Finalize(ClientData clientData,
+int Web_Finalize_AP(ClientData clientData,
 		 Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
 {
 
@@ -186,7 +186,7 @@
 /* -------------------------------------------------------------------------
  * Web_InterpCfg -- set WebInterp properties
  * ------------------------------------------------------------------------- */
-int Web_InterpCfg(ClientData clientData,
+int Web_InterpCfg_AP(ClientData clientData,
 		  Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
 {
 
@@ -271,7 +271,7 @@
 /* ----------------------------------------------------------------------------
  * Web_InterpClassCfg -- set WebInterpClass properties
  * ------------------------------------------------------------------------- */
-int Web_InterpClassCfg(ClientData clientData,
+int Web_InterpClassCfg_AP(ClientData clientData,
 		       Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
 {
 
@@ -362,7 +362,7 @@
 /* ----------------------------------------------------------------------------
  * Web_MainEval -- eval in main interp
  * ------------------------------------------------------------------------- */
-int Web_MainEval(ClientData clientData,
+int Web_MainEval_AP(ClientData clientData,
 		 Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
 {
 
@@ -442,7 +442,7 @@
  * Web_ConfigPath -- (sub)command in pool interp (called from Web_Cfg)
  * ------------------------------------------------------------------------- */
 
-int Web_ConfigPath(Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]) {
+int Web_ConfigPath_AP(Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[]) {
 
   /* these options should be in sync with the options in Web_Cfg
    * not the order or anything, but the actual text strings */
@@ -500,13 +500,3 @@
   }
   return TCL_OK;
 }
-
-
-
-/* -------------------------------------------------------------------------
- * init -- fake in mod_websh case ! see creation of WebInterp
- * ------------------------------------------------------------------------- */
-int modwebsh_createcmd(Tcl_Interp * interp)
-{
-    return TCL_OK;
-}

Modified: tcl/websh/trunk/src/generic/modwebsh_cgi.c
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/modwebsh_cgi.c?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/modwebsh_cgi.c (original)
+++ tcl/websh/trunk/src/generic/modwebsh_cgi.c Fri May 22 10:13:35 2009
@@ -15,16 +15,20 @@
 
 #include "tcl.h"
 #include "macros.h"
+#include "modwebsh_cgi.h"
 
 /* ----------------------------------------------------------------------------
  * Web_Initializer -- just eval the code
  * ------------------------------------------------------------------------- */
-int Web_Initializer(ClientData clientData,
+int __declspec(dllexport) Web_Initializer(ClientData clientData,
 		    Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
 {
-
     int res = 0;
 
+    ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+    if (apFuncs != NULL)
+      return apFuncs->Web_Initializer(clientData, interp, objc, objv);
+
     if (objc != 2) {
       Tcl_WrongNumArgs(interp, 1, objv, "code");
       return TCL_ERROR;
@@ -51,12 +55,16 @@
 /* ----------------------------------------------------------------------------
  * Web_Finalizer -- just eval the code
  * ------------------------------------------------------------------------- */
-int Web_Finalizer(ClientData clientData,
+int __declspec(dllexport) Web_Finalizer(ClientData clientData,
 		  Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
 {
 
     int res = 0;
 
+    ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+    if (apFuncs != NULL)
+      return apFuncs->Web_Finalizer(clientData, interp, objc, objv);
+
     if (objc != 2) {
       Tcl_WrongNumArgs(interp, 1, objv, "code");
       return TCL_ERROR;
@@ -72,9 +80,12 @@
 /* ----------------------------------------------------------------------------
  * Web_Finalizer -- just return
  * ------------------------------------------------------------------------- */
-int Web_Finalize(ClientData clientData,
+int __declspec(dllexport) Web_Finalize(ClientData clientData,
 		 Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
 {
+    ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+    if (apFuncs != NULL)
+      return apFuncs->Web_Finalize(clientData, interp, objc, objv);
 
     return TCL_OK;
 }
@@ -82,9 +93,12 @@
 /* ----------------------------------------------------------------------------
  * Web_InterpClassCfg -- just return
  * ------------------------------------------------------------------------- */
-int Web_InterpClassCfg(ClientData clientData,
+int __declspec(dllexport) Web_InterpClassCfg(ClientData clientData,
 		       Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
 {
+    ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+    if (apFuncs != NULL)
+      return apFuncs->Web_InterpClassCfg(clientData, interp, objc, objv);
 
     return TCL_OK;
 }
@@ -92,9 +106,12 @@
 /* ----------------------------------------------------------------------------
  * Web_InterpCfg -- just return
  * ------------------------------------------------------------------------- */
-int Web_InterpCfg(ClientData clientData,
+int __declspec(dllexport) Web_InterpCfg(ClientData clientData,
 		  Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
 {
+    ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+    if (apFuncs != NULL)
+      return apFuncs->Web_InterpCfg(clientData, interp, objc, objv);
 
     return TCL_OK;
 }
@@ -102,9 +119,12 @@
 /* ----------------------------------------------------------------------------
  * Web_MainEval -- just return
  * ------------------------------------------------------------------------- */
-int Web_MainEval(ClientData clientData,
+int __declspec(dllexport) Web_MainEval(ClientData clientData,
 		 Tcl_Interp * interp, int objc, Tcl_Obj * CONST objv[])
 {
+    ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+    if (apFuncs != NULL)
+      return apFuncs->Web_MainEval(clientData, interp, objc, objv);
 
     return TCL_OK;
 }
@@ -136,6 +156,10 @@
   int index;
   Tcl_Obj *res = NULL;
  
+  ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+  if (apFuncs != NULL)
+    return apFuncs->Web_ConfigPath(interp, objc, objv);
+
   if (Tcl_GetIndexFromObj(interp, objv[1], subCmd, "subcommand", 0, &index)
       != TCL_OK) {
     /* let the caller handle the w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4config command */
@@ -179,6 +203,10 @@
  * ------------------------------------------------------------------------- */
 int modwebsh_createcmd(Tcl_Interp * interp)
 {
+    if (NULL != Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL)) {
+      /* no need to do that if we're in mod_websh mode */
+      return TCL_OK;
+    }
 
     Tcl_CreateObjCommand(interp, "w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4initializer",
 			 Web_Initializer, NULL, NULL);

Added: tcl/websh/trunk/src/generic/modwebsh_cgi.h
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/modwebsh_cgi.h?rev=777449&view=auto
==============================================================================
--- tcl/websh/trunk/src/generic/modwebsh_cgi.h (added)
+++ tcl/websh/trunk/src/generic/modwebsh_cgi.h Fri May 22 10:13:35 2009
@@ -0,0 +1,40 @@
+/*
+ * modwebsh_cgi.h -- additional header file for modwebsh
+ * nca-073-9
+ * 
+ * Copyright (c) 1996-2000 by Netcetera AG.
+ * Copyright (c) 2009 by Apache Software Foundation.
+ * All rights reserved.
+ *
+ * See the file "license.terms" for information on usage and
+ * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * @(#) $Id: modwebsh.h 322352 2002-09-11 09:14:06Z ronnie $
+ *
+ */
+
+#include "webout.h"
+
+#ifndef MODWEBSH_CGI_H
+#define MODWEBSH_CGI_H
+
+typedef struct
+{
+  ResponseObj * (*createDefaultResponseObj) (Tcl_Interp * interp);
+  int (*isDefaultResponseObj) (Tcl_Interp * interp, char *name);
+  Tcl_Obj* (*requestGetDefaultChannelName) (Tcl_Interp * interp);
+  char* (*requestGetDefaultOutChannelName) (Tcl_Interp * interp);
+  int (*requestFillRequestValues) (Tcl_Interp *interp, RequestData *requestData);
+  int (*Web_Initializer) (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+  int (*Web_Finalizer) (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+  int (*Web_Finalize) (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+  int (*Web_InterpCfg) (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+  int (*Web_InterpClassCfg) (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+  int (*Web_MainEval) (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+  int (*Web_ConfigPath) (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+}
+ApFuncs;
+
+#define WEB_APFUNCS_ASSOC_DATA "w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4apfuncs"
+
+#endif

Modified: tcl/websh/trunk/src/generic/request.c
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/request.c?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/request.c (original)
+++ tcl/websh/trunk/src/generic/request.c Fri May 22 10:13:35 2009
@@ -472,7 +472,7 @@
 	switch ((enum params) opt) {
 
 	case DEFAULTCHANNELNAME:
-	    Tcl_SetObjResult(interp, requestGetDefaultChannelName());
+	    Tcl_SetObjResult(interp, requestGetDefaultChannelName(interp));
 	    return TCL_OK;
 	    break;
 	case REQUESTRESET:

Modified: tcl/websh/trunk/src/generic/request.h
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/request.h?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/request.h (original)
+++ tcl/websh/trunk/src/generic/request.h Fri May 22 10:13:35 2009
@@ -193,8 +193,8 @@
 
 /* in CGI case: implemented in request_cgi.c
  * in httpd case: implemented in mod_websh.c */
-Tcl_Obj *requestGetDefaultChannelName();
-char *requestGetDefaultOutChannelName();
+Tcl_Obj *requestGetDefaultChannelName(Tcl_Interp *interp);
+char *requestGetDefaultOutChannelName(Tcl_Interp *interp);
 
 int requestFillRequestValues(Tcl_Interp * interp, RequestData * requestData);
 

Modified: tcl/websh/trunk/src/generic/request_ap.c
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/request_ap.c?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/request_ap.c (original)
+++ tcl/websh/trunk/src/generic/request_ap.c Fri May 22 10:13:35 2009
@@ -28,19 +28,19 @@
 /* ----------------------------------------------------------------------------
  * w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4request -channel: where input for request obj comes from
  * ------------------------------------------------------------------------- */
-Tcl_Obj *requestGetDefaultChannelName()
+Tcl_Obj *requestGetDefaultChannelName_AP(Tcl_Interp * interp)
 {
     return Tcl_NewStringObj(APCHANNEL, -1);
 }
 
 /* default output channel */
 
-char *requestGetDefaultOutChannelName()
+char *requestGetDefaultOutChannelName_AP(Tcl_Interp * interp)
 {
     return APCHANNEL;
 }
 
-int requestFillRequestValues(Tcl_Interp * interp, RequestData * requestData)
+int requestFillRequestValues_AP(Tcl_Interp * interp, RequestData * requestData)
 {
 
     request_rec *r = NULL;
@@ -56,10 +56,6 @@
 
     Tcl_Obj *valo = NULL;
 
-    if (requestData->requestIsInitialized)
-	return TCL_OK;
-    requestData->requestIsInitialized = 1;
-
     if (interp == NULL)
 	return TCL_ERROR;
 

Modified: tcl/websh/trunk/src/generic/request_cgi.c
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/request_cgi.c?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/request_cgi.c (original)
+++ tcl/websh/trunk/src/generic/request_cgi.c Fri May 22 10:13:35 2009
@@ -20,19 +20,28 @@
 #include "hashutl.h"
 #include "webutl.h"
 #include "request.h"
+#include "modwebsh_cgi.h"
 
 /* ----------------------------------------------------------------------------
  * w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4request -channel: where input for request obj comes from
  * ------------------------------------------------------------------------- */
-Tcl_Obj *requestGetDefaultChannelName()
+Tcl_Obj *requestGetDefaultChannelName(Tcl_Interp * interp)
 {
+    ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+    if (apFuncs != NULL)
+      return apFuncs->requestGetDefaultChannelName(interp);
+
     return Tcl_NewStringObj("stdin", 5);
 }
 
 /* default output channel */
 
-char *requestGetDefaultOutChannelName()
+char *requestGetDefaultOutChannelName(Tcl_Interp * interp)
 {
+    ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+    if (apFuncs != NULL)
+      return apFuncs->requestGetDefaultOutChannelName(interp);
+
     return CGICHANNEL;
 }
 
@@ -42,5 +51,12 @@
     if (requestData->requestIsInitialized)
 	return TCL_OK;
     requestData->requestIsInitialized = 1;
+
+    {
+      ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+      if (apFuncs != NULL)
+	return apFuncs->requestFillRequestValues(interp, requestData);
+    }
+
     return Tcl_Eval(interp, "w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cgi888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4opyenv");
 }

Modified: tcl/websh/trunk/src/generic/response_ap.c
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/response_ap.c?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/response_ap.c (original)
+++ tcl/websh/trunk/src/generic/response_ap.c Fri May 22 10:13:35 2009
@@ -148,7 +148,7 @@
 /* ----------------------------------------------------------------------------
  * createDefaultResponseObj
  * ------------------------------------------------------------------------- */
-ResponseObj *createDefaultResponseObj(Tcl_Interp * interp)
+ResponseObj *createDefaultResponseObj_AP(Tcl_Interp * interp)
 {
     return createResponseObj(interp, APCHANNEL, &apHeaderHandler);
 }
@@ -156,7 +156,7 @@
 /* ----------------------------------------------------------------------------
  * isDefaultResponseObj
  * ------------------------------------------------------------------------- */
-int isDefaultResponseObj(char *name)
+int isDefaultResponseObj_AP(Tcl_Interp * interp, char *name)
 {
     return !strcmp(name, APCHANNEL);
 }

Modified: tcl/websh/trunk/src/generic/response_cgi.c
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/response_cgi.c?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/response_cgi.c (original)
+++ tcl/websh/trunk/src/generic/response_cgi.c Fri May 22 10:13:35 2009
@@ -15,21 +15,29 @@
 
 #include "tcl.h"
 #include "hashutl.h"
-#include "webout.h"
 #include "request.h"
+#include "modwebsh_cgi.h"
 
 /* ----------------------------------------------------------------------------
  * createDefaultResponseObj
  * ------------------------------------------------------------------------- */
 ResponseObj *createDefaultResponseObj(Tcl_Interp * interp)
 {
+    ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+    if (apFuncs != NULL)
+      return apFuncs->createDefaultResponseObj(interp);
+
     return createResponseObj(interp, CGICHANNEL, &objectHeaderHandler);
 }
 
 /* ----------------------------------------------------------------------------
  * isDefaultResponseObj
  * ------------------------------------------------------------------------- */
-int isDefaultResponseObj(char *name)
+int isDefaultResponseObj(Tcl_Interp * interp, char *name)
 {
+    ApFuncs *apFuncs = Tcl_GetAssocData(interp, WEB_APFUNCS_ASSOC_DATA, NULL);
+    if (apFuncs != NULL)
+      return apFuncs->isDefaultResponseObj(interp, name);
+
     return !strcmp(name, CGICHANNEL);
 }

Modified: tcl/websh/trunk/src/generic/web.c
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/web.c?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/web.c (original)
+++ tcl/websh/trunk/src/generic/web.c Fri May 22 10:13:35 2009
@@ -19,6 +19,8 @@
 #include <stdio.h>
 #include "messages.h"
 
+int modwebsh_createcmd(Tcl_Interp * interp);
+
 /* ----------------------------------------------------------------------------
  * init --
  * ------------------------------------------------------------------------- */

Modified: tcl/websh/trunk/src/generic/webout.c
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/webout.c?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/webout.c (original)
+++ tcl/websh/trunk/src/generic/webout.c Fri May 22 10:13:35 2009
@@ -288,7 +288,7 @@
 		     * with our special createDefaultResponseObj function ...
 		     */
 
-		    if (isDefaultResponseObj(tname))
+		    if (isDefaultResponseObj(interp, tname))
 			responseObj = createDefaultResponseObj(interp);
 		    else
 			responseObj = getResponseObj(interp, outData, tname);
@@ -334,7 +334,7 @@
 		    name = Tcl_GetString(objv[2]);
 		    /* we have to find the new channel */
 		    if (!strcmp(name, "default")) {
-			name = (char *) requestGetDefaultOutChannelName();
+			name = (char *) requestGetDefaultOutChannelName(interp);
 		    }
 		    responseObj =
 			getResponseObj(interp, outData, name);

Modified: tcl/websh/trunk/src/generic/webout.h
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/webout.h?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/webout.h (original)
+++ tcl/websh/trunk/src/generic/webout.h Fri May 22 10:13:35 2009
@@ -100,7 +100,7 @@
 /* cgi/apache dependent prototypes */
 ResponseObj *createDefaultResponseObj(Tcl_Interp * interp);
 
-int isDefaultResponseObj(char *name);
+int isDefaultResponseObj(Tcl_Interp * interp, char *name);
 
 
 

Modified: tcl/websh/trunk/src/unix/Makefile.in
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/unix/Makefile.in?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/unix/Makefile.in (original)
+++ tcl/websh/trunk/src/unix/Makefile.in Fri May 22 10:13:35 2009
@@ -19,7 +19,7 @@
 
 SCRIPT_SOURCES = ../generic/context.tcl ../generic/script.ws3 ../generic/cookie.ws3 ../generic/sessctx.ws3 
 
-web_OBJECTS_gen = args.o \
+web_OBJECTS = args.o \
 	cfg.o \
 	checksum.o \
 	command.o \
@@ -51,9 +51,8 @@
 	weboutint.o \
 	webutl.o \
 	webutlcmd.o \
-	varchannel.o
-
-web_OBJECTS_cgi = modwebsh_cgi.o \
+	varchannel.o \
+	modwebsh_cgi.o \
 	request_cgi.o \
 	response_cgi.o
 
@@ -65,10 +64,6 @@
 	request_ap.o \
 	response_ap.o
 
-
-web_OBJECTS = $(web_OBJECTS_gen) $(web_OBJECTS_cgi)
-web_ap_OBJECTS := $(web_OBJECTS_gen) $(web_OBJECTS_ap)
-
 OBJECTS = $(web_OBJECTS)
 
 web_LIB_FILE = @web_LIB_FILE@
@@ -268,28 +263,33 @@
 mod_websh.so: mod_websh$(MODULE_LIB_SUFFIX)
 
 
-websh$(VERSION): tclAppInit.$(OBJEXT) $(web_OBJECTS)
-	$(CC) @LDFLAGS@ tclAppInit.$(OBJEXT) $(web_OBJECTS) \
-	$(TCL_LIB_SPEC) $(TCL_STUB_LIB_SPEC) $(TCL_LIBS) $(TCL_LD_FLAGS) -o websh$(VERSION)
-
-mod_websh$(MODULE_LIB_SUFFIX): $(web_ap_OBJECTS)
-	$(SHLIB_LD_CURRENT) -o mod_websh$(MODULE_LIB_SUFFIX) $(web_ap_OBJECTS) $(TCL_LIB_SPEC) $(TCL_STUB_LIB_SPEC)
-
-mod_websh$(UNSHARED_LIB_SUFFIX): $(web_ap_OBJECTS)
-	$(STLIB_LD) $(TCL_LD_FLAGS) -o mod_websh$(UNSHARED_LIB_SUFFIX) $(web_ap_OBJECTS)
+websh$(VERSION): tclAppInit.$(OBJEXT) $(web_LIB_FILE)
+	$(CC) @LDFLAGS@ tclAppInit.$(OBJEXT) $(web_LIB_FILE) \
+	$(TCL_LIB_SPEC) $(TCL_STUB_LIB_SPEC) $(TCL_LIBS) $(TCL_LD_FLAGS) \
+	-o websh$(VERSION)
+
+mod_websh$(MODULE_LIB_SUFFIX): $(web_OBJECTS_ap) $(web_LIB_FILE)
+	$(SHLIB_LD_CURRENT) -o mod_websh$(MODULE_LIB_SUFFIX) \
+	$(web_OBJECTS_ap) $(web_LIB_FILE) $(TCL_LIB_SPEC) $(TCL_STUB_LIB_SPEC)
+
+mod_websh$(UNSHARED_LIB_SUFFIX): $(web_OBJECTS_ap) $(web_OBJECTS)
+	$(STLIB_LD) $(TCL_LD_FLAGS) -o mod_websh$(UNSHARED_LIB_SUFFIX) \
+	$(web_OBJECTS_ap) $(web_OBJECTS)
 
 pure: websh$(VERSION).pure
 
-websh$(VERSION).pure: tclAppInit.$(OBJEXT) $(web_OBJECTS)
-	purify $(CC) @LDFLAGS@ tclAppInit.$(OBJEXT) $(web_OBJECTS) \
-	$(TCL_LIB_SPEC) $(TCL_STUB_LIB_SPEC) $(TCL_LD_FLAGS) -o websh$(VERSION).pure
+websh$(VERSION).pure: tclAppInit.$(OBJEXT) $(web_LIB_FILE)
+	purify $(CC) @LDFLAGS@ tclAppInit.$(OBJEXT) $(web_LIB_FILE) \
+	$(TCL_LIB_SPEC) $(TCL_STUB_LIB_SPEC) $(TCL_LIBS) $(TCL_LD_FLAGS) \
+	-o websh$(VERSION).pure
 	-rm -f *_pure_*.o
 
 cov: websh$(VERSION).cov
 
-websh$(VERSION).cov: tclAppInit.$(OBJEXT) $(web_OBJECTS)
-	purecov $(CC) @LDFLAGS@ tclAppInit.$(OBJEXT) $(web_OBJECTS) \
-	$(TCL_LIB_SPEC) $(TCL_STUB_LIB_SPEC) $(TCL_LD_FLAGS) -o websh$(VERSION).cov
+websh$(VERSION).cov: tclAppInit.$(OBJEXT) $(web_LIB_FILE)
+	purecov $(CC) @LDFLAGS@ tclAppInit.$(OBJEXT) $(web_LIB_FILE) \
+	$(TCL_LIB_SPEC) $(TCL_STUB_LIB_SPEC) $(TCL_LIBS) $(TCL_LD_FLAGS) \
+	-o websh$(VERSION).cov
 	-rm -f *_pure_*.o
 
 .SUFFIXES: .c .o .obj
@@ -308,7 +308,7 @@
 	-rm -f *~ ../*~ ../*/*~
 	-rm -f ../tests/locktest.*
 	-rm -rf ../apachetests/logs ../apachetest/conf/server.conf ../apachetest/conf/websh.conf
-	-rm -f $(web_OBJECTS) $(web_ap_OBJECTS) mod_websh$(SHARED_LIB_SUFFIX) mod_websh$(UNSHARED_LIB_SUFFIX)
+	-rm -f $(web_OBJECTS) $(web_OBJECTS_ap) mod_websh$(SHARED_LIB_SUFFIX) mod_websh$(UNSHARED_LIB_SUFFIX)
 	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
 
 distclean: clean

Modified: tcl/websh/trunk/src/win/Makefile
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/win/Makefile?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/win/Makefile (original)
+++ tcl/websh/trunk/src/win/Makefile Fri May 22 10:13:35 2009
@@ -44,7 +44,7 @@
 	../generic/sessctx.ws3 
 
 # generic objects
-web_OBJECTS_gen = \
+web_OBJECTS = \
 	args.obj \
 	cfg.obj \
 	checksum.obj \
@@ -76,10 +76,7 @@
 	weboutint.obj \
 	webutl.obj \
 	webutlcmd.obj \
-	varchannel.obj
-
-# CGI objects (for websh.exe)
-web_OBJECTS_cgi = \
+	varchannel.obj \
 	modwebsh_cgi.obj \
 	request_cgi.obj \
 	response_cgi.obj
@@ -95,9 +92,6 @@
 	response_ap.obj
 
 
-web_OBJECTS = $(web_OBJECTS_gen) $(web_OBJECTS_cgi)
-web_ap_OBJECTS = $(web_OBJECTS_gen) $(web_OBJECTS_ap)
-
 # install directories
 bindir = $(INSTALL_PREFIX)/bin
 moddir = $(INSTALL_PREFIX)/modules
@@ -224,22 +218,24 @@
 
 websh.exe: websh$(VERSION).exe websh$(VERSION).dll
 
-mod_websh.so: mod_websh$(VERSION).so
+mod_websh.so: mod_websh$(VERSION).so websh$(VERSION).dll
 
-websh$(VERSION).exe: tclAppInit.$(OBJEXT) $(web_OBJECTS)
+websh$(VERSION).exe: tclAppInit.$(OBJEXT) websh$(VERSION).dll
 	$(CCLD) $(LD_CFLAGS) $(EXEC_CFLAGS) \
-	tclAppInit.$(OBJEXT) $(web_OBJECTS) \
-	$(TCL_LIB_SPEC) $(TCL_LIBS) -o websh$(VERSION).exe \
+	tclAppInit.$(OBJEXT) websh$(VERSION).lib \
+	$(TCL_LIB_SPEC) $(TCL_STUB_LIB_SPEC) $(TCL_LIBS) -o websh$(VERSION).exe \
 	/link /nodefaultlib:$(DEFAULT_MSVCRT)
 
-mod_websh$(VERSION).so: $(web_ap_OBJECTS)
+mod_websh$(VERSION).so: $(web_OBJECTS_ap) websh$(VERSION).dll
 	$(CCLD) $(LD_CFLAGS) $(SHLIB_CFLAGS) -o mod_websh$(VERSION).so \
-	$(web_ap_OBJECTS) $(TCL_LIB_SPEC) $(HTTPD_LIBS) $(TCL_LIBS) \
+	$(web_OBJECTS_ap) websh$(VERSION).lib $(TCL_LIB_SPEC) \
+	$(TCL_STUB_LIB_SPEC) $(HTTPD_LIBS) $(TCL_LIBS) \
 	/link /dll /nodefaultlib:msvcrt.lib /subsystem:windows
 
 websh$(VERSION).dll: $(web_OBJECTS)
         $(CCLD) $(LD_CFLAGS) $(SHLIB_CFLAGS) -o websh$(VERSION).dll \
-	$(web_OBJECTS) $(TCL_LIB_SPEC) $(TCL_LIBS) /link /dll \
+	$(web_OBJECTS) $(TCL_LIB_SPEC) $(TCL_STUB_LIB_SPEC) \
+	$(TCL_LIBS) /link /dll \
 	/nodefaultlib:$(DEFAULT_MSVCRT) /subsystem:windows
 
 test: websh.exe

Modified: tcl/websh/trunk/src/win/README
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/win/README?rev=777449&r1=777448&r2=777449&view=diff
==============================================================================
--- tcl/websh/trunk/src/win/README (original)
+++ tcl/websh/trunk/src/win/README Fri May 22 10:13:35 2009
@@ -9,7 +9,7 @@
 The following variables in the Makefile must be adapted to your system:
 
   TCL_PREFIX=C:/Program Files/Tcl
-  TCL_VERSION=83
+  TCL_VERSION=85
   HTTPD_PREFIX=C:/Program Files/Apache Group/Apache2
   INSTALL_PREFIX=C:/Program Files/Apache Group/Websh
 
@@ -33,6 +33,9 @@
 nmake test
       Run test suite that checks websh<version>.exe and websh<version>.dll
 
+nmake apachetest
+      Run test suite on mod_websh.so running within Apache Web Server.
+
 nmake clean
       Clean up all output files
 



---------------------------------------------------------------------
To unsubscribe, e-mail: wurobert@example.net
For additional commands, e-mail: wurobert@example.net


From wurobert@example.net Fri May 22 13:18:09 2009
Return-Path: <wurobert@example.net>
Delivered-To: wurobert@example.net
Received: (qmail 62560 invoked from network); 22 May 2009 13:18:08 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur.apache.org with SMTP; 22 May 2009 13:18:08 -0000
Received: (qmail 49668 invoked by uid 500); 22 May 2009 13:18:21 -0000
Delivered-To: wurobert@example.net
Received: (qmail 49652 invoked by uid 500); 22 May 2009 13:18:21 -0000
Mailing-List: contact wurobert@example.net; run by ezmlm
Precedence: bulk
List-Help: <mailto:wurobert@example.net>
List-Unsubscribe: <mailto:wurobert@example.net>
List-Post: <mailto:wurobert@example.net>
List-Id: <websh-cvs.tcl.apache.org>
Delivered-To: mailing list wurobert@example.net
Received: (qmail 49643 invoked by uid 99); 22 May 2009 13:18:21 -0000
Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 May 2009 13:18:21 +0000
X-ASF-Spam-Status: No, hits=-2000.0 required=10.0
	tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 May 2009 13:18:18 +0000
Received: by eris.apache.org (Postfix, from userid 65534)
	id 7E362238886C; Fri, 22 May 2009 13:17:57 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r777511 - /tcl/websh/trunk/doc/quickref.xml
Date: Fri, 22 May 2009 13:17:57 -0000
To: wurobert@example.net
From: wurobert@example.net
X-Mailer: svnmailer-1.0.8
Message-Id: <wurobert@example.net>
X-Virus-Checked: Checked by ClamAV on apache.org

Author: ronnie
Date: Fri May 22 13:17:57 2009
New Revision: 777511

URL: http://svn.apache.org/viewvc?rev=777511&view=rev
Log:
- fixed wrong option names of w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurlcfg and clarified defaults

Modified:
    tcl/websh/trunk/doc/quickref.xml

Modified: tcl/websh/trunk/doc/quickref.xml
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/doc/quickref.xml?rev=777511&r1=777510&r2=777511&view=diff
==============================================================================
--- tcl/websh/trunk/doc/quickref.xml (original)
+++ tcl/websh/trunk/doc/quickref.xml Fri May 22 13:17:57 2009
@@ -525,17 +525,17 @@
 
 	<variablelist>
 	  <varlistentry>
-	    <term><option>-protocol</option> <optional><option><replaceable>value</replaceable></option></optional></term>
+	    <term><option>-scheme</option> <optional><option><replaceable>value</replaceable></option></optional></term>
 	    <listitem>
 	      <para>
 		protocol to be used. Defaults to the scheme used to
-		access the page, which is overridden if the user gives
+		access the page, which is overridden if the user
 		sets a value.
 	      </para>
 	    </listitem>
 	  </varlistentry>
 	  <varlistentry>
-	    <term><option>-servername</option> <optional><option><replaceable>value</replaceable></option></optional></term>
+	    <term><option>-host</option> <optional><option><replaceable>value</replaceable></option></optional></term>
 	    <listitem>
 	      <para>
 		server name to be used. Default: taken from request.
@@ -546,7 +546,8 @@
 	    <term><option>-port</option></term>
 	    <listitem>
 	      <para>
-		port number to be used. Default: 80.
+		port number to be used. Default: taken from request, 80 if 
+		not available.
 	      </para>
 	    </listitem>
 	  </varlistentry>



---------------------------------------------------------------------
To unsubscribe, e-mail: wurobert@example.net
For additional commands, e-mail: wurobert@example.net


From wurobert@example.net Fri May 22 13:28:16 2009
Return-Path: <wurobert@example.net>
Delivered-To: wurobert@example.net
Received: (qmail 68014 invoked from network); 22 May 2009 13:28:16 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur.apache.org with SMTP; 22 May 2009 13:28:16 -0000
Received: (qmail 70081 invoked by uid 500); 22 May 2009 13:28:29 -0000
Delivered-To: wurobert@example.net
Received: (qmail 70067 invoked by uid 500); 22 May 2009 13:28:29 -0000
Mailing-List: contact wurobert@example.net; run by ezmlm
Precedence: bulk
List-Help: <mailto:wurobert@example.net>
List-Unsubscribe: <mailto:wurobert@example.net>
List-Post: <mailto:wurobert@example.net>
List-Id: <websh-cvs.tcl.apache.org>
Delivered-To: mailing list wurobert@example.net
Received: (qmail 70058 invoked by uid 99); 22 May 2009 13:28:29 -0000
Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 May 2009 13:28:29 +0000
X-ASF-Spam-Status: No, hits=-1998.5 required=10.0
	tests=ALL_TRUSTED,WEIRD_PORT
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 May 2009 13:28:18 +0000
Received: by eris.apache.org (Postfix, from userid 65534)
	id C7D11238886C; Fri, 22 May 2009 13:27:57 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r777513 - in /tcl/websh/trunk: CHANGES src/ChangeLog
 src/generic/url.c src/tests/cmdurl.test src/win/Makefile
Date: Fri, 22 May 2009 13:27:57 -0000
To: wurobert@example.net
From: wurobert@example.net
X-Mailer: svnmailer-1.0.8
Message-Id: <wurobert@example.net>
X-Virus-Checked: Checked by ClamAV on apache.org

Author: ronnie
Date: Fri May 22 13:27:57 2009
New Revision: 777513

URL: http://svn.apache.org/viewvc?rev=777513&view=rev
Log:
- fixed bug in w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl reported by Ashok P. Nadkarni

Modified:
    tcl/websh/trunk/CHANGES
    tcl/websh/trunk/src/ChangeLog
    tcl/websh/trunk/src/generic/url.c
    tcl/websh/trunk/src/tests/cmdurl.test
    tcl/websh/trunk/src/win/Makefile

Modified: tcl/websh/trunk/CHANGES
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/CHANGES?rev=777513&r1=777512&r2=777513&view=diff
==============================================================================
--- tcl/websh/trunk/CHANGES (original)
+++ tcl/websh/trunk/CHANGES Fri May 22 13:27:57 2009
@@ -9,6 +9,8 @@
 Trunk
 -----
 
+- Bug fix in w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl when using -urlformat
+
 - Dynamic linking of libwebsh.so|dll to websh binary and mod_websh.so
 
 - Improved Cookie handling (deal with unusual format)

Modified: tcl/websh/trunk/src/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/ChangeLog?rev=777513&r1=777512&r2=777513&view=diff
==============================================================================
--- tcl/websh/trunk/src/ChangeLog (original)
+++ tcl/websh/trunk/src/ChangeLog Fri May 22 13:27:57 2009
@@ -1,4 +1,16 @@
 2009-05-22 Brunner Ronnie <wurobert@example.net>
+	* src/generic/url.c:
+	- properly detect host and port in request params
+	  (current servers/browsers deliver port in HTTP_HOST or SERVER_NAME)
+	  this solves a bug reported by Ashok P. Nadkarni in Dec 2008
+	* src/tests/cmdurl.test:
+	- added tests for host different port combinations (that used to
+	  trigger the bug above)
+	* doc/quickref.xml:
+	- fixed wrong option names of w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurlcfg (-scheme and -host)
+	- clarified w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurlcfg defaults.
+
+2009-05-22 Brunner Ronnie <wurobert@example.net>
 	* <all changes>:
 	- allow dynamic linking of libwebsh.so|dll to websh, websh.exe and
 	  mod_websh.so

Modified: tcl/websh/trunk/src/generic/url.c
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/generic/url.c?rev=777513&r1=777512&r2=777513&view=diff
==============================================================================
--- tcl/websh/trunk/src/generic/url.c (original)
+++ tcl/websh/trunk/src/generic/url.c Fri May 22 13:27:57 2009
@@ -24,8 +24,10 @@
 
 
 
-#define WEB_URL_GETFROMREQDATA(scheme,key) \
-    if( urlData->scheme != NULL ) \
+/* if direct is 1: don't try to get configured value, but the one
+   from the environment / requestData */
+#define WEB_URL_GETFROMREQDATA(scheme,key,direct) \
+    if(!direct && urlData->scheme != NULL ) \
       scheme = urlData->scheme; \
     if( scheme == NULL ) \
       if( urlData->requestData != NULL ) \
@@ -676,34 +678,99 @@
     if ((urlformat & WEB_URL_WITH_HOST) != 0) {
 	Tcl_Obj *host = NULL;
 	/* try to get requested host */
-	WEB_URL_GETFROMREQDATA(host, "HTTP_HOST");
+	WEB_URL_GETFROMREQDATA(host, "HTTP_HOST", 0);
 	if (host == NULL) {
 	    /* fall back use server name */
-	    WEB_URL_GETFROMREQDATA(host, "SERVER_NAME");
+	    WEB_URL_GETFROMREQDATA(host, "SERVER_NAME", 0);
 	}
 	if (host != NULL) {
+	    char *hostname = Tcl_GetString(host);
+	    char *colon = hostname;
+	    size_t pos = 0;
+	    size_t len = strlen(hostname);
+	    for (; pos < len; pos++) {
+	      if (*colon++ == ':') {
+		break;
+	      }
+	    }
 	    Tcl_AppendToObj(res, WEBURL_HOST_SEP, -1);
-	    Tcl_AppendObjToObj(res, host);
+
+	    if (pos < len) {
+	      /* only insert up to colon */
+	      Tcl_AppendToObj(res, hostname, pos);
+	      Tcl_DecrRefCount(host);
+	    } else {
+	      Tcl_AppendObjToObj(res, host);
+	      /* reset colon */
+	    }
 	}
     }
 
     if ((urlformat & WEB_URL_WITH_PORT) != 0) {
 	Tcl_Obj *port = NULL;
-	WEB_URL_GETFROMREQDATA(port, "SERVER_PORT");
+
+	/* To get the Port, try the following:
+	  1. Take port explicitly configured in Websh if available
+	  2. Take port from HTTP_HOST or SERVER_NAME if available
+	  3. Take port from SERVER_PORT if available
+	  4. Take default port (fallback)
+	*/
+
+	if (urlData->port != NULL) {
+	  port = urlData->port;
+	  Tcl_IncrRefCount(port);
+	}
+
+	if (port == NULL) {
+	  /* nothign found yet */
+	  /* try to get requested host */
+	  Tcl_Obj *host = NULL;
+	  WEB_URL_GETFROMREQDATA(host, "HTTP_HOST", 1);
+	  if (host == NULL) {
+	    /* fall back use server name */
+	    WEB_URL_GETFROMREQDATA(host, "SERVER_NAME", 1);
+	  }
+	  if (host != NULL) {
+	    char *hostname = Tcl_GetString(host);
+	    char *colon = hostname;
+	    size_t pos = 0;
+	    size_t len = strlen(hostname);
+	    for (; pos < len; pos++) {
+	      if (*colon++ == ':') {
+		break;
+	      }
+	    }
+
+	    if (pos < len) {
+	      /* colon points to port */
+	      port = Tcl_NewStringObj(colon, -1);
+	      Tcl_IncrRefCount(port);
+	    }
+	  }
+	}
+
+	if (port == NULL) {
+	  /* still nothing found */
+	  WEB_URL_GETFROMREQDATA(port, "SERVER_PORT", 0);
+	  if (port != NULL) {
+	    Tcl_IncrRefCount(port);
+	  }
+	}
+
 	Tcl_AppendToObj(res, WEBURL_PORT_SEP, -1);
 	if (port != NULL) {
-	    /* found one in the environment */
-	    Tcl_AppendObjToObj(res, port);
-	}
-	else {
-	    /* output the default port */
-	    Tcl_AppendToObj(res, WEB_DEFAULT_PORT, -1);
+	  /* found one */
+	  Tcl_AppendObjToObj(res, port);
+	  Tcl_DecrRefCount(port);
+	} else {
+	  /* output the default port */
+	  Tcl_AppendToObj(res, WEB_DEFAULT_PORT, -1);
 	}
     }
-
+    
     if ((urlformat & WEB_URL_WITH_SCRIPTNAME) != 0) {
 	Tcl_Obj *scriptname = NULL;
-	WEB_URL_GETFROMREQDATA(scriptname, "SCRIPT_NAME");
+	WEB_URL_GETFROMREQDATA(scriptname, "SCRIPT_NAME", 0);
 	if (scriptname != NULL) {
 	    Tcl_AppendObjToObj(res, scriptname);
 	}
@@ -711,7 +778,7 @@
 
     if ((urlformat & WEB_URL_WITH_PATHINFO) != 0) {
 	Tcl_Obj *pathinfo = NULL;
-	WEB_URL_GETFROMREQDATA(pathinfo, "PATH_INFO");
+	WEB_URL_GETFROMREQDATA(pathinfo, "PATH_INFO", 0);
 	if (pathinfo != NULL) {
 	    Tcl_AppendObjToObj(res, pathinfo);
 	}

Modified: tcl/websh/trunk/src/tests/cmdurl.test
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/tests/cmdurl.test?rev=777513&r1=777512&r2=777513&view=diff
==============================================================================
--- tcl/websh/trunk/src/tests/cmdurl.test (original)
+++ tcl/websh/trunk/src/tests/cmdurl.test Fri May 22 13:27:57 2009
@@ -597,5 +597,153 @@
     set res
 } {11111}
 
+test cmdurl-5.1 {w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl with host from env} {
+
+    cleanParam
+
+    set env(HTTP_HOST) "foo.bar.com:8787"
+    set keys [list -scheme -host -port]
+    foreach key $keys {
+	w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurlcfg $key ""
+    }
+    set res {}
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme host port} aCmd]
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme host} aCmd]
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme port} aCmd]
+    join $res
+} {http://foo.bar.com:8787 http://foo.bar.com http888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4}
+
+test cmdurl-5.2 {w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl with host from env, but given port} {
+
+    cleanParam
+
+    set env(HTTP_HOST) "foo.bar.com:8787"
+    set env(SERVER_NAME) "bar.baz.com:9797"
+
+    set keys [list -scheme -host -port]
+    foreach key $keys {
+	w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurlcfg $key ""
+    }
+    w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurlcfg -port 99
+    set res {}
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme host port} aCmd]
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme host} aCmd]
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme port} aCmd]
+    join $res
+} {http://foo.bar.com:99 http://foo.bar.com http888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4}
+
+test cmdurl-5.3 {w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl with server_name from env} {
+
+    cleanParam
+
+    unset env(HTTP_HOST)
+    set env(SERVER_NAME) "bar.baz.com:9797"
+
+    set keys [list -scheme -host -port]
+    foreach key $keys {
+	w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurlcfg $key ""
+    }
+    set res {}
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme host port} aCmd]
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme host} aCmd]
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme port} aCmd]
+    join $res
+} {http://bar.baz.com:9797 http://bar.baz.com http888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4}
+
+test cmdurl-5.4 {w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl with server_name from env, but given port} {
+
+    cleanParam
+
+    set env(SERVER_NAME) "bar.baz.com:9797"
+
+    set keys [list -scheme -host -port]
+    foreach key $keys {
+	w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurlcfg $key ""
+    }
+    w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurlcfg -port 99
+    set res {}
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme host port} aCmd]
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme host} aCmd]
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme port} aCmd]
+    join $res
+} {http://bar.baz.com:99 http://bar.baz.com http888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4}
+
+test cmdurl-5.5 {w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl with server_name from env, but given host} {
+
+    cleanParam
+
+    set env(SERVER_NAME) "bar.baz.com:9797"
+
+    set keys [list -scheme -host -port]
+    foreach key $keys {
+	w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurlcfg $key ""
+    }
+    w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurlcfg -host tcl.apache.org
+    set res {}
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme host port} aCmd]
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme host} aCmd]
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme port} aCmd]
+    join $res
+} {http://tcl.apache.org:9797 http://tcl.apache.org http888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4}
+
+test cmdurl-5.6 {w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl with server_name from env, but given host and port} {
+
+    cleanParam
+
+    set env(SERVER_NAME) "bar.baz.com:9797"
+    set env(SERVER_PORT) "9898"
+
+    set keys [list -scheme -host -port]
+    foreach key $keys {
+	w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurlcfg $key ""
+    }
+    w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurlcfg -host tcl.apache.org
+    set res {}
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme host port} aCmd]
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme host} aCmd]
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme port} aCmd]
+    join $res
+} {http://tcl.apache.org:9797 http://tcl.apache.org http888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4}
+
+test cmdurl-5.7 {w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl with server_port from env and given host} {
+
+    cleanParam
+
+    unset env(SERVER_NAME)
+    set env(SERVER_PORT) "9898"
+
+    set keys [list -scheme -host -port]
+    foreach key $keys {
+	w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurlcfg $key ""
+    }
+    w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurlcfg -host tcl.apache.org
+    set res {}
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme host port} aCmd]
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme host} aCmd]
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme port} aCmd]
+    join $res
+} {http://tcl.apache.org:9898 http://tcl.apache.org http888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4}
+
+test cmdurl-5.8 {w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl with server_port from env, but configured too} {
+
+    cleanParam
+
+    set env(SERVER_PORT) "9898"
+
+    set keys [list -scheme -host -port]
+    foreach key $keys {
+	w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurlcfg $key ""
+    }
+    w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurlcfg -host tcl.apache.org
+    w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurlcfg -port 9696
+    set res {}
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme host port} aCmd]
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme host} aCmd]
+    lappend res [w888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4cmdurl -urlformat {scheme port} aCmd]
+    join $res
+} {http://tcl.apache.org:9696 http://tcl.apache.org http888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4}
+
+unset env(SERVER_PORT)
+
 # cleanup
 888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4tcltest888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4leanupTests

Modified: tcl/websh/trunk/src/win/Makefile
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/win/Makefile?rev=777513&r1=777512&r2=777513&view=diff
==============================================================================
--- tcl/websh/trunk/src/win/Makefile (original)
+++ tcl/websh/trunk/src/win/Makefile Fri May 22 13:27:57 2009
@@ -17,9 +17,9 @@
 #
 ## configuration variables
 
-TCL_PREFIX=C:/Program Files/Tcl
+TCL_PREFIX=C:/Program Files/ActiveTcl/8.5.6
 TCL_VERSION=85
-HTTPD_PREFIX=C:/Program Files/Apache Software Foundation/Apache2
+HTTPD_PREFIX=C:/Program Files/Apache Software Foundation/Apache2.0.63
 INSTALL_PREFIX=C:/Program Files/Apache Software Foundation/Websh
 
 ## no modifications should be necessary below this line



---------------------------------------------------------------------
To unsubscribe, e-mail: wurobert@example.net
For additional commands, e-mail: wurobert@example.net


From wurobert@example.net Fri May 22 13:31:33 2009
Return-Path: <wurobert@example.net>
Delivered-To: wurobert@example.net
Received: (qmail 69575 invoked from network); 22 May 2009 13:31:33 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155)
  by minotaur.apache.org with SMTP; 22 May 2009 13:31:33 -0000
Received: (qmail 76305 invoked by uid 500); 22 May 2009 13:31:46 -0000
Delivered-To: wurobert@example.net
Received: (qmail 76291 invoked by uid 500); 22 May 2009 13:31:46 -0000
Mailing-List: contact wurobert@example.net; run by ezmlm
Precedence: bulk
List-Help: <mailto:wurobert@example.net>
List-Unsubscribe: <mailto:wurobert@example.net>
List-Post: <mailto:wurobert@example.net>
List-Id: <websh-cvs.tcl.apache.org>
Delivered-To: mailing list wurobert@example.net
Received: (qmail 76282 invoked by uid 99); 22 May 2009 13:31:46 -0000
Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 May 2009 13:31:46 +0000
X-ASF-Spam-Status: No, hits=-2000.0 required=10.0
	tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 May 2009 13:31:43 +0000
Received: by eris.apache.org (Postfix, from userid 65534)
	id DEEE2238886C; Fri, 22 May 2009 13:31:21 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r777514 - /tcl/websh/trunk/src/win/Makefile
Date: Fri, 22 May 2009 13:31:21 -0000
To: wurobert@example.net
From: wurobert@example.net
X-Mailer: svnmailer-1.0.8
Message-Id: <wurobert@example.net>
X-Virus-Checked: Checked by ClamAV on apache.org

Author: ronnie
Date: Fri May 22 13:31:21 2009
New Revision: 777514

URL: http://svn.apache.org/viewvc?rev=777514&view=rev
Log:
- undo last commit (path changes should not have been committed)

Modified:
    tcl/websh/trunk/src/win/Makefile

Modified: tcl/websh/trunk/src/win/Makefile
URL: http://svn.apache.org/viewvc/tcl/websh/trunk/src/win/Makefile?rev=777514&r1=777513&r2=777514&view=diff
==============================================================================
--- tcl/websh/trunk/src/win/Makefile (original)
+++ tcl/websh/trunk/src/win/Makefile Fri May 22 13:31:21 2009
@@ -17,9 +17,9 @@
 #
 ## configuration variables
 
-TCL_PREFIX=C:/Program Files/ActiveTcl/8.5.6
+TCL_PREFIX=C:/Program Files/Tcl
 TCL_VERSION=85
-HTTPD_PREFIX=C:/Program Files/Apache Software Foundation/Apache2.0.63
+HTTPD_PREFIX=C:/Program Files/Apache Software Foundation/Apache2
 INSTALL_PREFIX=C:/Program Files/Apache Software Foundation/Websh
 
 ## no modifications should be necessary below this line



---------------------------------------------------------------------
To unsubscribe, e-mail: wurobert@example.net
For additional commands, e-mail: wurobert@example.net



{'source': 'Apache Software Foundation Public Mail Archives'}