tclhttpd

Check-in [db69fc69d0]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Moved the lib/ directory to modules/httpd This will allow us to add additional modules and plugins in /modules but keep them clearly distinct from the core packages
Timelines: family | ancestors | descendants | both | 4_0
Files: files | file ages | folders
SHA1: db69fc69d095354e7a05c02bd550dfc4c0f1c82f
User & Date: hypnotoad 2015-03-30 18:07:23
Context
2015-03-30
19:33
Added a pkgIndex.tcl file to load the index files from module directories Starting work on an autosetup based ./configure. (Not ready for prime time yet by we are useing a few utilities from it.) check-in: 9c83205bf4 user: hypnotoad tags: 4_0
18:07
Moved the lib/ directory to modules/httpd This will allow us to add additional modules and plugins in /modules but keep them clearly distinct from the core packages check-in: db69fc69d0 user: hypnotoad tags: 4_0
17:51
Added implementation for the DirectOO system, as well as a test script. check-in: ed4da77adf user: hypnotoad tags: 4_0
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to bin/README.

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
		To run on a different port and in the background, try:
	tclsh httpd.tcl -port 80 &
		To try out threads, run with a thread-enabled tclsh and do:
	tclsh httpd.tcl -threads 5
		where this means use up to 5 worker threads.

		httpd.tcl depends on both tclhttpd.rc and httpdthread.tcl,
		as well as the packages in ../lib

tclhttpd.rc	Configuration file with default port, etc.
httpdthread.tcl	Per-thread initialization.

tclhttpd.etc.init
		This is a Solaris startup script:
		/etc/init.d/tclhttpd






|







4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
		To run on a different port and in the background, try:
	tclsh httpd.tcl -port 80 &
		To try out threads, run with a thread-enabled tclsh and do:
	tclsh httpd.tcl -threads 5
		where this means use up to 5 worker threads.

		httpd.tcl depends on both tclhttpd.rc and httpdthread.tcl,
		as well as the packages in ../modules/tclhttpd

tclhttpd.rc	Configuration file with default port, etc.
httpdthread.tcl	Per-thread initialization.

tclhttpd.etc.init
		This is a Solaris startup script:
		/etc/init.d/tclhttpd

Changes to bin/httpd.tcl.

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
..
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# tclhttpd.rc	This has configuration settings like port and host.
#		It is sourced one time by the server during start up
#		before command line arguments are processed.
# httpdthread.tcl	This has the bulk of the initialization code.  It is
#		split out into its own file because it is loaded by
#		by each thread: the main thread and any worker threads
#		created by the "-threads N" command line argument.
# ../lib	The script library that contains most of the TclHttpd
#		implementation
# ../tcllib	The Standard Tcl Library.  TclHttpd ships with a copy
#		of this library because it depends on it.  If you already
#		have copy installed TclHttpd will attempt to find it.
#
# TclHttpd now requires Tcl 8.0 or higher because it depends on some
#	modules in the Standard Tcl Library (tcllib) that use namespaces.
................................................................................
# Auto-detect the configuration
# 1. Development - look for $home/../lib and $home/../../tcllib/modules
# 2. Standalone install - look for $home/../lib/tclhttpd $home/tcllib
# 3. Tcl package install - look for $tcl_library/../tclhttpd

set v 4.0.0

if {[file exist [file join $home ../lib/httpd.tcl]]} {
    # Cases 1 and 2
    set Config(lib) [file join $home ../lib]
} elseif {[file exist [file join $home ../lib/tclhttpd$v]]} {
    # Standard package install (e.g., TclPro)
    # By going one level up, we make all Tcl packages available.
    set Config(lib) [file join $home ../lib]
} else {
    # Hmm - see if Tcl can find it for us.
    tcl_findLibrary tclhttpd $v $v version.tcl TCL_HTTPD_LIBRARY Config(lib)






|







 







|

|







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
..
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# tclhttpd.rc	This has configuration settings like port and host.
#		It is sourced one time by the server during start up
#		before command line arguments are processed.
# httpdthread.tcl	This has the bulk of the initialization code.  It is
#		split out into its own file because it is loaded by
#		by each thread: the main thread and any worker threads
#		created by the "-threads N" command line argument.
# ../modules/tclhttpd	The script library that contains most of the TclHttpd
#		implementation
# ../tcllib	The Standard Tcl Library.  TclHttpd ships with a copy
#		of this library because it depends on it.  If you already
#		have copy installed TclHttpd will attempt to find it.
#
# TclHttpd now requires Tcl 8.0 or higher because it depends on some
#	modules in the Standard Tcl Library (tcllib) that use namespaces.
................................................................................
# Auto-detect the configuration
# 1. Development - look for $home/../lib and $home/../../tcllib/modules
# 2. Standalone install - look for $home/../lib/tclhttpd $home/tcllib
# 3. Tcl package install - look for $tcl_library/../tclhttpd

set v 4.0.0

if {[file exist [file join $home ../modules/tclhttpd/httpd.tcl]]} {
    # Cases 1 and 2
    set Config(lib) [file join $home ../modules]
} elseif {[file exist [file join $home ../lib/tclhttpd$v]]} {
    # Standard package install (e.g., TclPro)
    # By going one level up, we make all Tcl packages available.
    set Config(lib) [file join $home ../lib]
} else {
    # Hmm - see if Tcl can find it for us.
    tcl_findLibrary tclhttpd $v $v version.tcl TCL_HTTPD_LIBRARY Config(lib)

Changes to bin/test/directoo.tcl.

45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
############

# Configure the auto_path so we can find the script library.
# home is the directory containing this script

set home [string trimright [file dirname [info script]] ./]
set home [file normalize [file join [pwd] $home ..]]
set Config(lib) [file join $home .. lib]

# Auto-detect the configuration
# 1. Development - look for $home/../lib and $home/../../tcllib/modules
# 2. Standalone install - look for $home/../lib/tclhttpd $home/tcllib
# 3. Tcl package install - look for $tcl_library/../tclhttpd

set v 4.0.0






|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
############

# Configure the auto_path so we can find the script library.
# home is the directory containing this script

set home [string trimright [file dirname [info script]] ./]
set home [file normalize [file join [pwd] $home ..]]
set Config(lib) [file join $home .. modules]

# Auto-detect the configuration
# 1. Development - look for $home/../lib and $home/../../tcllib/modules
# 2. Standalone install - look for $home/../lib/tclhttpd $home/tcllib
# 3. Tcl package install - look for $tcl_library/../tclhttpd

set v 4.0.0

Name change from lib/MakeIndex to modules/httpd/MakeIndex.

Name change from lib/admin.tcl to modules/httpd/admin.tcl.

Name change from lib/auth.tcl to modules/httpd/auth.tcl.

Name change from lib/cgi.tcl to modules/httpd/cgi.tcl.

Name change from lib/compat.tcl to modules/httpd/compat.tcl.

Name change from lib/config.tcl to modules/httpd/config.tcl.

Name change from lib/cookie.tcl to modules/httpd/cookie.tcl.

Name change from lib/counter.tcl to modules/httpd/counter.tcl.

Name change from lib/debug.tcl to modules/httpd/debug.tcl.

Name change from lib/digest.tcl to modules/httpd/digest.tcl.

Name change from lib/direct.tcl to modules/httpd/direct.tcl.

Name change from lib/directoo.tcl to modules/httpd/directoo.tcl.

Name change from lib/dirlist.tcl to modules/httpd/dirlist.tcl.

Name change from lib/doc.tcl to modules/httpd/doc.tcl.

Name change from lib/doc_error.tcl to modules/httpd/doc_error.tcl.

Name change from lib/doctools.tcl to modules/httpd/doctools.tcl.

Name change from lib/fallback.tcl to modules/httpd/fallback.tcl.

Name change from lib/httpd.tcl to modules/httpd/httpd.tcl.

Name change from lib/imagemap.tcl to modules/httpd/imagemap.tcl.

Name change from lib/include.tcl to modules/httpd/include.tcl.

Name change from lib/log.tcl to modules/httpd/log.tcl.

Name change from lib/logstd.tcl to modules/httpd/logstd.tcl.

Name change from lib/mail.tcl to modules/httpd/mail.tcl.

Name change from lib/maptcl.tcl to modules/httpd/maptcl.tcl.

Name change from lib/maptk.tcl to modules/httpd/maptk.tcl.

Name change from lib/md5hex.tcl to modules/httpd/md5hex.tcl.

Name change from lib/mime.types to modules/httpd/mime.types.

Name change from lib/mtype.tcl to modules/httpd/mtype.tcl.

Name change from lib/objects.tcl to modules/httpd/objects.tcl.

Name change from lib/open.tcl to modules/httpd/open.tcl.

Name change from lib/passcheck.tcl to modules/httpd/passcheck.tcl.

Name change from lib/passgen.tcl to modules/httpd/passgen.tcl.

Name change from lib/pkgIndex.tcl to modules/httpd/pkgIndex.tcl.

Name change from lib/prodebug.tcl to modules/httpd/prodebug.tcl.

Name change from lib/redirect.tcl to modules/httpd/redirect.tcl.

Name change from lib/safecgio.tcl to modules/httpd/safecgio.tcl.

Name change from lib/session.tcl to modules/httpd/session.tcl.

Name change from lib/srvui.tcl to modules/httpd/srvui.tcl.

Name change from lib/status.tcl to modules/httpd/status.tcl.

Name change from lib/stdin.tcl to modules/httpd/stdin.tcl.

Name change from lib/subst.tcl to modules/httpd/subst.tcl.

Name change from lib/tclcrypt.tcl to modules/httpd/tclcrypt.tcl.

Name change from lib/template.tcl to modules/httpd/template.tcl.

Name change from lib/thread.tcl to modules/httpd/thread.tcl.

Name change from lib/upload.tcl to modules/httpd/upload.tcl.

Name change from lib/url.tcl to modules/httpd/url.tcl.

Name change from lib/utils.tcl to modules/httpd/utils.tcl.

Name change from lib/version.tcl to modules/httpd/version.tcl.