├── .github
└── workflows
│ └── build.yml
├── .gitignore
├── .hgignore
├── .hgtags
├── .travis.yml
├── Changelog
├── LICENSE
├── Makefile
├── Makefile.win32
├── NEWS
├── NEWS.template
├── README.md
├── autogen.sh
├── bitbucket-pipelines.yml
├── ca-bundle.crt
├── config.guess
├── config.sub
├── configure.ac
├── contrib
├── banners
│ ├── README
│ ├── msie.html
│ ├── ns_logobig.gif
│ ├── ns_logobig.png
│ ├── ns_logosmall.gif
│ ├── ns_logosmall.png
│ ├── ns_poweredby.gif
│ └── ns_poweredby.png
├── examples
│ ├── index.adp
│ ├── upload.tcl
│ └── writer.tcl
└── start-scripts
│ └── naviserver.SuSE
├── doc
├── README
├── commandlist_include.man
├── images
│ ├── manual
│ │ ├── blueprint3.png
│ │ ├── concurrent-requests1.png
│ │ ├── concurrent-requests2.png
│ │ └── request-phases.png
│ └── naviserver
│ │ ├── naviserver-request-processing.png
│ │ └── tclpro-nsstats.png
└── src
│ ├── README
│ ├── footer.inc
│ ├── header-4.99.inc
│ ├── header-5.0.inc
│ ├── header.inc
│ ├── man-4.99.css
│ ├── man-5.0.css
│ ├── man3
│ └── Ns_Sls.man
│ ├── manual
│ ├── admin-config.man
│ ├── admin-db.man
│ ├── admin-install.man
│ ├── admin-maintenance.man
│ ├── admin-running.man
│ ├── admin-tuning.man
│ ├── adp-overview.man
│ ├── c-driverdb.man
│ ├── c-urlspace.man
│ ├── main-faq.man
│ ├── main-features.man
│ ├── main-history.man
│ ├── main-standards.man
│ ├── tcl-lib-file.man
│ ├── tcl-lib-nstrace.man
│ ├── tcl-libraries.man
│ └── tcl-overview.man
│ ├── naviserver
│ ├── commandlist.man
│ ├── ns_absoluteurl.man
│ ├── ns_addrbyhost.man
│ ├── ns_adp.man
│ ├── ns_adp_abort.man
│ ├── ns_adp_append.man
│ ├── ns_adp_argc.man
│ ├── ns_adp_argv.man
│ ├── ns_adp_bind_args.man
│ ├── ns_adp_break.man
│ ├── ns_adp_close.man
│ ├── ns_adp_ctl.man
│ ├── ns_adp_debug.man
│ ├── ns_adp_dir.man
│ ├── ns_adp_dump.man
│ ├── ns_adp_exception.man
│ ├── ns_adp_flush.man
│ ├── ns_adp_include.man
│ ├── ns_adp_info.man
│ ├── ns_adp_mimetype.man
│ ├── ns_adp_parse.man
│ ├── ns_adp_puts.man
│ ├── ns_adp_register.man
│ ├── ns_adp_return.man
│ ├── ns_adp_stats.man
│ ├── ns_adp_tell.man
│ ├── ns_adp_trunc.man
│ ├── ns_asynclogfile.man
│ ├── ns_atclose.man
│ ├── ns_atsignal.man
│ ├── ns_auth.man
│ ├── ns_base64.man
│ ├── ns_baseunit.man
│ ├── ns_cache.man
│ ├── ns_certctl.man
│ ├── ns_chan.man
│ ├── ns_charsets.man
│ ├── ns_cond.man
│ ├── ns_config.man
│ ├── ns_conn.man
│ ├── ns_connchan.man
│ ├── ns_cookie.man
│ ├── ns_crash.man
│ ├── ns_critsec.man
│ ├── ns_crypt.man
│ ├── ns_crypto.man
│ ├── ns_driver.man
│ ├── ns_encodingforcharset.man
│ ├── ns_encodingfortype.man
│ ├── ns_env.man
│ ├── ns_filestat.man
│ ├── ns_findset.man
│ ├── ns_fmttime.man
│ ├── ns_fseekchars.man
│ ├── ns_ftruncate.man
│ ├── ns_getcontent.man
│ ├── ns_getcsv.man
│ ├── ns_getform.man
│ ├── ns_getformfile.man
│ ├── ns_gifsize.man
│ ├── ns_gmtime.man
│ ├── ns_guesstype.man
│ ├── ns_hash.man
│ ├── ns_hashpath.man
│ ├── ns_hmac.man
│ ├── ns_hostbyaddr.man
│ ├── ns_hotp.man
│ ├── ns_hrefs.man
│ ├── ns_htmlselect.man
│ ├── ns_http.man
│ ├── ns_httptime.man
│ ├── ns_ictl.man
│ ├── ns_imgmime.man
│ ├── ns_imgsize.man
│ ├── ns_imgtype.man
│ ├── ns_info.man
│ ├── ns_internalredirect.man
│ ├── ns_ip.man
│ ├── ns_issmallint.man
│ ├── ns_job.man
│ ├── ns_jpegsize.man
│ ├── ns_kill.man
│ ├── ns_library.man
│ ├── ns_limits.man-retracted
│ ├── ns_localtime.man
│ ├── ns_locationproc.man
│ ├── ns_log.man
│ ├── ns_md.man
│ ├── ns_md5.man
│ ├── ns_memoize.man
│ ├── ns_mkdtemp.man
│ ├── ns_mktemp.man
│ ├── ns_moduleload.man
│ ├── ns_modulepath.man
│ ├── ns_mutex.man
│ ├── ns_normalizepath.man
│ ├── ns_pagepath.man
│ ├── ns_parseargs.man
│ ├── ns_parsefieldvalue.man
│ ├── ns_parseheader.man
│ ├── ns_parsehostport.man
│ ├── ns_parsehttptime.man
│ ├── ns_parsemessage.man
│ ├── ns_parsequery.man
│ ├── ns_parseurl.man
│ ├── ns_percentencode.man
│ ├── ns_pngsize.man
│ ├── ns_purgefiles.man
│ ├── ns_queryexists.man
│ ├── ns_queryget.man
│ ├── ns_querygetall.man
│ ├── ns_rand.man
│ ├── ns_register.man
│ ├── ns_return.man
│ ├── ns_rlimit.man
│ ├── ns_rollfile.man
│ ├── ns_runonce.man
│ ├── ns_rwlock.man
│ ├── ns_schedule.man
│ ├── ns_sema.man
│ ├── ns_sendmail.man
│ ├── ns_server.man
│ ├── ns_serverpath.man
│ ├── ns_serverrootproc.man
│ ├── ns_set.man
│ ├── ns_setexpires.man
│ ├── ns_setformencoding.man
│ ├── ns_setprivileges.man
│ ├── ns_sha1.man
│ ├── ns_shutdown.man
│ ├── ns_sleep.man
│ ├── ns_sls.man
│ ├── ns_sockaccept.man
│ ├── ns_sockblocking.man
│ ├── ns_sockcallback.man
│ ├── ns_sockcheck.man
│ ├── ns_socketpair.man
│ ├── ns_socklisten.man
│ ├── ns_socklistencallback.man
│ ├── ns_socknonblocking.man
│ ├── ns_socknread.man
│ ├── ns_sockopen.man
│ ├── ns_sockselect.man
│ ├── ns_strcoll.man
│ ├── ns_symlink.man
│ ├── ns_thread.man
│ ├── ns_time.man
│ ├── ns_totp.man
│ ├── ns_truncate.man
│ ├── ns_upload_stats.man
│ ├── ns_url2file.man
│ ├── ns_urlcharset.man
│ ├── ns_urlspace.man
│ ├── ns_uudecode.man
│ ├── ns_uuencode.man
│ ├── ns_valid_utf8.man
│ ├── ns_write.man
│ ├── ns_writer.man
│ ├── nsv.man
│ ├── returnstatus-cmds.man
│ └── textutil-cmds.man
│ └── template.man
├── include
├── Makefile.build
├── Makefile.global.in
├── Makefile.module.in
├── Makefile.win32
├── ns.h
├── nscheck.h
├── nsconfig-win32.h
├── nsconfig.h.in
├── nsthread.h
└── nsversion.h.in
├── index.adp
├── install-from-repository.tcl
├── install-sh
├── license.terms
├── m4
├── ax_pthread.m4
├── cmmsg.m4
├── dns.m4
├── gettid.m4
├── misc.m4
├── openssl.m4
├── sendfile.m4
├── tcl.m4
├── usermgt.m4
└── zlib.m4
├── missing
├── naviserver.rdf.in
├── nscgi
├── Makefile
├── doc
│ └── mann
│ │ ├── ns_register_cgi.man
│ │ └── nscgi.man
└── nscgi.c
├── nscp
├── Makefile
├── doc
│ └── mann
│ │ └── nscp.man
└── nscp.c
├── nsd-config.tcl
├── nsd
├── Makefile
├── adpcmds.c
├── adpeval.c
├── adpparse.c
├── adprequest.c
├── auth.c
├── binder.c
├── cache.c
├── callbacks.c
├── cls.c
├── compress.c
├── config.c
├── conn.c
├── connchan.c
├── connio.c
├── cookies.c
├── crypt.c
├── dhparams.h
├── dlist.c
├── dns.c
├── driver.c
├── dstring.c
├── encoding.c
├── event.c
├── exec.c
├── fastpath.c
├── fd.c
├── filter.c
├── form.c
├── httptime.c
├── index.c
├── info.c
├── init.c
├── init.tcl
├── limits.c
├── lisp.c
├── listen.c
├── log.c
├── main.c
├── mimetypes.c
├── modload.c
├── nsconf.c
├── nsd.h
├── nsmain.c
├── nsopenssl.h
├── nsthread.c
├── nswin32.c
├── op.c
├── pathname.c
├── pidfile.c
├── proc.c
├── progress.c
├── queue.c
├── quotehtml.c
├── random.c
├── range.c
├── request.c
├── return.c
├── returnresp.c
├── rollfile.c
├── sched.c
├── server.c
├── set.c
├── sls.c
├── sock.c
├── sockaddr.c
├── sockcallback.c
├── sockfile.c
├── stamp.c
├── str.c
├── task.c
├── tclcache.c
├── tclcallbacks.c
├── tclcmds.c
├── tclconf.c
├── tclcrypto.c
├── tclenv.c
├── tclfile.c
├── tclhttp.c
├── tclimg.c
├── tclinit.c
├── tcljob.c
├── tclmisc.c
├── tclobj.c
├── tclobjv.c
├── tclparsefieldvalue.c
├── tclrequest.c
├── tclresp.c
├── tclsched.c
├── tclset.c
├── tclsock.c
├── tclthread.c
├── tcltime.c
├── tclvar.c
├── tclxkeylist.c
├── tls.c
├── unix.c
├── url.c
├── url2file.c
├── urlencode.c
├── urlopen.c
├── urlspace.c
├── uuencode.c
└── watchdog.c
├── nsdb
├── Makefile
├── db.h
├── dbdrv.c
├── dbinit.c
├── dbtcl.c
├── dbutil.c
├── doc
│ └── mann
│ │ ├── ns_buildsqldate.man
│ │ ├── ns_db.man
│ │ └── ns_dbquotevalues.man
├── nsdb.c
├── nsdb.h
└── util.tcl
├── nsdbtest
├── Makefile
└── nsdbtest.c
├── nslog
├── Makefile
├── doc
│ └── mann
│ │ └── ns_accesslog.man
└── nslog.c
├── nsperm
├── Makefile
├── compat.tcl
├── doc
│ └── mann
│ │ ├── ns_perm.man
│ │ └── nsperm.man
├── group
├── hosts.allow
├── hosts.deny
├── htaccess.tcl
├── init.tcl
├── nsperm.c
├── passwd
└── perms
├── nsproxy
├── Makefile
├── Makefile.win32
├── doc
│ └── mann
│ │ └── ns_proxy.man
├── nsproxy.c
├── nsproxy.h
├── nsproxylib.c
├── nsproxymod.c
└── test-nsproxy.sh
├── nssock
├── Makefile
├── doc
│ └── mann
│ │ └── nssock.man
└── nssock.c
├── nsssl
├── Makefile
├── Makefile.common
├── Makefile.win32
├── README.md
├── doc
│ └── mann
│ │ └── nsssl.man
├── nsssl.c
└── tests
│ ├── all.tcl
│ ├── config.tcl
│ ├── etc
│ └── openssl.cnf
│ ├── modules
│ └── testhttps.tcl
│ ├── nsssl.test
│ └── pages
│ └── 123
├── nsthread
├── .cvsignore
├── Makefile
├── cslock.c
├── error.c
├── fork.c
├── master.c
├── memory.c
├── mutex.c
├── nsthreadtest.c
├── pthread.c
├── reentrant.c
├── rwlock.c
├── sema.c
├── signal.c
├── thread.c
├── thread.h
├── time.c
├── tls.c
└── winthread.c
├── openacs-config.tcl
├── returnnotice.adp
├── revproxy
├── Makefile
├── doc
│ └── mann
│ │ ├── revproxy.man
│ │ └── revproxy1.png
├── revproxy-ns-connchan-procs.tcl
├── revproxy-ns-http-procs.tcl
└── revproxy-procs.tcl
├── sample-config.tcl.in
├── simple-config.tcl
├── tcl
├── aolserver-openacs.tcl
├── cache.tcl
├── charsets.tcl
├── compat.tcl
├── config.tcl
├── fastpath.tcl
├── file.tcl
├── form.tcl
├── http.tcl
├── init.tcl
├── limits.tcl
├── ns_crypto.tcl
├── nstrace.tcl
├── sendmail.tcl
├── tcloo.tcl
├── tclpro-debug.tcl
├── util.tcl
└── win32.tcl
├── tests
├── adp.test
├── all.tcl
├── authorize.test
├── compat.test
├── cookies.test
├── developer
│ ├── path-config.test
│ └── test-paths-config.tcl
├── errordoc.test
├── filter.test
├── http_byteranges.test
├── http_chunked.test
├── http_keep.test
├── http_persistent.test
├── https.test
├── images
│ ├── broken.gif
│ ├── broken.jpg
│ ├── color5x200.gif
│ ├── color5x200.jpg
│ ├── color5x200_progressive.jpg
│ ├── empty.gif
│ ├── empty.jpg
│ └── small.gif
├── keylist.test
├── misc.test
├── ns_accesslog.test
├── ns_addrbyhost.test
├── ns_adp_compress.test
├── ns_base64.test
├── ns_cache.test
├── ns_cond.test
├── ns_config.test
├── ns_conn.test
├── ns_conn_host.test
├── ns_connchan.test
├── ns_crypt.test
├── ns_crypto.test
├── ns_driver.test
├── ns_env.test
├── ns_file.test
├── ns_form.test
├── ns_gifsize.test
├── ns_hashpath.test
├── ns_hostbyaddr.test
├── ns_hrefs.test
├── ns_http.test
├── ns_http_charsets.test
├── ns_httptime.test
├── ns_ictl.test
├── ns_image.test
├── ns_info.test
├── ns_job.test
├── ns_jpegsize.test
├── ns_limits.test
├── ns_listencallback.test
├── ns_log.test
├── ns_md5.test
├── ns_mime.test
├── ns_pagepath.test
├── ns_parseargs.test
├── ns_parsefieldvalue.test
├── ns_parseurl.test
├── ns_perm.test
├── ns_proxy.test
├── ns_reflow_text.test
├── ns_register.test
├── ns_schedule.test
├── ns_server.test
├── ns_serverpath.test
├── ns_set.test
├── ns_sha1.test
├── ns_sls.test
├── ns_striphtml.test
├── ns_thread.test
├── ns_thread_crash.test
├── ns_time.test
├── ns_urlencode.test
├── ns_urlspace.test
├── ns_uuencode.test
├── ns_writer.test
├── nscgi.test
├── nscp.test
├── nsdb.test
├── nsv.test
├── progress.test
├── revproxy.test
├── tclconnio.test
├── tclresp.test
├── test.nscfg
├── testserver
│ ├── certificates
│ │ ├── TESTKEY.pem
│ │ └── openssl.cnf
│ ├── cgi
│ │ ├── info.tclcgi
│ │ ├── resource-cgi.txt
│ │ └── sub
│ │ │ └── resource-cgi-sub.txt
│ ├── modules
│ │ ├── client.tcl
│ │ ├── init-test.tcl
│ │ ├── listencallback-procs.tcl
│ │ ├── ns_cond.tcl
│ │ ├── ns_filter.tcl
│ │ ├── testhttp.tcl
│ │ ├── testhttps.tcl
│ │ └── vhost.tcl
│ ├── pages
│ │ ├── 1
│ │ ├── 2
│ │ ├── 3
│ │ ├── 123
│ │ ├── 10bytes
│ │ ├── 16480bytes
│ │ ├── 2048bytes
│ │ ├── 400return.adp
│ │ ├── adp1.adp
│ │ ├── adp2.adp
│ │ ├── binary
│ │ ├── cgi-wc
│ │ │ ├── listdir.tclcgi
│ │ │ ├── resource-cgi-wc.txt
│ │ │ └── sub
│ │ │ │ └── sub.tclcgi
│ │ ├── csv
│ │ ├── deepnest.adp
│ │ ├── encoding.iso-8859-2_adp
│ │ ├── encoding.iso2iso_adp
│ │ ├── encoding.iso2utf_adp
│ │ ├── encoding.iso_adp
│ │ ├── encoding.utf2iso_adp
│ │ ├── encoding.utf2utf_adp
│ │ ├── encoding.utf_adp
│ │ ├── hello.cgi
│ │ ├── hello.html
│ │ ├── hello.xhtml
│ │ ├── helloworld.adp
│ │ ├── helloworld.tcl
│ │ ├── http_chunked.adp
│ │ ├── http_nonexistent.adp
│ │ ├── http_returntimeout.adp
│ │ ├── info.cgi
│ │ ├── nested.adp
│ │ ├── ns_adp_compress.adp
│ │ ├── ns_http-6.5.2-multipart-mixed.request
│ │ ├── ns_poweredby.png
│ │ ├── test.html
│ │ ├── test.html.gz
│ │ ├── timeout-inc.adp
│ │ ├── timeout.adp
│ │ ├── timeout.tcl
│ │ └── utf-8-chars
│ └── vhosts
│ │ └── t
│ │ └── e
│ │ └── s
│ │ └── testvhost
│ │ └── pages
│ │ ├── 404.tcl
│ │ └── 405.tcl
├── timeout.test
└── url2file.test
├── version_include.man.in
├── win
├── cgitest
│ ├── cgitest.dsp
│ └── main.c
├── group
│ ├── grpall.dsp
│ ├── grpcore.dsp
│ └── grpopenacs.dsp
├── main
│ ├── main.vcxproj
│ ├── main.vcxproj.filters
│ └── main.vcxproj.user
├── naviserver.sln
├── nscgi
│ ├── nscgi.vcxproj
│ └── nscgi.vcxproj.filters
├── nscp
│ ├── .DS_Store
│ ├── nscp.vcxproj
│ ├── nscp.vcxproj.filters
│ └── x64
│ │ └── .DS_Store
├── nsd
│ ├── .DS_Store
│ ├── Release
│ │ └── .DS_Store
│ ├── nsd.vcxproj
│ ├── nsd.vcxproj.filters
│ └── nsd.vcxproj.user
├── nsdb
│ ├── nsdb.dsp
│ ├── nsdb.vcproj
│ ├── nsdb.vcxproj
│ ├── nsdb.vcxproj.filters
│ └── nsdb.vcxproj.user
├── nsdbpg
│ ├── nsdbpg.vcxproj
│ └── nsdbpg.vcxproj.filters
├── nslog
│ ├── nslog.vcxproj
│ └── nslog.vcxproj.filters
├── nsoracle
│ ├── Project1.vcxproj.filters
│ ├── Project1.vcxproj.user
│ └── nsoracle.vcxproj
├── nsperm
│ ├── nsperm.vcxproj
│ └── nsperm.vcxproj.filters
├── nssock
│ ├── nssock.vcxproj
│ └── nssock.vcxproj.filters
├── nsthread
│ ├── Release
│ │ └── vc110.pdb
│ ├── nsthread.vcxproj
│ ├── nsthread.vcxproj.filters
│ └── nsthread.vcxproj.user
├── test
│ ├── nsd.tcl
│ └── servers
│ │ └── test
│ │ └── pages
│ │ ├── cgitest.bat
│ │ └── index.adp
└── threadtest
│ └── threadtest.dsp
├── win32-util
├── configure.tcl
└── install-nsd.tcl
└── win32
├── aolserver.dsw
├── cgitest
├── cgitest.dsp
└── main.c
├── group
├── grpall.dsp
├── grpcore.dsp
└── grpopenacs.dsp
├── main
├── main.dsp
└── main.vcproj
├── naviserver.dsw
├── naviserver.sln
├── nscgi
├── nscgi.dsp
└── nscgi.vcproj
├── nscp
├── nscp.dsp
└── nscp.vcproj
├── nsd
├── nsd.dsp
└── nsd.vcproj
├── nsdb
├── nsdb.dsp
└── nsdb.vcproj
├── nslog
├── nslog.dsp
└── nslog.vcproj
├── nsperm
├── nsperm.dsp
└── nsperm.vcproj
├── nssock
├── nssock.dsp
└── nssock.vcproj
├── nsthread
├── nsthread.dsp
└── nsthread.vcproj
├── test
├── nsd.tcl
└── servers
│ └── test
│ └── pages
│ ├── cgitest.bat
│ └── index.adp
└── threadtest
└── threadtest.dsp
/.gitignore:
--------------------------------------------------------------------------------
1 | *~
2 | *.orig
3 |
4 | *.o
5 | *.so
6 | *.dylib
7 | *.dll
8 | *.exe
9 | *.exp
10 | *.lib
11 | *.pdb
12 | *.ilk
13 | *.DS_Store
14 | *.ast.sh
15 | *.pem
16 | *.pid
17 | *.patch
18 |
19 | autom4te.cache
20 | aclocal.m4
21 | config.log
22 | config.status
23 | configure
24 |
25 | nsd/nsd
26 | nsproxy/nsproxy
27 | nsthread/nsthreadtest
28 | infer-out
29 |
30 | sample-config.tcl
31 | naviserver.rdf
32 | version_include
33 |
34 | doc/html
35 | doc/man
36 | version_include.man
37 |
38 | include/Makefile.global
39 | include/Makefile.module
40 | include/nsconfig.h*
41 | include/nsversion.h
42 | include/nsversion-win32.h
43 | include/stamp-h1
44 |
45 |
--------------------------------------------------------------------------------
/.hgignore:
--------------------------------------------------------------------------------
1 | syntax: glob
2 |
3 | *~
4 | *.orig
5 |
6 | *.o
7 | *.so
8 | *.dylib
9 | *.dll
10 | *.exe
11 | *.exp
12 | *.lib
13 | *.pdb
14 | *.ilk
15 | *.DS_Store
16 | nsd/nsd
17 | nsproxy/nsproxy
18 | nsthread/nsthreadtest
19 | infer-out
20 |
21 | sample-config.tcl
22 | naviserver.rdf
23 | version_include
24 |
25 | include/Makefile.global
26 | include/Makefile.module
27 | include/nsconfig.h*
28 | include/nsversion.h
29 | include/stamp-h1
30 |
31 | aclocal.m4
32 | autom4te.cache
33 | config.cache
34 | config.log
35 | config.status
36 | configure
37 | version_include.man
38 |
39 | tests/testserver/access.log
40 | tests/testserver/nsd.pid
41 |
42 | doc/html
43 | doc/man
44 |
45 | naviserver-*.tar.gz
46 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: c
2 | matrix:
3 | include:
4 | # ----------------------------
5 | - os: linux
6 | dist: xenial
7 | compiler: clang
8 |
9 |
--------------------------------------------------------------------------------
/NEWS.template:
--------------------------------------------------------------------------------
1 | =======================================
2 | NaviServer 4.99.xx, released 2018-XX-XX
3 | =======================================
4 |
5 | New Features:
6 |
7 | Performance Improvements:
8 |
9 | Bug Fixes:
10 |
11 | Documentation improvements:
12 |
13 | Tcl API Changes:
14 |
15 | C API Changes:
16 |
17 | Incompatible API Changes:
18 |
19 | Configuration Changes:
20 |
21 | Command Line Changes:
22 |
23 | Code Changes:
--------------------------------------------------------------------------------
/bitbucket-pipelines.yml:
--------------------------------------------------------------------------------
1 | #
2 | # Copy version to github, since we have there more
3 | # processing minutes for free.
4 | #
5 | clone:
6 | depth: full
7 |
8 | pipelines:
9 | default:
10 | - step:
11 | script:
12 | - git push git@github.com:nm-wu/naviserver-mirror.git
13 |
--------------------------------------------------------------------------------
/contrib/banners/README:
--------------------------------------------------------------------------------
1 |
2 | To indicate that your Web site or Product is powered by
3 | NaviServer you are encouraged to use one of the
4 | Logos found in this directory.
5 |
6 | Choose between two sets:
7 |
8 | GIF-Format (white background):
9 |
10 | ns_poweredby.gif ("Powered by NaviServer."), 135x24 px
11 | ns_logosmall.gif 106x28 px
12 | ns_logobig.gif 156x38 px
13 |
14 | and PNG-Format suitable for many different backgrounds:
15 |
16 | ns_poweredby.png ("Powered by NaviServer."), 133x22 px
17 | ns_logosmall.png 104x26 px
18 | ns_logobig.png 154x36 px
19 |
20 | If you want to use a PNG version in the MS IE browsers
21 | and experience problems with alpha channel transparency
22 | take the file 'msie.html' as an example for a workaround.
23 |
--------------------------------------------------------------------------------
/contrib/banners/msie.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | NaviServer - Logo examples for PNG images in MS IE browser
5 |
6 |
7 |
8 |
9 |
10 |
12 |
13 |
14 |
15 |
17 |
18 |
19 |
20 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/contrib/banners/ns_logobig.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/contrib/banners/ns_logobig.gif
--------------------------------------------------------------------------------
/contrib/banners/ns_logobig.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/contrib/banners/ns_logobig.png
--------------------------------------------------------------------------------
/contrib/banners/ns_logosmall.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/contrib/banners/ns_logosmall.gif
--------------------------------------------------------------------------------
/contrib/banners/ns_logosmall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/contrib/banners/ns_logosmall.png
--------------------------------------------------------------------------------
/contrib/banners/ns_poweredby.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/contrib/banners/ns_poweredby.gif
--------------------------------------------------------------------------------
/contrib/banners/ns_poweredby.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/contrib/banners/ns_poweredby.png
--------------------------------------------------------------------------------
/contrib/examples/index.adp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Example applications and script for NaviServer
5 |
6 |
7 |
8 |
12 |
13 | Example applications and scripts for NaviServer
14 |
15 |
16 | - Upload page with progress statistics, shows percentage
17 | of completion during the upload.
18 |
19 |
- Writer page with example how writer threads can be used
20 | to return huge files.
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/doc/images/manual/blueprint3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/doc/images/manual/blueprint3.png
--------------------------------------------------------------------------------
/doc/images/manual/concurrent-requests1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/doc/images/manual/concurrent-requests1.png
--------------------------------------------------------------------------------
/doc/images/manual/concurrent-requests2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/doc/images/manual/concurrent-requests2.png
--------------------------------------------------------------------------------
/doc/images/manual/request-phases.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/doc/images/manual/request-phases.png
--------------------------------------------------------------------------------
/doc/images/naviserver/naviserver-request-processing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/doc/images/naviserver/naviserver-request-processing.png
--------------------------------------------------------------------------------
/doc/images/naviserver/tclpro-nsstats.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/doc/images/naviserver/tclpro-nsstats.png
--------------------------------------------------------------------------------
/doc/src/footer.inc:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/doc/src/header-4.99.inc:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/doc/src/header-5.0.inc:
--------------------------------------------------------------------------------
1 |
17 |
--------------------------------------------------------------------------------
/doc/src/header.inc:
--------------------------------------------------------------------------------
1 |
17 |
--------------------------------------------------------------------------------
/doc/src/manual/tcl-lib-file.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin {tcl-lib-file} n [vset version]]
3 | [moddesc {NaviServer Manual}]
4 |
5 | [titledesc {Support for .tcl-style dynamic pages}]
6 |
7 | [description]
8 | When a client requests a page, the page can be a static or dynamic,
9 | where the latter means that the content is computed at the time it is served.
10 | Dynamic content can be provided as .adp files or via .tcl files.
11 | We cover here just the .tcl files.
12 |
13 | [para] By default requests to files with the extension .tcl are served
14 | as plain files (i.e. showing the source code of the .tcl files). By
15 | setting the flag [term enabletclpages] in the configuration file,
16 | NaviServer can be instructed to interpret such files when these are
17 | requested (Tcl pages). Notice the entries in your sample-config.tcl
18 | configuration file:
19 |
20 | [example_begin]
21 | ns_section ns/server/$server/adp {
22 | ns_param enabletclpages false ;# Parse *.tcl files in pagedir.
23 | }
24 | [example_end]
25 |
26 | [para]
27 | When [term enabletclpages] is activated, NaviServer registers
28 | upon startup for all files with the extension .tcl in the directory
29 | [term pagedir] a handler to deliver these files as Tcl pages
30 | (using [cmd ns_register_tcl]). The handler is registered for the HTTP
31 | methods GET, POST and HEAD.
32 |
33 | [see_also nsd adp-overview]
34 | [keywords NaviServer configuration fastpath pagedir]
35 | [manpage_end]
36 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_absoluteurl.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_absoluteurl n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Construct a completed URL from an partial URL based on a base URL}]
6 |
7 | [description]
8 |
9 | [section {COMMANDS}]
10 |
11 | [list_begin definitions]
12 |
13 | [call [cmd ns_absoluteurl] [arg partialurl] [arg baseurl]]
14 |
15 | [para] Constructs a completed URL from a partial (incomplete, e.g., relative) URL
16 | by taking as many parts as possible from the provided base URL. The
17 | function uses internally [cmd ns_parseurl] for parsing the provided
18 | URLs into its components.
19 |
20 | [list_end]
21 |
22 | [section EXAMPLES]
23 |
24 | [example_begin]
25 | % ns_absoluteurl foo.html https://openacs.org/projects/openacs/download/
26 | https://openacs.org/projects/openacs/download/foo.html
27 |
28 | % ns_absoluteurl foo.html {http://[lb]::1[rb]:80/t.html}
29 | http://[lb]::1[rb]:80/foo.html
30 |
31 | % ns_absoluteurl //google.com/ https://openacs.org/forums
32 | https://google.com/
33 | [example_end]
34 |
35 | [see_also ns_parseurl]
36 | [keywords "global built-in" URL]
37 | [manpage_end]
38 |
39 |
40 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_addrbyhost.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_addrbyhost n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Forward lookup a hostname to its IP address}]
6 |
7 | [description]
8 |
9 | This command resolves a [arg hostname] to its IP address. If the hostname cannot be resolved, it throws an error.
10 |
11 | [section {COMMANDS}]
12 |
13 | [list_begin definitions]
14 |
15 | [call [cmd ns_addrbyhost] \
16 | [opt [option -all]] \
17 | [opt --] \
18 | [arg hostname]]
19 |
20 | [para]
21 | [arg hostname]
22 | Name of the hostname to be resolved into IP address. When the option
23 | [option -all] is used, the function returns all resolved IP addresses
24 | for this host.
25 |
26 | [list_end]
27 |
28 |
29 | [section EXAMPLES]
30 |
31 | [example_begin]
32 | % ns_addrbyhost -all www.aol.com
33 | 205.188.18.208 205.188.19.16 64.12.107.131 64.12.21.3
34 | [example_end]
35 |
36 | [example_begin]
37 | % ns_addrbyhost bogus.domain
38 | could not lookup bogus.domain
39 | [example_end]
40 |
41 |
42 | [see_also ns_hostbyaddr]
43 | [keywords "global built-in" dns]
44 |
45 | [manpage_end]
46 |
47 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_adp_append.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_adp_append n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Append data to the output buffer for the current connection}]
6 |
7 | [description]
8 |
9 | This command appends its arguments to the output buffer of the
10 | current connection. The result is identical to calling
11 | [cmd "ns_adp_puts [option -nonewline]"] once for each string argument.
12 |
13 |
14 | [section {COMMANDS}]
15 |
16 | [list_begin definitions]
17 |
18 |
19 | [call [cmd ns_adp_append] [arg "string ..."]]
20 |
21 |
22 | [list_end]
23 |
24 |
25 | [see_also nsd]
26 | [keywords "server built-in" ADP]
27 |
28 | [manpage_end]
29 |
30 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_adp_argc.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_adp_argc n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Return the number of arguments to the current ADP}]
6 |
7 | [description]
8 |
9 | This command returns an integer representing the number of arguments passed to the current ADP. The number of arguments includes the name of the ADP itself, which is located at index zero.
10 |
11 | [section {COMMANDS}]
12 |
13 | [list_begin definitions]
14 | [call [cmd ns_adp_argc]]
15 | [list_end]
16 |
17 | [section EXAMPLES]
18 |
19 | [example_begin]
20 | # In a.adp:
21 | <% ns_adp_include b.adp example a b c %>
22 | [example_end]
23 |
24 | [example_begin]
25 | # In b.adp:
26 | <%
27 | ns_adp_argc ;# => 5
28 | %>
29 | [example_end]
30 |
31 | [see_also ns_adp_include ns_adp_parse ns_adp_argv ns_adp_bind_args nsd]
32 |
33 | [keywords "server built-in" ADP]
34 |
35 |
36 | [manpage_end]
37 |
38 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_adp_argv.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_adp_argv n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 |
6 |
7 | [titledesc {Return the number of arguments to the current ADP}]
8 |
9 | [description]
10 |
11 | This command returns a list of arguments to the current ADP, including the name of the ADP itself as the first element. If index is specified, only that element from the list is returned.
12 |
13 | [section {COMMANDS}]
14 |
15 | [list_begin definitions]
16 |
17 |
18 | [call [cmd ns_adp_argv] \
19 | [opt [arg index]] \
20 | [opt [arg default]] \
21 | ]
22 |
23 |
24 | [list_end]
25 |
26 |
27 | [section EXAMPLES]
28 |
29 | [example_begin]
30 | # In a.adp:
31 | <% ns_adp_include b.adp example a b c %>
32 | [example_end]
33 |
34 | [example_begin]
35 | # In b.adp:
36 | <%
37 | ns_adp_argv ;# => b.adp example a b c
38 | ns_adp_argv 0 ;# => b.adp
39 | ns_adp_argv 4 ;# => c
40 | %>
41 | [example_end]
42 |
43 |
44 | [see_also ns_adp_include ns_adp_parse ns_adp_argc ns_adp_bind_args nsd]
45 | [keywords "server built-in" ADP]
46 |
47 |
48 |
49 | [manpage_end]
50 |
51 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_adp_bind_args.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_adp_bind_args n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Bind ADP arguments to variables}]
6 |
7 | [description]
8 |
9 | This command assigns the ADP arguments from the current ADP frame to variables
10 | specified in one or more varName parameters. There must be an equal number
11 | of varName arguments as there are ADP arguments, otherwise an error will
12 | be thrown.
13 |
14 | Note that the first varName is not assigned the name of the ADP. In other
15 | words, varName starts from index 1 in the ns_adp_argv list.
16 |
17 | [section {COMMANDS}]
18 |
19 | [list_begin definitions]
20 |
21 | [call [cmd ns_adp_bind_args] [arg "varname ..."]]
22 |
23 | [list_end]
24 |
25 |
26 | [section EXAMPLES]
27 |
28 | [example_begin]
29 | # In a.adp:
30 | <% ns_adp_include b.adp 1 2 3 %>
31 | [example_end]
32 |
33 | [example_begin]
34 | # In b.adp:
35 | <%
36 | ns_adp_bind_args x y z
37 | ns_adp_puts "x=$x y=$y z=$z" ;# => {1 2 3}
38 | %>
39 | [example_end]
40 |
41 |
42 | [see_also ns_adp_include ns_adp_parse ns_adp_argc ns_adp_argv nsd]
43 | [keywords "server built-in" ADP]
44 |
45 | [manpage_end]
46 |
47 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_adp_break.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_adp_break n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Stop processing of the current ADP}]
6 |
7 | [description]
8 |
9 | This command stops processing of the current ADP by throwing a Tcl error
10 | along with an "ADP exception" of ADP_BREAK. Unlike ns_adp_abort, any output
11 | in the ADP buffer is preserved and queued to be sent to the client.
12 |
13 | The optional retval becomes the return value of the ADP if specified,
14 | otherwise an empty string is returned.
15 |
16 | [section {COMMANDS}]
17 |
18 | [list_begin definitions]
19 |
20 |
21 | [call [cmd ns_adp_break] [opt [arg retval]]]
22 |
23 | [list_end]
24 |
25 |
26 | [section EXAMPLES]
27 |
28 | [example_begin]
29 | if {$serveThisADP == 0} {
30 | ns_adp_break
31 | }
32 | [example_end]
33 |
34 |
35 | [see_also ns_adp ns_adp_abort ns_adp_break ns_adp_close \
36 | ns_adp_ctl ns_adp_dump \
37 | ns_adp_flush ns_adp_return]
38 | [keywords "server built-in" ADP]
39 |
40 | [manpage_end]
41 |
42 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_adp_close.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_adp_close n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Flushes the ADP output buffer and closes the HTTP connection}]
6 |
7 | [description]
8 |
9 |
10 | [section {COMMANDS}]
11 |
12 | [list_begin definitions]
13 |
14 | [call [cmd ns_adp_close]]
15 |
16 | This command flushes the ADP output buffer (i.e. sends it to the
17 | browser) and closes the underlying HTTP connection. ADP execution
18 | continues after the connection is closed. Any text appended to the ADP
19 | output buffer after the close is simply discarded when processing is
20 | complete.
21 |
22 | [list_end ]
23 |
24 | [see_also ns_adp ns_adp_abort ns_adp_break ns_adp_close \
25 | ns_adp_ctl ns_adp_dump ns_adp_flush ns_adp_return]
26 | [keywords "server built-in" ADP]
27 |
28 | [manpage_end]
29 |
30 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_adp_dir.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_adp_dir n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Returns the current working directory for an ADP page}]
6 |
7 | [description]
8 |
9 | This command returns the current working directory of the current ADP
10 | page, or empty, if the working directory is not set. The working
11 | directory can be set with [cmd ns_adp_parse].
12 |
13 | [section {COMMANDS}]
14 |
15 | [list_begin definitions]
16 |
17 | [call [cmd ns_adp_dir]]
18 |
19 | [list_end]
20 |
21 | [section EXAMPLES]
22 |
23 | [example_begin]
24 | ns_adp_dir
25 | [example_end]
26 |
27 | [keywords "server built-in" ADP]
28 |
29 | [manpage_end]
30 |
31 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_adp_dump.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_adp_dump n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Return the contents of the current ADP output buffer}]
6 |
7 | [description]
8 |
9 | This command returns the contents of the current ADP output buffer.
10 |
11 | [section {COMMANDS}]
12 |
13 | [list_begin definitions]
14 | [call [cmd ns_adp_dump]]
15 | [list_end]
16 |
17 |
18 | [section EXAMPLES]
19 |
20 | [example_begin]
21 | ns_adp_dump
22 | [example_end]
23 |
24 |
25 | [see_also ns_adp ns_adp_abort ns_adp_break ns_adp_close \
26 | ns_adp_ctl ns_adp_dump \
27 | ns_adp_flush ns_adp_return]
28 | [keywords "server built-in" ADP]
29 |
30 | [manpage_end]
31 |
32 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_adp_exception.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_adp_exception n [vset version]]
3 |
4 | [titledesc {Examine the current ADP exception state}]
5 |
6 | [moddesc {NaviServer Built-in Commands}]
7 |
8 | [description] This function is used to examine the current ADP
9 | exception state.
10 |
11 | [list_begin definitions]
12 |
13 | [call [cmd ns_adp_exception] [opt [arg varname]]]
14 |
15 | [para]
16 | The function returns 0 if the exception state is ok and 1 otherwise.
17 |
18 | [para] If the optional [arg varname] is passed, a variable with that
19 | name will be set for the caller containing the exception state
20 | with one of the following possible values:
21 |
22 | [list_begin itemized]
23 |
24 | [item] [term ok]:
25 | ADP was evaluated successfully
26 |
27 | [item] [term overflow]:
28 | Stack overflow occurred. This might happen, for example, if there was
29 | a recursive call to [cmd ns_adp_include].
30 |
31 | [item] [term abort]:
32 | An attempt to debug failed or ns_adp_abort was called.
33 |
34 | [item] [term break]:
35 | ns_adp_break was called
36 |
37 | [item] [term unknown]:
38 | Unrecognized exception status. This should not occur.
39 |
40 | [list_end]
41 | [list_end]
42 |
43 | [keywords "server built-in" ADP]
44 |
45 | [manpage_end]
46 |
47 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_adp_flush.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_adp_flush n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Flushes the ADP output buffer without closing the HTTP connection}]
6 |
7 | [description]
8 |
9 |
10 | [section {COMMANDS}]
11 |
12 | [list_begin definitions]
13 |
14 | [call [cmd ns_adp_flush]]
15 |
16 | This command flushes the ADP output buffer (i.e. sends the current
17 | content to the browser or writes to the file channel and truncates the
18 | buffer). It will raise a Tcl exception if the underlying flush failed,
19 | for example, if the HTTP connection is closed or the channel write
20 | failed.
21 | [para]
22 | Flushed content is returned in "chunked-encoding" format if
23 | the HTTP protocol version is at least 1.1 (normally the case for all
24 | modern browsers). A call to ns_adp_flush is not normally needed except
25 | for specialized applications as all content is automatically flushed
26 | at the end of a connection or on buffer overflow. See [cmd ns_adp_ctl]
27 | bufsize for details on buffer management.
28 |
29 | [list_end ]
30 |
31 | [see_also ns_adp ns_adp_abort ns_adp_break ns_adp_close \
32 | ns_adp_ctl ns_adp_dump \
33 | ns_adp_flush ns_adp_return]
34 | [keywords "server built-in" ADP]
35 |
36 | [manpage_end]
37 |
38 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_adp_info.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_adp_info n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Get information about currently processing ADP}]
6 |
7 | [description]
8 |
9 | This command returns the currently processing ADP filename with its size and
10 | modification date. This can be useful inside the ADP for generating conditional
11 | Tcl code for templating for example.
12 |
13 | [section {COMMANDS}]
14 |
15 | [list_begin definitions]
16 |
17 | [call [cmd ns_adp_info]]
18 |
19 | [list_end]
20 |
21 | [section EXAMPLES]
22 |
23 | [example_begin]
24 | ns_adp_info
25 |
26 | /usr/local/ns/pages/test.adp 1865 1167237186
27 | [example_end]
28 |
29 | [see_also nsd]
30 | [keywords "server built-in" ADP]
31 |
32 | [manpage_end]
33 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_adp_mimetype.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_adp_mimetype n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Get or set the mime type for the current ADP page}]
6 |
7 | [description]
8 |
9 | This command will either get or set the mime type returned to the
10 | client when the parsing of the page is complete. If called with no
11 | arguments, the current mime type will be returned. If called with one
12 | argument, the mime type will be set to the given mime type. Updating
13 | the mimetype will invoke code to adjust output encoding if necessary.
14 |
15 | [section {NOTES}]
16 |
17 | This command should not be called outside an ADP page.
18 |
19 | [section {COMMANDS}]
20 |
21 | [list_begin definitions]
22 | [call [cmd ns_adp_mimetype] [opt [arg mimetype]]]
23 | [list_end]
24 |
25 | [section EXAMPLES]
26 |
27 | [example_begin]
28 | ns_adp_mimetype
29 | ns_adp_mimetype "text/plain"
30 | [example_end]
31 |
32 |
33 | [see_also "ns_conn outputheaders" ns_guesstype]
34 | [keywords "server built-in" ADP MIME]
35 |
36 | [manpage_end]
37 |
38 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_adp_puts.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_adp_puts n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Append data to the output buffer for the current connection}]
6 |
7 | [description]
8 |
9 | This command appends the string to the output buffer for the current connection.
10 | If [option -nonewline] is specified, a line terminator is not appended after string.
11 |
12 | [para] The [cmd ns_adp_puts] command is similar to [cmd ns_write],
13 | but there are important differences. While [cmd ns_write] writes
14 | directly to the client's connection and allows you to send header
15 | fields and control the output stream at a low-level,
16 | [cmd ns_adp_puts] operates at a higher level by writing to the ADP output
17 | buffer and automatically appending newlines by default. Therefore,
18 | [cmd ns_adp_puts] should be used for output within ADP pages, as it
19 | integrates seamlessly with the ADP processing model and ensures
20 | proper output buffering.
21 |
22 |
23 | [section {COMMANDS}]
24 |
25 | [list_begin definitions]
26 |
27 |
28 | [call [cmd ns_adp_puts] \
29 | [opt [option -nonewline]] \
30 | [opt --] \
31 | [arg string]]
32 |
33 |
34 | [list_end]
35 |
36 |
37 | [see_also nsd ns_write]
38 | [keywords "server built-in" ADP]
39 |
40 | [manpage_end]
41 |
42 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_adp_return.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_adp_return n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Stop processing of the current ADP and return up the call stack}]
6 |
7 | [description]
8 |
9 | This command ends processing of the current ADP and returns up the call stack,
10 | possibly to a previous ADP that had included the current one. Returns retval
11 | or an empty string by default.
12 |
13 | Note that this command returns only one level up the call stack. To return
14 | all the way up the call stack, use ns_adp_break.
15 |
16 | [section {COMMANDS}]
17 |
18 | [list_begin definitions]
19 |
20 |
21 | [call [cmd ns_adp_return] [opt [arg retval]]]
22 |
23 |
24 | [list_end]
25 |
26 |
27 |
28 | [see_also ns_adp ns_adp_abort ns_adp_break ns_adp_close \
29 | ns_adp_ctl ns_adp_dump \
30 | ns_adp_flush ns_adp_return]
31 | [keywords "server built-in" ADP]
32 |
33 | [manpage_end]
34 |
35 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_adp_tell.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_adp_tell n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Get number of bytes in current ADP output buffer}]
6 |
7 | [description]
8 |
9 | This command returns the total number of bytes in the current ADP output buffer.
10 | This may be useful in order to throttle pages that can get too large for the client
11 | to handle due to modem speeds and other factors.
12 |
13 | [section {COMMANDS}]
14 |
15 | [list_begin definitions]
16 |
17 | [call [cmd ns_adp_tell]]
18 |
19 |
20 | [list_end]
21 |
22 | [see_also ns_adp]
23 | [keywords "server built-in" ADP]
24 |
25 | [manpage_end]
26 |
27 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_adp_trunc.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_adp_trunc n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Truncate the ADP output buffer}]
6 |
7 | [description]
8 |
9 | This command truncates the ADP output buffer. Any data that was previously queued
10 | for sending using [cmd ns_adp_puts] or other means is cleared from the
11 | buffer and will not be sent.
12 | If the optional argument [arg length] is omitted, the truncation will
13 | be to zero bytes.
14 |
15 |
16 | [section {COMMANDS}]
17 |
18 | [list_begin definitions]
19 |
20 |
21 | [call [cmd ns_adp_trunc] [opt [arg length]]]
22 |
23 | [list_end]
24 |
25 | [see_also nsd ns_adp_puts]
26 | [keywords "server built-in" ADP]
27 |
28 | [manpage_end]
29 |
30 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_atclose.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_atclose n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Queue a script to run after the current connection is closed}]
6 |
7 | [description]
8 |
9 | This command queues a script to run after the current connection is closed. The script
10 | and optional arg are concatenated together and added to the list of at-close callbacks.
11 | The scripts are executed in the global scope in LIFO (last in, first out) order.
12 |
13 | [section {COMMANDS}]
14 |
15 | [list_begin definitions]
16 |
17 | [call [cmd ns_atclose] [arg script] [opt [arg "arg ..."]]]
18 |
19 | [para] When the optional arguments are provided, these are added to
20 | the command [arg script] to be executed. Therefore, two invocation
21 | styles are supported: either providing a [arg script], or a command
22 | with additional arguments.
23 |
24 | [list_end]
25 |
26 | [see_also ns_atexit ns_atclose ns_atshutdown ns_atsignal]
27 |
28 | [keywords "server built-in" callback]
29 |
30 | [manpage_end]
31 |
32 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_baseunit.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_baseunit n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Check whether the provided byte-array contains a valid UTF-8 byte sequence}]
6 |
7 | [description]
8 |
9 | [section {COMMANDS}]
10 |
11 | [list_begin definitions]
12 |
13 | [call [cmd ns_baseunit] \
14 | [opt [option "-size [arg memory-size]"]] \
15 | [opt [option "-time [arg time]"]] ]
16 |
17 | [para] Convert from memory units or from time units to its
18 | base value using the NaviServer internal converters,
19 | which are used the same way for various commands.
20 | The base unit for a memory size is a byte,
21 | for a time value a second). This command os necessary to
22 | provide Tcl-level commands calculating with these
23 | units to support uniform interfaces (e.g. calculating
24 | cache partition sizes base on values such as 2MB).
25 |
26 | [para] Either [option "-size [arg memory-size]"] or
27 | [option "-time [arg time]"] has to be specified.
28 | Valid time units are μs, ms, s, m, h, d, w, y.
29 | Valid size units are kB, MB, GB, KiB, MiB, GiB.
30 |
31 | [list_end]
32 |
33 | [section EXAMPLES]
34 |
35 | [example_begin]
36 | % ns_baseunit -size 10KB
37 | 10240
38 |
39 | ns_baseunit -time 2.5h
40 | 9000
41 | [example_end]
42 |
43 |
44 | [keywords "global built-in" conversion time size unit]
45 | [manpage_end]
46 |
47 |
48 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_certctl.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_certctl n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {ADP control command}]
6 | [description]
7 |
8 | This command is used for managing (server) certificates loaded into NaviServer.
9 |
10 | [section COMMANDS]
11 |
12 | [list_begin definitions]
13 |
14 | [call [cmd "ns_certctl list"] ]
15 |
16 | List the loaded certificates and their expiry dates.
17 |
18 | [call [cmd "ns_certctl reload"] ]
19 |
20 | Reload the used certificates from the disk. This is e.g. needed, when
21 | expired certificates are renewed and should be loaded into a running
22 | NaviServer instance.
23 |
24 | [list_end]
25 |
26 | [see_also ]
27 | [keywords "server built-in" HTTPS certificate TLS]
28 | [manpage_end]
29 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_charsets.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_charsets n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Determine the charsets for which we have encodings}]
6 |
7 | [description]
8 |
9 | Returns a list of charsets for which we have encodings.
10 |
11 | [section {COMMANDS}]
12 |
13 | [list_begin definitions]
14 |
15 |
16 | [call [cmd ns_charsets]]
17 |
18 |
19 | [list_end]
20 |
21 |
22 | [section EXAMPLES]
23 |
24 | [example_begin]
25 | % ns_charsets
26 | windows-1258 iso-2022-kr macromania...
27 | [example_end]
28 |
29 |
30 | [see_also nsd]
31 | [keywords "global built-in" encoding charset i18n]
32 |
33 | [manpage_end]
34 |
35 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_crash.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 |
3 | [manpage_begin ns_crash n [vset version]]
4 | [moddesc {NaviServer Built-in Commands}]
5 |
6 | [titledesc {Platform-independent Command to Trigger a Segmentation Fault}]
7 |
8 | [description]
9 |
10 | The [cmd ns_crash] command is intended for debugging purposes. It
11 | deliberately causes a segmentation violation (SEGV) in a
12 | platform-independent manner, ensuring that the server process is
13 | interrupted and a core dump is generated. This allows developers and
14 | system administrators to analyze the state of the server at the time
15 | of the crash using a C-level debugger, examining call stacks and
16 | variables as they were at the moment the command was issued.
17 |
18 | [section {COMMANDS}]
19 |
20 | [list_begin definitions]
21 | [call [cmd ns_crash]]
22 |
23 | Forces a segmentation fault, creating a core dump if the server is
24 | configured to allow it. The resulting core file can be analyzed using
25 | tools like [cmd gdb] to investigate the cause and server state.
26 |
27 | [list_end]
28 |
29 | [section EXAMPLES]
30 |
31 | [example_begin]
32 | % ns_crash
33 | [example_end]
34 |
35 | When invoked, the above command will immediately cause the server to
36 | crash, generating a core dump (if allowed by the system and
37 | configuration). This can then be used to diagnose issues in server
38 | code or extensions running within NaviServer.
39 |
40 | [see_also nsd ns_kill ns_shutdown]
41 | [keywords "global built-in" NaviServer debug crash segmentation-fault]
42 | [manpage_end]
43 |
44 |
45 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_crypt.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_crypt n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Encrypt a string for use as a password}]
6 |
7 | [description]
8 |
9 | This command encrypts the key using the salt and returns the encrypted string.
10 | It uses the same algorithm as the Unix crypt command.
11 |
12 | Normally, key is a password, of which the first 8 bytes are significant,
13 | and salt is one or two bytes used to encrypt the key. The string returned
14 | should always be 13 characters long and is usable as the password field in
15 | nscp and nsperm authentication.
16 |
17 | The algorithm used is a one-way cipher, which means that the original plain-text
18 | key cannot be derived knowing the encrypted string alone. However, since only
19 | up to the first 8 bytes of key are significant, only a 64-bit key is effectively used,
20 | which is reasonably attacked with modern computers with ordinary brute-force attacks today.
21 |
22 | [section {COMMANDS}]
23 |
24 | [list_begin definitions]
25 |
26 | [call [cmd ns_crypt] [arg key] [arg salt]]
27 |
28 | [list_end]
29 |
30 |
31 | [section EXAMPLES]
32 |
33 | [example_begin]
34 | % ns_crypt password qy
35 | qyz8eIFW3uJoo
36 | [example_end]
37 |
38 |
39 | [see_also nsd ns_base64 ns_md ns_hmac ns_sha1 ns_md5]
40 | [keywords "global built-in" encoding crypto]
41 |
42 | [manpage_end]
43 |
44 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_encodingforcharset.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_encodingforcharset n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Return the name of the encoding for the specified charset}]
6 |
7 | [description]
8 |
9 | Returns the name of the encoding for the specified charset.
10 |
11 | [section {COMMANDS}]
12 |
13 | [list_begin definitions]
14 | [call [cmd ns_encodingforcharset] [arg charset]]
15 | [list_end]
16 |
17 |
18 | [section EXAMPLES]
19 |
20 | [example_begin]
21 | % ns_encodingforcharset windows-1258
22 | cp1258
23 | [example_end]
24 |
25 |
26 | [see_also nsd]
27 | [keywords "global built-in" ns_charsets i18n]
28 |
29 | [manpage_end]
30 |
31 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_encodingfortype.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_encodingfortype n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Return the encoding implied by the given MIME type string}]
6 |
7 | [description]
8 |
9 | Parses the given MIME type string to determine the character encoding implied by it.
10 | Will use the configured [term OutputCharset] if no charset is explicitly specified in the given string.
11 |
12 |
13 | [section {COMMANDS}]
14 |
15 | [list_begin definitions]
16 |
17 |
18 | [call [cmd ns_encodingfortype] [arg mimetype]]
19 |
20 |
21 | [list_end]
22 |
23 | [section EXAMPLES]
24 |
25 | [example_begin]
26 | % ns_encodingfortype "text/plain; charset=iso-8859-1"
27 | iso8859-1
28 | [example_end]
29 |
30 |
31 | [see_also nsd]
32 | [keywords ns_charsets ns_urlcharset i18n]
33 |
34 | [manpage_end]
35 |
36 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_env.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_env n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 |
6 | [titledesc {Return, change or add a value of an environment variable}]
7 |
8 | [description]
9 |
10 | This command provides thread-safe access to the environment
11 | variables of the currently running nsd process. This differs from the
12 | plain Tcl commands for accessing the environment.
13 |
14 | [section {COMMANDS}]
15 |
16 | [list_begin definitions]
17 |
18 | [call [cmd "ns_env names"]]
19 |
20 | [call [cmd "ns_env exists"] [arg name]]
21 |
22 | [call [cmd "ns_env get"] [opt [option -nocomplain]] [arg name]]
23 |
24 | [call [cmd "ns_env set"] [arg name] [arg value]]
25 |
26 | [call [cmd "ns_env unset"] [opt [option -nocomplain]] [arg name]]
27 |
28 | [list_end]
29 |
30 |
31 | [section EXAMPLES]
32 |
33 | [example_begin]
34 | % ns_env names
35 | CONSOLE TERM INIT_VERSION PATH RUNLEVEL PWD PREVLEVEL SHLVL HOME
36 |
37 | % ns_env get PATH
38 | /usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin
39 |
40 | % ns_env set USER nsd
41 |
42 | % ns_env get USER
43 | nsd
44 |
45 | % ns_env unset USER
46 | [example_end]
47 |
48 |
49 | [see_also nsd]
50 | [keywords "global built-in" ]
51 | [manpage_end]
52 |
53 |
54 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_filestat.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_filestat n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Returns information about a file}]
6 |
7 | [description]
8 |
9 | Invokes the stat kernel call on name, and uses the variable given by
10 | the argument [arg varname] to hold information returned from the
11 | kernel call. [arg varname] is treated as an array variable, and the
12 | following elements of that variable are set: atime, ctime, dev, gid,
13 | ino, mode, mtime, nlink, size, type, uid. Each element except type is
14 | a decimal string with the value of the corresponding field from the
15 | stat return structure; see the manual entry for stat for details on
16 | the meanings of the values. The type element gives the type of the
17 | file in the same form returned by the command file type. This command
18 | returns 1 if system call was successful and array varianle is set or 0
19 | in case of any error or file not found.
20 |
21 | [para]
22 | If Tcl VFS was compiled this command is similar to Tcl file stat command. In case of no Tcl VFS, this
23 | command uses direct system call stat and is much faster.
24 |
25 | [section {COMMANDS}]
26 |
27 | [list_begin definitions]
28 |
29 | [call [cmd ns_filestat] [arg filename] [opt [arg varname]]]
30 |
31 | If [arg varname] is not specified, then ns_filestat behaves similar to file exists, just returns
32 | 1 if file exist, 0 if not accessible
33 |
34 | [list_end]
35 |
36 | [section EXAMPLES]
37 |
38 | [example_begin]
39 | if { [lb]ns_filestat /tmp/info.txt stat[rb] } {
40 | ns_log notice $stat(size)
41 | }
42 | [example_end]
43 |
44 | [keywords "global built-in" ]
45 |
46 | [manpage_end]
47 |
48 |
49 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_findset.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_findset n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Find a set by its name from a list of sets}]
6 |
7 | [description]
8 |
9 | This command is used to find a set by its name from a list of sets and returns the setId
10 | of the first set whose name matches name, or returns an empty string if no set matches.
11 |
12 | [section {COMMANDS}]
13 |
14 | [list_begin definitions]
15 | [call [cmd ns_findset] [arg sets] [arg name]]
16 | [list_end]
17 |
18 |
19 | [section EXAMPLES]
20 |
21 | [example_begin]
22 | % set sets [lb]list[rb]
23 | % lappend sets [lb]ns_set create foo[rb]
24 | d0
25 |
26 | % lappend sets [lb]ns_set create bar[rb]
27 | d0 d1
28 |
29 | % lappend sets [lb]ns_set create baz[rb]
30 | d0 d1 d2
31 |
32 | % ns_findset $sets bar
33 | d1
34 |
35 | % llength [lb]ns_findset $sets quux[rb]
36 | 0
37 |
38 | % ns_set cleanup
39 | [example_end]
40 |
41 | [see_also ns_set]
42 | [keywords ns_set]
43 |
44 | [manpage_end]
45 |
46 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_fmttime.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_fmttime n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Convert seconds to a human-readable format using templates}]
6 |
7 | [description]
8 |
9 | This command produces a string representation of time in seconds since 00:00:00 UTC Jan 1, 1970.
10 |
11 | [para]
12 | [cmd ns_fmttime] uses the [term strftime()] system call, so valid
13 | format strings will vary from platform
14 | to platform. Consult your operating system's documentation for [term strftime()] to see what
15 | valid fmt strings can contain. [term fmt] defaults to "%c" which is supposed to be the preferred
16 | date and time representation for the current locale, which on some platforms should be
17 | "%a %b %e %H:%M:%S %Z %Y".
18 |
19 |
20 | [section {COMMANDS}]
21 |
22 | [list_begin definitions]
23 |
24 |
25 | [call [cmd ns_fmttime] [arg time] [opt [arg fmt]]]
26 |
27 |
28 | [list_end]
29 |
30 | [section EXAMPLES]
31 |
32 | [example_begin]
33 | % ns_fmttime 0
34 | Wed Dec 31 19:00:00 1969
35 | [example_end]
36 |
37 | [example_begin]
38 | % ns_fmttime 0 "%a %b %e %H:%M:%S %Z %Y"
39 | Wed Dec 31 19:00:00 EST 1969
40 | [example_end]
41 |
42 | [example_begin]
43 | % ns_fmttime ns_time "%Y%m%d"
44 | 20040614
45 | [example_end]
46 |
47 |
48 | [keywords "global built-in" time]
49 | [see_also ns_gmtime ns_httptime ns_localtime ns_parsehttptime ns_time]
50 |
51 |
52 | [manpage_end]
53 |
54 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_fseekchars.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_fseekchars n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Seek in an open file for a string}]
6 |
7 | [description]
8 |
9 | This command seeks in a Tcl opened by Tcl channel [arg channelId] for the
10 | provided string [arg searchstring]. The search starts from the
11 | current position in the file. When the string is found, the command
12 | returns the position of the first character in the file and moves the
13 | file pointer to the start of this string. Therefore, the command can be
14 | used for multiple search operations in the file.
15 |
16 | If the string is not found, -1 is returned and the file position is at
17 | end-of-file.
18 |
19 | [section {COMMANDS}]
20 |
21 | [list_begin definitions]
22 |
23 | [call [cmd ns_fseekchars] [arg channelId] [arg searchstring]]
24 |
25 | [list_end]
26 |
27 |
28 | [see_also nsd]
29 | [keywords "global built-in" file seek search]
30 |
31 | [manpage_end]
32 |
33 |
34 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_ftruncate.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_ftruncate n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {truncate an open Tcl channel to a specified length}]
6 |
7 | [description]
8 | This command truncates an open Tcl channel [arg channelId] to the size of length bytes.
9 | If length is not specified then it is assumed to be zero. This command is similar
10 | to the TclX [lb]ftruncate[rb] command.
11 |
12 | [section {COMMANDS}]
13 |
14 | [list_begin definitions]
15 |
16 | [call [cmd ns_ftruncate] [arg channelId] [opt [arg length]]]
17 |
18 | [list_end]
19 |
20 |
21 | [see_also nsd]
22 | [keywords "global built-in" TclX file truncate]
23 |
24 | [manpage_end]
25 |
26 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_getformfile.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_getformfile n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Return a tempfile for a form file field}]
6 |
7 | [description]
8 |
9 | [section COMMANDs]
10 |
11 | [list_begin definitions]
12 |
13 | [call [cmd ns_getformfile] [arg name]]
14 |
15 | return the path of the temporary file uploaded via an HTML input field
16 | named [arg name], or empty when no such file was submitted. When the
17 | input element of the file contains the HTML5 attribute [term multiple],
18 | a list of filenames is potentially returned.
19 |
20 | [list_end]
21 |
22 | For example, when the HTML page contains a form like the following
23 |
24 | [example_begin]
25 |
30 | [example_end]
31 |
32 | and the form is submitted, the server access the submitted files
33 | [term file1] and [term file2] via the following snippet
34 |
35 | [example_begin]
36 | set tmpfile1 [lb]ns_getformfile file1[rb]
37 | set tmpfile2 [lb]ns_getformfile file2[rb]
38 | set fp1 [lb]open $tmpfile1[rb]
39 | ...
40 | [example_end]
41 |
42 | [manpage_end]
43 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_gifsize.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_gifsize n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Determine the width and height of a GIF87 or GIF89 image}]
6 |
7 | [description]
8 | Returns a list of two elements, the width and height of the GIF file specified by filename.
9 | An error is generated if the file does not exist or if it is not a GIF file.
10 |
11 | [section {COMMANDS}]
12 |
13 | [list_begin definitions]
14 |
15 | [call [cmd ns_gifsize] [arg filename]]
16 |
17 | [list_end]
18 |
19 | [section EXAMPLES]
20 |
21 | [example_begin]
22 | % ns_gifsize screenshot.gif
23 | 1024 768
24 | [example_end]
25 |
26 | [example_begin]
27 | % ns_gifsize test.html
28 | invalid GIF file: "test.html"
29 | [example_end]
30 |
31 | [keywords "global built-in" images]
32 | [see_also ns_jpegsize ns_pngsize ns_imgsize ns_imgmime ns_imgtype]
33 |
34 | [manpage_end]
35 |
36 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_gmtime.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_gmtime n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Return current time in Greenwich Mean Time (GMT)}]
6 |
7 | [description]
8 | This command returns a nine-element Tcl list representing the current time in Greenwich Mean
9 | Time (GMT).
10 |
11 | [section {COMMANDS}]
12 |
13 | [list_begin definitions]
14 |
15 | [call [cmd ns_gmtime]]
16 |
17 | [para] The structure of the returned list corresponds to the Unix struct tm time structure:
18 | [list_begin itemized]
19 | [item] seconds]
20 | [item] minutes (0-59)
21 | [item] hours (0-23)
22 | [item] dayofmonth (1-31)
23 | [item] monthofyear (0-11)
24 | [item] year (year-1900)
25 | [item] dayofweek (0-6, Sunday=0)
26 | [item] dayofyear (0-365)
27 | [item] isdst (>0 if Daylight Savings Time is in effect)
28 | [list_end]
29 |
30 | [list_end]
31 |
32 |
33 | [section EXAMPLES]
34 |
35 | [example_begin]
36 | % ns_gmtime
37 | 40 31 2 12 5 104 6 163 0
38 | [example_end]
39 |
40 |
41 | [keywords "global built-in" time]
42 | [see_also ns_fmttime ns_httptime ns_localtime ns_parsehttptime ns_time]
43 |
44 | [manpage_end]
45 |
46 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_hash.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_hash n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Compute a numeric hash value from a string}]
6 |
7 | [description]
8 |
9 | This command takes an arbitrary value and computes from the value a
10 | numeric value (integer). It uses for hashing the Tcl hash function,
11 | such it does not have cryptograthic strength.
12 | This function is very weak against malicious strings;
13 | it is very easy to generate multiple keys that have the same
14 | hashcode. On the other hand, that hardly ever actually occurs.
15 | This function is very cheap and computes
16 | an integer value suitable as input for various functions.
17 |
18 | [para]
19 | The command is useful in combination of the modulo function
20 | e.g. for hash-based partitioning.
21 |
22 | [section {COMMANDS}]
23 |
24 | [list_begin definitions]
25 |
26 | [call [cmd ns_hash] [arg value]]
27 |
28 | [list_end]
29 |
30 |
31 | [section EXAMPLES]
32 |
33 | [example_begin]
34 | % ns_hash "hello world"
35 | 3255479292
36 | [example_end]
37 |
38 |
39 | [see_also nsd ns_crypto ns_md ns_hmac ns_sha1 ns_md5]
40 | [keywords "global built-in" encoding crypto]
41 |
42 | [manpage_end]
43 |
44 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_hashpath.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_hashpath n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Break path into subdirectories}]
6 |
7 | [description]
8 | Hashes the leading characters of string into a path, skipping periods and slashes.
9 | If string contains less characters than levels requested, '_' characters are used as padding.
10 | For example, given the string 'foo' and the levels 2, 3:
11 | foo, 2 -> /f/o
12 | foo, 3 -> /f/o/o
13 |
14 | [section {COMMANDS}]
15 |
16 | [list_begin definitions]
17 |
18 | [call [cmd ns_hashpath] [arg string] [arg levels]]
19 |
20 | [para]
21 | [arg string]
22 | Path to be broken
23 |
24 | [para]
25 | [arg levels]
26 | How many subdirecotries to make
27 |
28 | [list_end]
29 |
30 | [section EXAMPLES]
31 |
32 | [example_begin]
33 | % ns_hashpath foo 3
34 | /f/o/o
35 | [example_end]
36 |
37 |
38 | [see_also nsd]
39 | [keywords "global built-in" NaviServer]
40 | [manpage_end]
41 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_hostbyaddr.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_hostbyaddr n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Reverse lookup an IP address to its hostname}]
6 |
7 | [description]
8 | This command resolves an IP address to its hostname. If the IP address cannot be resolved, it throws an error.
9 |
10 | [section {COMMANDS}]
11 |
12 | [list_begin definitions]
13 |
14 | [call [cmd ns_hostbyaddr] [arg address]]
15 |
16 | [para]
17 | [arg address]
18 | IP Address to be resolved into hostname
19 |
20 | [list_end]
21 |
22 |
23 | [section EXAMPLES]
24 |
25 | [example_begin]
26 | % ns_hostbyaddr 127.0.0.1
27 | localhost
28 | [example_end]
29 |
30 | [example_begin]
31 | % ns_hostbyaddr 0.0.0.0
32 | could not lookup 0.0.0.0
33 | while executing
34 | "ns_hostbyaddr 0.0.0.0"
35 | [example_end]
36 |
37 |
38 | [see_also ns_addrbyhost]
39 | [keywords "global built-in" dns]
40 |
41 | [manpage_end]
42 |
43 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_hrefs.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_hrefs n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Returns URLs from anchor elements in a chunk of HTML}]
6 |
7 | [description]
8 |
9 | This command finds the anchor elements in a chunk of HTML, and
10 | returns a list of the URLs in those elements' href attributes.
11 |
12 | [section {COMMANDS}]
13 |
14 | [list_begin definitions]
15 | [call [cmd ns_hrefs] [arg html]]
16 | [list_end]
17 |
18 |
19 | [section EXAMPLES]
20 |
21 | [example_begin]
22 | % set html {One good website is Google.
23 | Another is Yahoo!}
24 |
25 | % ns_hrefs $html
26 | http://google.com/ http://www.yahoo.com
27 | [example_end]
28 |
29 | [keywords "global built-in" HTML]
30 |
31 | [manpage_end]
32 |
33 |
34 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_httptime.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_httptime n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 |
6 |
7 | [titledesc {Convert seconds to HTTP date format}]
8 |
9 | [description]
10 |
11 | This command converts the time, specified as the number of seconds
12 | from 00:00:00 UTC Jan 1, 1970, to a string in HTTP date format.
13 |
14 | [section {COMMANDS}]
15 |
16 | [list_begin definitions]
17 |
18 |
19 | [call [cmd ns_httptime] [arg time]]
20 |
21 |
22 | [list_end]
23 |
24 | [keywords "global built-in" time]
25 | [see_also ns_fmttime ns_localtime ns_parsehttptime ns_time]
26 |
27 | [manpage_end]
28 |
29 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_imgmime.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_imgmime n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Return the MIME type of an image}]
6 |
7 | [description]
8 | Returns the MIME type of an image based on the image type (and not just
9 | the file extension). Currently JPEG, GIF and PNG files are supported, so the result can be one of
10 | "image/jpeg", "image/gif" or "image/png". If the filetype is not recognized
11 | the type "image/unknown" is returned. An error is generated if the file does
12 | not exist.
13 |
14 | [section {COMMANDS}]
15 |
16 | [list_begin definitions]
17 |
18 | [call [cmd ns_imgmime] [arg filename]]
19 |
20 | [list_end]
21 |
22 | [section EXAMPLES]
23 |
24 | [example_begin]
25 | % ns_imgmime screenshot.jpg
26 | image/jpeg
27 | [example_end]
28 |
29 | [example_begin]
30 | % ns_imgmime test.html
31 | image/unknown
32 | [example_end]
33 |
34 | [example_begin]
35 | % foreach f [lb]glob -nocomplain -types f /tmp/images/*[rb] {
36 | if {[lb]ns_imgtype $f[rb][rb] ne "unknown"} {
37 | puts -nonewline "supported image: "
38 | } else {
39 | puts -nonewline "unsupported file: "
40 | }
41 | lassign [lb]ns_imgsize $f[rb] width height
42 | set mimetype [lb]ns_imgmime $f[rb]
43 | set f [lb]file tail $f[rb]
44 | puts [lb]format "%30s width: %5i height: %5i MIME: %15s" \
45 | $f $width $height $mimetype[rb]
46 | }
47 | unsupported file: support.pdf width: 0 height: 0 MIME: image/unknown
48 | supported image: MARADONNA.jpg width: 294 height: 420 MIME: image/jpeg
49 | [example_end]
50 |
51 | [see_also ns_gifsize ns_pngsize ns_imgsize ns_imgtype ns_guesstype]
52 | [keywords "global built-in" images]
53 |
54 | [manpage_end]
55 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_imgsize.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_imgsize n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Determine the width and height of a JPEG, GIF or PNG image}]
6 |
7 | [description]
8 | Returns a list of two elements, the width and height of the file
9 | specified by filename. Currently files of type JPEG, GIF or PNG are
10 | supported. An error is generated if the file does not exist. If the filetype
11 | is not supported the resulting list returns width and height set to 0 (Whereas
12 | ns_jpegsize, ns_gifsize and ns_pngsize would generate an error).
13 |
14 | [section {COMMANDS}]
15 |
16 | [list_begin definitions]
17 |
18 | [call [cmd ns_imgsize] [arg filename]]
19 |
20 | [list_end]
21 |
22 | [section EXAMPLES]
23 |
24 | [example_begin]
25 | % ns_imgsize screenshot.jpg
26 | 1024 768
27 | [example_end]
28 |
29 | [example_begin]
30 | % file exists test.html
31 | 1
32 | % ns_imgsize test.html
33 | 0 0
34 | [example_end]
35 |
36 | [keywords "global built-in" images]
37 | [see_also ns_gifsize ns_pngsize ns_jpegsize ns_imgtype ns_imgmime]
38 |
39 | [manpage_end]
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_imgtype.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_imgtype n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Return the type of an image}]
6 |
7 | [description]
8 | Returns the type of an image if it can be identified by the particular
9 | image header. Currently JPEG, GIF and PNG files are supported. The result is one of
10 | "jpeg", "gif" or "png". If the filetype is not recognized
11 | the type "unknown" is returned. An error is generated if the file does
12 | not exist.
13 |
14 | [section {COMMANDS}]
15 |
16 | [list_begin definitions]
17 |
18 | [call [cmd ns_imgtype] [arg filename]]
19 |
20 | [list_end]
21 |
22 | [section EXAMPLES]
23 |
24 | [example_begin]
25 | % ns_imgtype screenshot.jpg
26 | jpeg
27 | [example_end]
28 |
29 | [example_begin]
30 | % ns_imgtype test.html
31 | unknown
32 | [example_end]
33 |
34 | [example_begin]
35 | % foreach f [lb]glob -nocomplain -types f /tmp/images/*[rb] {
36 | if {[lb]ns_imgtype $f[rb][rb] ne "unknown"} {
37 | puts -nonewline "supported image: "
38 | } else {
39 | puts -nonewline "unsupported file: "
40 | }
41 | lassign [lb]ns_imgsize $f[rb] width height
42 | set mimetype [lb]ns_imgmime $f[rb]
43 | set f [lb]file tail $f[rb]
44 | puts [lb]format "%30s width: %5i height: %5i MIME: %15s" \
45 | $f $width $height $mimetype[rb]
46 | }
47 | unsupported file: support.pdf width: 0 height: 0 MIME: image/unknown
48 | supported image: MARADONNA.jpg width: 294 height: 420 MIME: image/jpeg
49 | [example_end]
50 |
51 | [see_also ns_gifsize ns_pngsize ns_imgsize ns_imgmime]
52 | [keywords "global built-in" images]
53 |
54 | [manpage_end]
55 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_internalredirect.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_internalredirect n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Re-authorize and restart url processing}]
6 |
7 | [description]
8 |
9 | The "ns_internalredirect" command enables re-authorization
10 | and restart of a connection as if it where originally for
11 | a different [arg location] (relative URI).
12 |
13 | It is possible now to set new request location and re-process the
14 | request from the beginning without using external redirect.
15 | Internal redirect assigns new URL and calls registered proc for new URL inside
16 | the existing connection and using the same Tcl interp.
17 |
18 | [section {COMMANDS}]
19 |
20 | [list_begin definitions]
21 |
22 |
23 | [call [cmd ns_internalredirect] [arg location]]
24 |
25 |
26 | [list_end]
27 |
28 | [section EXAMPLES]
29 |
30 | [example_begin]
31 | if { $login } {
32 | ns_internalredirect /main
33 | return
34 | }
35 | [example_end]
36 |
37 | [see_also nsd returnstatus-cmds]
38 | [keywords "server built-in" redirect]
39 |
40 | [manpage_end]
41 |
42 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_issmallint.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_issmallint n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Test to see if a number is a 'smallint'}]
6 |
7 | [description]
8 |
9 | This command returns true only if value consists entirely of digits, and contains
10 | from 1 to 6 digits. False is returned in all other cases.
11 |
12 | [section {COMMANDS}]
13 |
14 | [list_begin definitions]
15 | [call [cmd ns_issmallint] [arg value]]
16 | [list_end]
17 |
18 |
19 | [section EXAMPLES]
20 |
21 | [example_begin]
22 | ns_issmallint 12
23 | ns_issmallint thisswillreturn0
24 | [example_end]
25 |
26 |
27 | [see_also nsd]
28 |
29 | [manpage_end]
30 |
31 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_jpegsize.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_jpegsize n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Determine the width and height of a JPEG image}]
6 |
7 | [description]
8 | Returns a list of two elements, the width and height of the JPEG file specified by filename.
9 | An error is generated if the file does not exist or if it is not a JPEG file.
10 |
11 | [section {COMMANDS}]
12 |
13 | [list_begin definitions]
14 |
15 | [call [cmd ns_jpegsize] [arg filename]]
16 |
17 | [list_end]
18 |
19 | [section EXAMPLES]
20 |
21 | [example_begin]
22 | % ns_jpegsize screenshot.jpg
23 | 1024 768
24 | [example_end]
25 |
26 | [example_begin]
27 | % ns_jpegsize test.html
28 | invalid JPEG file: "test.html"
29 | [example_end]
30 |
31 | [keywords "global built-in" images]
32 | [see_also ns_gifsize ns_pngsize ns_imgsize ns_imgmime ns_imgtype]
33 |
34 | [manpage_end]
35 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_kill.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_kill n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Send a process a signal}]
6 |
7 | [description]
8 |
9 | The [cmd ns_kill] command sends a signal to a process identified by
10 | its process ID (PID). Although signals are a Unix concept, a minimal
11 | form of signal handling is emulated on Windows platforms.
12 |
13 | [section {COMMANDS}]
14 |
15 | [list_begin definitions]
16 |
17 |
18 | [call [cmd ns_kill] [opt [option {-nocomplain}]] [arg pid] [arg signal]]
19 |
20 | Sends the specified [arg signal] to the process with the given [arg pid].
21 | The [arg signal] must be provided as an integer. If the [option -nocomplain]
22 | option is used, the command will not return an error if it fails to send
23 | the signal.
24 |
25 | [para]
26 | Common signal values (for Unix-like systems) include:
27 |
28 | [list_begin itemized]
29 | [item] SIGHUP: 1
30 | [item] SIGQUIT: 3
31 | [item] SIGABORT: 6
32 | [item] SIGKILL: 9
33 | [item] SIGUSR1: 10
34 | [item] SIGUSR2: 12
35 | [item] SIGTERM: 15
36 | [list_end]
37 |
38 | [para] On Windows, only SIGTERM, SIGABRT, and SIGKILL are supported
39 | through an emulation layer. Under Unix-like systems, SIGQUIT,
40 | SIGKILL, and SIGABRT generate a core dump and can be used similarly
41 | to the [cmd ns_crash] command. Internally, [cmd ns_shutdown] uses
42 | SIGTERM to request a graceful shutdown of the server.
43 |
44 | [list_end]
45 |
46 | [section EXAMPLES]
47 |
48 | [example_begin]
49 | # Send signal SIGUSR1 to the own process
50 | % ns_kill [pid] 10
51 | [example_end]
52 |
53 |
54 | [see_also ns_shutdown ns_job ns_crash]
55 | [keywords "global built-in" restart signals shutdown]
56 |
57 | [manpage_end]
58 |
59 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_library.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_library n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Get the paths to the private and shared Tcl libraries}]
6 |
7 | [description]
8 |
9 | This command returns the path to the private and shared Tcl libraries, optionally specifying a module as well.
10 |
11 | The second argument must either be "private" or "shared". The private library is the same
12 | as what's returned from [cmd "ns_server tcllib"] as defined in the config .tcl at server
13 | start-up. The shared library is relative to the path specified by
14 | [cmd "ns_info home"], in the [const modules/tcl] subdirectory.
15 |
16 | The optional module is simply concatenated to the path returned from ns_library.
17 |
18 | [section {COMMANDS}]
19 |
20 | [list_begin definitions]
21 |
22 |
23 | [call [cmd ns_library] private|shared [opt [arg module]]]
24 |
25 |
26 | [list_end]
27 |
28 |
29 | [section EXAMPLES]
30 |
31 | [example_begin]
32 | % ns_library shared
33 | /home/ns/modules/tcl
34 | [example_end]
35 |
36 | [example_begin]
37 | % file join [lb]ns_info home[rb] modules tcl
38 | /home/ns/modules/tcl
39 | [example_end]
40 |
41 | [example_begin]
42 | % ns_library private exampleModule
43 | /home/ns/servers/exampleServer/tcl/exampleModule
44 | [example_end]
45 |
46 | [example_begin]
47 | % file join [lb]ns_server tcllib[rb] exampleModule
48 | /home/ns/servers/exampleServer/tcl/exampleModule
49 | [example_end]
50 |
51 |
52 | [see_also nsd ns_info ns_server]
53 | [keywords "server built-in" tcllib]
54 |
55 | [manpage_end]
56 |
57 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_localtime.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_localtime n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Return current time in local timezone}]
6 |
7 | [description]
8 |
9 | This command returns a nine-element Tcl list representing the current time in the
10 | system's current timezone. The structure of the list corresponds to the Unix struct tm time structure:
11 |
12 | [list_begin definitions]
13 | [call [cmd ns_localtime] [arg seconds]]
14 | [def] minutes (0-59)
15 | [def] hours (0-23)
16 | [def] dayofmonth (1-31)
17 | [def] monthofyear (0-11)
18 | [def] year (year-1900)
19 | [def] dayofweek (0-6, Sunday=0)
20 | [def] dayofyear (0-365)
21 | [def] isdst (>0 if Daylight Savings Time is in effect)
22 |
23 | [list_end]
24 |
25 | [section {COMMANDS}]
26 |
27 |
28 | [list_begin definitions]
29 |
30 |
31 | [call [cmd ns_localtime]]
32 |
33 |
34 | [list_end]
35 |
36 |
37 | [section EXAMPLES]
38 |
39 | [example_begin]
40 | % ns_localtime
41 | 33 33 22 11 5 104 5 162 1
42 | [example_end]
43 |
44 |
45 | [keywords "global built-in" time]
46 | [see_also ns_fmttime ns_gmtime ns_httptime ns_parsehttptime ns_time]
47 |
48 | [manpage_end]
49 |
50 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_md5.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_md5 n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Returns a 32-character, hex-encoded string containing the MD5 hash of the first argument}]
6 |
7 | [description]
8 | A cryptographic hash (sometimes called digest) is a kind of signature for a text or a data file.
9 | MD5 generates an almost-unique 128-bit signature for a text.
10 |
11 | [section {COMMANDS}]
12 |
13 | [list_begin definitions]
14 |
15 | [call [cmd ns_md5] \
16 | [opt [option -binary]] \
17 | [opt [option --]] \
18 | [arg string]]
19 |
20 | [para]
21 |
22 | Compute an MD5 checksum from the provided [arg string]
23 | When the option [option -binary] is used, the Tcl byte array value
24 | of the provided input argument is used and no UTF-8 interpretation
25 | is performed.
26 |
27 | [list_end]
28 |
29 | [example_begin]
30 | nscp 2> ns_md5 test
31 | 098F6BCD4621D373CADE4E832627B4F6
32 | [example_end]
33 |
34 | [see_also nsd ns_md ns_base64 ns_crypt ns_sha1 ns_rand ns_hmac]
35 | [keywords "global built-in" encoding crypto]
36 |
37 | [manpage_end]
38 |
39 |
40 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_mkdtemp.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_mkdtemp n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 |
6 | [titledesc {Make a unique temporary directory}]
7 |
8 | [description] This command is a wrapper around the POSIX mkdtemp(3)
9 | function in the C standard library, or a NaviServer callback function,
10 | in case it is not available. This function generates a unique
11 | temporary directoryfrom an optional template.
12 |
13 |
14 | [section {COMMANDS}]
15 |
16 | [list_begin definitions]
17 |
18 | [call [cmd ns_mkdtemp] [opt [arg template]]]
19 |
20 | [para]
21 |
22 | This command generates a unique temporary directory using optionally a
23 | template as argument, which is a string whose last six characters must
24 | be XXXXXX, and returns a new string where those are replaced with
25 | random characters such as to make the string a unique directory
26 | entry.
27 |
28 | [para]
29 | If this command is called without the optional parameter it behaves
30 | like
31 | [example_begin]
32 | ns_mkdtemp [lb]ns_config ns/parameters tmpdir[rb]/nsd-XXXXXX
33 | [example_end]
34 |
35 | Don't forget to delete the directory when not needed anymore
36 | [list_end]
37 |
38 |
39 | [section EXAMPLES]
40 |
41 | [example_begin]
42 | % ns_mkdtemp /tmp/foo-XXXXXX
43 | /tmp/foo-rhaGGx
44 | [example_end]
45 |
46 | [see_also ns_mktemp]
47 | [keywords "global built-in" tmp directory]
48 |
49 | [manpage_end]
50 |
51 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_moduleload.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_moduleload n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Load binary module and initialize it}]
6 |
7 | [description]
8 | This command to be used during server initialization to load binary modules.
9 | The usual way to specify them in the configuration file.
10 |
11 | [section {COMMANDS}]
12 |
13 | [list_begin definitions]
14 |
15 | [call [cmd ns_moduleload] \
16 | [opt [option -global]] \
17 | [opt [option "-init [arg value]"]] \
18 | [opt --] \
19 | [arg module] \
20 | [arg file]]
21 |
22 | [para]
23 | [option -global]
24 | Load globally, not into virtual server
25 |
26 | [option {-init init}]
27 | Specify alternative initialization function, by default it is Ns_ModuleInit
28 |
29 | [arg module]
30 | module name
31 |
32 | [arg file]
33 | Full path to the module binary file
34 |
35 | [list_end]
36 |
37 | [see_also nsd]
38 | [keywords "server built-in" NaviServer]
39 | [manpage_end]
40 |
41 |
42 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_modulepath.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_modulepath n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Get the paths to a server's modules}]
6 |
7 | [description]
8 |
9 | This command returns the path to a server's directory and optionally to its modules.
10 | The command does no validation on the server to see if it is actually defined.
11 |
12 | The server directory is a subdirectory of "servers" under the path returned from ns_info home.
13 | Modules are relative to that directory in the subdirectory "modules".
14 |
15 |
16 | [section {COMMANDS}]
17 |
18 | [list_begin definitions]
19 |
20 |
21 | [call [cmd ns_modulepath] [arg server] [opt [arg {module ...}]]]
22 |
23 |
24 | [list_end]
25 |
26 | [section EXAMPLES]
27 |
28 | [example_begin]
29 | % ns_modulepath exampleServer
30 | /home/ns/servers/exampleServer
31 | [example_end]
32 |
33 | [example_begin]
34 | % file join
35 | [example_end]
36 |
37 | [keywords "global built-in" module]
38 |
39 | [manpage_end]
40 |
41 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_normalizepath.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_normalizepath n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Normalize a path}]
6 |
7 | [description]
8 | ns_normalizepath removes any extraneous slashes from the
9 | path and resolves "." and ".." references.
10 |
11 | [para]
12 | For example: [lb]ns_normalizepath /dog/cat/../../rat/../../dog//mouse/..[rb]
13 | returns: /dog
14 |
15 | [section {COMMANDS}]
16 |
17 | [list_begin definitions]
18 |
19 | [call [cmd ns_normalizepath] [arg path]]
20 |
21 | [list_end]
22 |
23 |
24 | [see_also nsd]
25 | [keywords "global built-in" {Tcl file normalize}]
26 |
27 |
28 | [manpage_end]
29 |
30 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_pagepath.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_pagepath n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Return path to current virtual server pages}]
6 |
7 | [description]
8 | This is virtual hosting aware command will return absolute path to the directory with
9 | pages for the current virtual server
10 |
11 | [section {COMMANDS}]
12 |
13 | [list_begin definitions]
14 |
15 | [call [cmd ns_pagepath] \
16 | [opt [option "-host [arg value]"]] \
17 | [opt --] \
18 | [opt [arg "path-segment ..."]] \
19 | ]
20 |
21 | Returns the absolute path to current virtual server page directory
22 | followed by the optional path segments. Similar to [cmd ns_serverpath].
23 |
24 | [para]
25 | The optional [option -host] parameter can be used to return the
26 | path for a certain virtual host. If not specified the value for the
27 | host is taken from the [term host] header field of the current
28 | request.
29 |
30 | [list_end]
31 |
32 | [section EXAMPLES]
33 |
34 | [example_begin]
35 | % ns_pagepath
36 | /usr/local/ns/pages
37 |
38 | % ns_pagepath foo bar
39 | /usr/local/ns/pages/foo/bar
40 | [example_end]
41 |
42 |
43 | [see_also nsd ns_serverpath]
44 | [keywords "global built-in" NaviServer "virtual host"]
45 | [manpage_end]
46 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_parseheader.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_parseheader n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Parse HTTP header}]
6 |
7 | [description]
8 | This function parses a single HTTP header line into a predefined
9 | [cmd ns_set] specified by [arg set].
10 |
11 |
12 | [section {COMMANDS}]
13 |
14 | [list_begin definitions]
15 |
16 | [call [cmd ns_parseheader] \
17 | [opt [option "-prefix [arg value]"]] \
18 | [arg set] [arg headerline] \
19 | [opt [arg disposition]] ]
20 |
21 | [para] The [arg headerline] specifies a line containing HTTP
22 | header fields, where the field name is parsed into a key of the
23 | [cmd ns_set] and the field value to the value of the entry.
24 |
25 | [para]
26 | The option [option -prefix] can be used to specify a prefix for the
27 | key.
28 |
29 | [para]
30 | Optional argument [arg disposition] can be one of the following
31 | [list_begin itemized]
32 | [item] toupper - convert header names to uppercase
33 | [item] tolower - convert header names to lowercase
34 | [item] preserve - preserve the existing case
35 | [list_end]
36 | When no [arg disposition] is provided, it defaults to [term tolower]
37 |
38 | [list_end]
39 |
40 | [section EXAMPLES]
41 |
42 | [example_begin]
43 | set reply [lb]ns_set create reply[rb]
44 | ns_parseheader $reply "Connection: Upgrade"
45 |
46 | #
47 | # Return the content of the ns_set in form of a dict
48 | #
49 | ns_set array $reply
50 | % connection Upgrade
51 | [example_end]
52 |
53 |
54 | [see_also nsd ns_parseurl ns_parsefieldvalue ns_parsemessage]
55 | [keywords "global built-in" NaviServer parse HTTP]
56 | [manpage_end]
57 |
58 |
59 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_parsehostport.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_parsehostport n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Parse a string containing host and an optional port}]
6 |
7 | [description]
8 |
9 | [section {COMMANDS}]
10 |
11 | [list_begin definitions]
12 |
13 | [call [cmd ns_parsehostport] \
14 | [opt [option "-strict"]] \
15 | [opt --] \
16 | [arg hostport]]
17 |
18 | [para] This function interprets the provided string as host
19 | and optional port as defined by the authority elements in RFC 3986.
20 | The function supports IP-literal notation. The functionality is
21 | an subset of [cmd ns_parseurl].
22 |
23 | [para] When [option "-strict"] is specified, the function performs a
24 | more thorough checking of the valid characters for the host (as defined
25 | in RFC 3986, but relaxed by errata #4942). Otherwise, the checking is
26 | kept to the bare minimum.
27 |
28 | [para]
29 | The resulting dict might contain the
30 | following elements: [term host], [term port].
31 |
32 | [list_end]
33 |
34 | [section EXAMPLES]
35 |
36 | [example_begin]
37 | % ns_parsehostport openacs.org:443
38 | host openacs.org port 443
39 |
40 | % ns_parsehostport localhost
41 | host localhost
42 |
43 | % ns_parsehostport {[lb] 2001:628:404:74::31]:443[rb]}
44 | host 2001:628:404:74::31 port 443
45 | [example_end]
46 |
47 | [see_also ns_absoluteurl ns_parsefieldvalue ns_parseheader ns_parseurl]
48 | [keywords "global built-in" parse]
49 | [manpage_end]
50 |
51 |
52 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_parsehttptime.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_parsehttptime n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Convert an HTTP date format string into seconds}]
6 |
7 | [description]
8 |
9 | This command parses a string containing an HTTP date format string
10 | (see RFC 2616 Sec 3.3) and returns the number of seconds since
11 | 00:00:00 UTC Jan 1, 1970.
12 |
13 | [section COMMANDS]
14 |
15 | [list_begin definitions]
16 |
17 | [call [cmd ns_parsehttptime] [arg httptime]]
18 |
19 | [list_end]
20 |
21 |
22 |
23 | [keywords "global built-in" time]
24 | [see_also ns_fmttime ns_httptime ns_localtime ns_parsehttptime ns_time]
25 |
26 | [manpage_end]
27 |
28 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_parsemessage.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_parsemessage n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Parse an HTTP message}]
6 |
7 | [description] This function parses a full HTTP message (first line,
8 | headers, and body) into a Tcl dictionary and parses the header fields
9 | into a new case-insensitive [cmd ns_set]. The implementation cares
10 | about folded (multi-line) header fields.
11 |
12 | [section {COMMANDS}]
13 |
14 | [list_begin definitions]
15 |
16 | [call [cmd ns_parsemessage] \
17 | [arg message] ]
18 |
19 | [para] The result of this command is a Tcl dictionary containing
20 | the following elements.
21 |
22 | [list_begin definitions]
23 | [def] [term firstline]
24 | [def] [term headers]
25 | [def] [term body]
26 | [list_end]
27 |
28 | [list_end]
29 |
30 | [section EXAMPLES]
31 |
32 | [example_begin]
33 | % ns_parsemessage [lb]join {{HTTP/1.1 200 OK} {content-length: 2} {} {OK}} \r\n[rb]]
34 | firstline {HTTP/1.1 200 OK} headers d0 body OK
35 |
36 | % ns_set format d0
37 | headers:
38 | content-length: 2
39 | [example_end]
40 |
41 |
42 | [see_also nsd ns_parseurl ns_parsefieldvalue ns_parseheader ns_set]
43 | [keywords "global built-in" NaviServer parse HTTP]
44 | [manpage_end]
45 |
46 |
47 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_pngsize.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_pngsize n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Determine the width and height of a PNG image}]
6 |
7 | [description]
8 | [para]Returns a list of two elements, the width and height of the PNG file specified by filename. An error is generated if the file does not exist or if it is not a PNG file.
9 |
10 | [section {COMMANDS}]
11 |
12 | [list_begin definitions]
13 |
14 | [call [cmd ns_pngsize] [arg filename]]
15 |
16 | [list_end]
17 |
18 | [section EXAMPLES]
19 |
20 | [example_begin]
21 | % ns_pngsize screenshot.png
22 | 1024 768
23 | [example_end]
24 |
25 | [example_begin]
26 | % ns_pngsize test.html
27 | invalid PNG file: "test.html"
28 | [example_end]
29 |
30 |
31 | [keywords "global built-in" images]
32 | [see_also ns_gifsize ns_jpegsize ns_imgsize ns_imgtype ns_imgmime]
33 |
34 |
35 | [manpage_end]
36 |
37 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_purgefiles.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_purgefiles n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Purge files by date, keeping max files}]
6 |
7 | [description]
8 | Purge files by date, keeping max files.
9 |
10 | [section {COMMANDS}]
11 |
12 | [list_begin definitions]
13 |
14 | [call [cmd ns_purgefiles] [arg path] [arg maxbackups]]
15 |
16 | The parameter [arg path] denotes the base of the files to delete.
17 | the files are matched internally with the trailing wildcard
18 | character [term *]. The files are then sorted by their modification
19 | time and the newest number of [arg maxbackups] files are kept.
20 |
21 | [para] The function [cmd ns_rollfile] is similar but rolls the file by
22 | appending a numeric suffix.
23 |
24 | [list_end]
25 |
26 | [see_also nsd ns_rollfile]
27 | [keywords "global built-in" NaviServer logging backup]
28 | [manpage_end]
29 |
30 |
31 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_queryexists.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_queryexists n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Check for a key in the query data that was part of the HTTP request}]
6 |
7 | [description]
8 |
9 | This command looks in the query data for the specified key. If the key exists,
10 | 1 is returned; otherwise 0 is returned. The key is interpreted in a case-insensitive manner.
11 |
12 | [section {COMMANDS}]
13 |
14 | [list_begin definitions]
15 |
16 |
17 | [call [cmd ns_queryexists] [arg key]]
18 |
19 |
20 | [list_end]
21 |
22 |
23 | [section EXAMPLES]
24 |
25 | [example_begin]
26 | ns_register_proc POST /queryexiststest queryexiststest
27 |
28 | proc queryexiststest { } {
29 | if [lb]ns_queryexists name[rb] {
30 | # process the form
31 | } else {
32 | ns_returnerror 400 "need to supply your name in the form"
33 | }
34 | }
35 | [example_end]
36 |
37 | [keywords form query]
38 | [see_also ns_queryget ns_querygetall ns_getform]
39 |
40 | [manpage_end]
41 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_querygetall.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_querygetall n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Get multiple query values from the HTTP request}]
6 |
7 | [description]
8 |
9 | This command returns all values whose key is key. If there are none, the
10 | default result def_result is returned, or an empty string is returned if
11 | def_result is not specified. This function is useful for checkboxes.
12 |
13 | [para]
14 | NOTES
15 |
16 | Note that despite its name, ns_querygetall works on POST form data as well as query string data.
17 |
18 | [section {COMMANDS}]
19 |
20 | [list_begin definitions]
21 |
22 | [call [cmd ns_querygetall] [arg key] [opt [arg default]]]
23 |
24 | [list_end]
25 |
26 |
27 | [keywords form query]
28 | [see_also ns_queryget ns_queryexists ns_getform]
29 |
30 | [manpage_end]
31 |
32 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_rand.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_rand n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Generate a random number}]
6 |
7 | [description]
8 |
9 | This command generates a cryptographically secure random number.
10 | If maximum is not specified, the random number returned is a
11 | floating-point value n such that 0.0 <= n < 1.0. If maximum
12 | is specified, it must be a positive integer between 1 and 2147483647,
13 | in which case [cmd ns_rand] will return an integer value n such that 0 <= n <= max - 1.
14 |
15 | Internally [cmd ns_rand] is implemented with the drand48() and lrand48() standard
16 | library functions. An internal random seed is generated the first time
17 | [cmd ns_rand] is called after the server starts.
18 |
19 | [section {COMMANDS}]
20 |
21 | [list_begin definitions]
22 | [call [cmd ns_rand] [opt [arg maximum]]]
23 | [list_end]
24 |
25 | [section EXAMPLES]
26 |
27 | [example_begin]
28 | % ns_rand
29 | 0.39938485692
30 | [example_end]
31 |
32 | [example_begin]
33 | % ns_rand 10
34 | 7
35 | [example_end]
36 |
37 | [para]CAVEAT
38 | [para]
39 |
40 | [lb]ns_rand 1[rb] will always produce the result 0. [lb]ns_rand 2[rb]
41 | will produce the desired "coin flip" outcome of 0 or 1. This is
42 | standard with Java's java.util.Random implementation of nextInt and
43 | most other random number libraries.
44 |
45 | [para]
46 | The function [cmd ns_crypto::randombytes] returns high quality random values
47 | based on the OpenSSL random implementation.
48 |
49 | [see_also nsd ns_crypto]
50 |
51 | [keywords "global built-in" random]
52 |
53 | [manpage_end]
54 |
55 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_rollfile.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_rollfile n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Roll an arbitrary file}]
6 |
7 | [description]
8 |
9 | This function rolls the specified file, keeping backup copies.
10 |
11 | [section {COMMANDS}]
12 |
13 | [list_begin definitions]
14 |
15 | [call [cmd ns_rollfile] [arg path] [arg maxbackups]]
16 |
17 | This function rolls the specified file, keeping a number of backup
18 | copies up to [arg maxbackups].
19 |
20 | When the specified file is rolled, it gets renamed to
21 | [arg path][term .xyz], where [term 000] <= [term xyz] <= [term 999].
22 | Older files have higher numbers. Since 4 digits are used, the maximum
23 | number if back files is 1000.
24 |
25 | [list_end]
26 |
27 |
28 | [see_also ns_log ns_logroll nsd ns_purgefiles]
29 | [keywords "global built-in" NaviServer logging backup]
30 | [manpage_end]
31 |
32 |
33 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_runonce.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_runonce n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Run Tcl script only once}]
6 |
7 | [description]
8 |
9 | This command ensures that the passed-in script will be executed only
10 | once. In other words, when ns_runonce is executed multiple times with
11 | the same script, later invocations have no effect. The command is
12 | typically used in situations, where resources are allocated. The
13 | command requires an executing server, i.e., it can't be used in the
14 | configuration file.
15 |
16 | [section {COMMANDS}]
17 |
18 | [list_begin definitions]
19 |
20 | [call [cmd ns_runonce] [opt [option -global]] [opt [option --]] [arg script]]
21 |
22 | [para]
23 | [option -global]
24 | If specified, the unique execution refers to all defined servers,
25 | otherwise, the execution will be only once per server.
26 |
27 | [para]
28 | [arg script]
29 | Tcl script to be executed
30 | [list_end]
31 |
32 | [section EXAMPLES]
33 |
34 | [example_begin]
35 | ns_runonce {
36 | ns_cache_create mycache 0
37 | }
38 | [example_end]
39 |
40 |
41 | [see_also nsd ns_atstartup ns_atsignal]
42 | [keywords "server built-in" NaviServer callback]
43 | [manpage_end]
44 |
45 |
46 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_serverpath.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_serverpath n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Returns absolute path to current virtual server home directory}]
6 |
7 | [description]
8 | This is virtual hosting aware command that returns absolute path to the server home
9 | for current virtual server context
10 |
11 | [section {COMMANDS}]
12 |
13 | [list_begin definitions]
14 |
15 | [call [cmd ns_serverpath] \
16 | [opt [option "-host [arg value]"]] \
17 | [opt --] \
18 | [opt [arg "path-segment ..."]] \
19 | ]
20 |
21 | Returns the absolute path to current virtual server home directory
22 | followed by the optional path segments. Similar to [cmd ns_pagepath].
23 |
24 | [para]
25 | The optional [option -host] parameter can be used to return the
26 | path for a certain virtual host. If not specified the value for the
27 | host is taken from the [term host] header field of the current
28 | request.
29 |
30 | [list_end]
31 |
32 | [section EXAMPLES]
33 |
34 | [example_begin]
35 | % ns_serverpath
36 | /usr/local/ns
37 |
38 | % ns_serverpath foo bar
39 | /usr/local/ns/foo/bar
40 | [example_end]
41 |
42 |
43 | [see_also nsd ns_pagepath]
44 | [keywords "global built-in" NaviServer "virtual host"]
45 | [manpage_end]
46 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_setexpires.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_setexpires n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Set the current connections Expires header field to the current time plus seconds seconds}]
6 |
7 | [description]
8 |
9 | Set the current connections Expires header to the current time plus seconds
10 |
11 | [section {COMMANDS}]
12 |
13 | [list_begin definitions]
14 | [call [cmd ns_setexpires] \
15 | [opt [option "-cache-control public|private|no-cache|no-store|no-transform|must-revalidate|proxy-revalidate"]] \
16 | [arg seconds]]
17 | [list_end]
18 |
19 | Set the output headers contain the [term Expires] header field. When
20 | [option "-cache-control"] is specified the function adds as well a
21 | [term max-age] header field to the response with the specified cache response
22 | directive.
23 |
24 | [section EXAMPLES]
25 |
26 | [example_begin]
27 | % ns_setexpires 60
28 | [example_end]
29 |
30 | Set the "Expires" header field to expire in 1 minute from now.
31 |
32 |
33 | [keywords cache]
34 | [see_also ns_time ns_conn]
35 |
36 | [manpage_end]
37 |
38 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_setformencoding.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_setformencoding n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 |
6 | [titledesc {Set the form encoding of the current connection}]
7 |
8 | [description]
9 |
10 | Set the form encoding of the current connection. If the connection's
11 | urlencoding value is being changed then flush any form set cached
12 | locally, ns_conn will do the same.
13 |
14 | [list_begin definitions]
15 |
16 |
17 | [call [cmd ns_setformencoding] [arg charset]]
18 |
19 |
20 | [list_end]
21 |
22 |
23 | [section EXAMPLES]
24 |
25 | [example_begin]
26 | % ns_setformencoding iso-8859-1
27 | iso8859-1
28 | [example_end]
29 |
30 |
31 | [see_also ns_charsets ns_urlcharset nsd]
32 | [keywords i18n encoding]
33 |
34 | [manpage_end]
35 |
36 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_setprivileges.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_setprivileges n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Set the current process privileges}]
6 |
7 | [description]
8 |
9 | Sets the effective user or group ID of the current process. If the effective UID
10 | of the caller is root, the real UID and saved set-user-ID are also set.
11 |
12 | [section {COMMANDS}]
13 |
14 | [list_begin definitions]
15 |
16 |
17 | [call [cmd ns_setuser] [arg user]]
18 | [call [cmd ns_setgroup] [arg group]]
19 |
20 | [list_end]
21 |
22 | [section EXAMPLES]
23 |
24 | [example_begin]
25 | % ns_setuser nobody
26 | % ns_setuser 99
27 | % ns_setgroup nogroup
28 | % ns_setgroup 99
29 | [example_end]
30 |
31 | [keywords "server built-in" UID GID user group permissions]
32 |
33 | [manpage_end]
34 |
35 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_sha1.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_sha1 n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Returns a 40-character, hex-encoded string containing the SHA1 hash of the first argument}]
6 |
7 | [description]
8 | A cryptographic hash (sometimes called digest) is a kind of signature for a text or a data file.
9 | SHA1 generates an almost-unique 160-bit signature for a text.
10 |
11 | [section {COMMANDS}]
12 |
13 | [list_begin definitions]
14 |
15 | [call [cmd ns_sha1] \
16 | [opt [option -binary]] \
17 | [opt [option --]] \
18 | [arg string]]
19 |
20 | [para]
21 | Compute an SHA1 checksum from the provided [arg string].
22 | When the option [option -binary] is used, the Tcl byte array value
23 | of the provided input argument is used and no UTF-8 interpretation
24 | is performed.
25 |
26 | [list_end]
27 |
28 | [example_begin]
29 | nscp 2> ns_sha1 test
30 | A94A8FE5CCB19BA61C4C0873D391E987982FBBD3
31 | [example_end]
32 |
33 | [see_also nsd ns_md ns_base64 ns_crypt ns_md5 ns_rand ns_hmac]
34 | [keywords "global built-in" encoding crypto]
35 |
36 | [manpage_end]
37 |
38 |
39 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_shutdown.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_shutdown n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Shut down NaviServer}]
6 |
7 | [description]
8 |
9 | This command shuts down the server, optionally waiting [arg timeout]
10 | seconds to let existing connections and background jobs finish. When
11 | this time limit is exceeded the server shuts down immediately.
12 |
13 | [para] When [arg timeout] is not specified the default or configured
14 | [arg timeout] is used (default 20). The default can be changed by the
15 | parameter [term shutdowntimeout] in the global server parameters
16 | (section [term ns/parameters] in the configuration file). When [arg timeout]
17 | it is specified, it must be a value >= 0.
18 |
19 | [section {COMMANDS}]
20 |
21 | [list_begin definitions]
22 |
23 | [call [cmd ns_shutdown] \
24 | [opt [option -restart]] \
25 | [opt --] \
26 | [opt [arg timeout]]]
27 |
28 | [para]
29 | [arg timeout]
30 | Time to wait before shutting down the server.
31 | The [arg timeout] can be specified in the form
32 | [arg secs[opt :microsecs]], or [arg secs.fraction],
33 | or as a number with a time unit.
34 |
35 | [para]
36 | [option -restart]
37 | send an interrupt signal to the server, leading to a nonzero exit code.
38 |
39 | [list_end]
40 |
41 | [section EXAMPLES]
42 |
43 | [example_begin]
44 | ns_shutdown
45 | ns_shutdown 30s
46 | [example_end]
47 |
48 | [see_also ns_kill ns_time ns_atsignal]
49 | [keywords "server built-in" restart shutdown signals]
50 |
51 | [manpage_end]
52 |
53 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_sleep.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_sleep n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Sleep for a specified number of seconds}]
6 |
7 | [description]
8 |
9 | Sleeps for a specified time period.
10 |
11 |
12 | [section {COMMANDS}]
13 |
14 | [list_begin definitions]
15 |
16 |
17 | [call [cmd ns_sleep] [arg duration]]
18 |
19 | The [arg duration] can be specified with time units (per default seconds).
20 |
21 | [list_end]
22 |
23 | [section EXAMPLES]
24 |
25 | [example_begin]
26 | % ns_sleep 2
27 | [example_end]
28 |
29 |
30 | [see_also nsd ns_time]
31 | [keywords "global built-in" time]
32 |
33 | [manpage_end]
34 |
35 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_sockaccept.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_sockaccept n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Accept a new socket connection}]
6 |
7 | [description]
8 | The command [cmd ns_sockaccept] accepts a new connection pending on [arg sockId].
9 |
10 | [section {COMMANDS}]
11 |
12 | [list_begin definitions]
13 |
14 | [call [cmd ns_sockaccept] [arg sockId]]
15 |
16 | [list_end]
17 |
18 | [section EXAMPLES]
19 |
20 | [example_begin]
21 | #listen for connections on port 9000
22 | set sock [lb]ns_socklisten * 9000[rb]
23 |
24 | #wait for new connection
25 | set fds [lb]ns_sockaccept $sock[rb]
26 | set rfd [lb]lindex $fds 0[rb]
27 | set wfd [lb]lindex $fds 1[rb]
28 | puts $wfd "Hello!"
29 | close $rfd
30 | close $wfd
31 | close $sock
32 | [example_end]
33 |
34 |
35 | [see_also nsd ns_socklisten]
36 | [keywords "global built-in" NaviServer socket accept]
37 | [manpage_end]
38 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_sockblocking.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_sockblocking n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Set socket blocking}]
6 |
7 | [description]
8 | This function sets the socket for the specified sockId to blocking.
9 |
10 | [section {COMMANDS}]
11 |
12 | [list_begin definitions]
13 |
14 | [call [cmd ns_sockblocking] [arg sockId]]
15 |
16 | [list_end]
17 |
18 | [section EXAMPLES]
19 |
20 | [example_begin]
21 | [example_end]
22 |
23 |
24 | [see_also nsd ns_socknonblocking]
25 | [keywords "global built-in" NaviServer socket blocking]
26 | [manpage_end]
27 |
28 |
29 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_sockcheck.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_sockcheck n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Check if a socket is connected}]
6 |
7 | [description]
8 |
9 | [cmd ns_sockcheck] uses recv() or send() calls to check if a socket
10 | The [arg sockId] is the read or write file id returned by
11 | [cmd ns_sockopen]. This function is useful if you used
12 | "ns_sockopen ... -nonblock ...", or after calling [cmd ns_sockselect].
13 |
14 |
15 | [section {COMMANDS}]
16 |
17 | [list_begin definitions]
18 |
19 | [call [cmd ns_sockcheck] [arg sockId]]
20 |
21 | [list_end]
22 |
23 | [section EXAMPLES]
24 |
25 | [example_begin]
26 | [example_end]
27 |
28 |
29 | [see_also ns_sockselect ns_sockopen]
30 | [keywords "global built-in" NaviServer socket connected]
31 | [manpage_end]
32 |
33 |
34 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_socketpair.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_socketpair n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Create a pair of connected sockets}]
6 |
7 | [description]
8 | ns_socketpair creates a pair of connected sockets and returns a list
9 | of file ids: the first one for reads and the second one for writes.
10 |
11 | [section {COMMANDS}]
12 |
13 | [list_begin definitions]
14 |
15 | [call [cmd ns_socketpair]]
16 |
17 | [list_end]
18 |
19 | [section EXAMPLES]
20 |
21 | [example_begin]
22 | [example_end]
23 |
24 |
25 | [see_also nsd]
26 | [keywords "global built-in" NaviServer socket]
27 | [manpage_end]
28 |
29 |
30 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_socklisten.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_socklisten n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Create a new socket listening for connections}]
6 |
7 | [description]
8 | ns_socklisten creates a new socket listening for connections at
9 | the specified interface address and port. "*" can be used as the
10 | address argument to specify all addresses.
11 |
12 | [section {COMMANDS}]
13 |
14 | [list_begin definitions]
15 |
16 | [call [cmd ns_socklisten] [arg address] [arg port]]
17 |
18 | [list_end]
19 |
20 | [section EXAMPLES]
21 |
22 | [example_begin]
23 | [example_end]
24 |
25 |
26 | [see_also nsd ns_sockaccept]
27 | [keywords "global built-in" NaviServer socket listen]
28 | [manpage_end]
29 |
30 |
31 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_socklistencallback.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_socklistencallback n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Run script on connection}]
6 |
7 | [description]
8 | This function listens on the specified address and port and runs
9 | the specified script when new connections are received.
10 |
11 | [section {COMMANDS}]
12 |
13 | [list_begin definitions]
14 |
15 | [call [cmd ns_socklistencallback] [arg address] [arg port] [arg script]]
16 |
17 | [list_end]
18 |
19 | [section EXAMPLES]
20 |
21 | [example_begin]
22 | [example_end]
23 |
24 |
25 | [see_also nsd]
26 | [keywords "global built-in" NaviServer socket listen callback]
27 | [manpage_end]
28 |
29 |
30 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_socknonblocking.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_socknonblocking n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Set socket nonblocking}]
6 |
7 | [description]
8 | This function sets the socket for the specified sockId to nonblocking.
9 |
10 | [section {COMMANDS}]
11 |
12 | [list_begin definitions]
13 |
14 | [call [cmd ns_socknonblocking] [arg sockId]]
15 |
16 | [list_end]
17 |
18 | [section EXAMPLES]
19 |
20 | [example_begin]
21 | [example_end]
22 |
23 |
24 | [see_also nsd ns_sockblocking]
25 | [keywords "global built-in" NaviServer socket blocking]
26 | [manpage_end]
27 |
28 |
29 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_socknread.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 |
3 | [manpage_begin ns_socknread n [vset version]]
4 | [moddesc {NaviServer Built-in Commands}]
5 |
6 | [titledesc {Return bytes to be read}]
7 |
8 | [description]
9 | This function returns the number of bytes waiting to be read from the specified sockId.
10 |
11 | [section {COMMANDS}]
12 |
13 | [list_begin definitions]
14 |
15 | [call [cmd ns_socknread] [arg sockId]]
16 |
17 | [list_end]
18 |
19 | [section EXAMPLES]
20 |
21 | [example_begin]
22 | [example_end]
23 |
24 |
25 | [see_also nsd]
26 | [keywords "global built-in" NaviServer socket]
27 | [manpage_end]
28 |
29 |
30 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_symlink.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_symlink n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Create a symbolic link}]
6 |
7 | [description]
8 |
9 | This command creates a symbolic link named filename2 that points to the file or
10 | directory specified by filename1. If the link fails, a Tcl error is generated,
11 | unless [option -nocomplain] is specified.
12 |
13 | This is a legacy command from when Tcl did not have this functionality.
14 | It is now recommended you use Tcl's file link command instead.
15 | The reason is that we have still this command is that
16 | the Tcl [term "file link"] command always creates link target with
17 | absolute path to the linked file.
18 |
19 | [section {COMMANDS}]
20 |
21 | [list_begin definitions]
22 | [call [cmd ns_symlink] [opt [option -nocomplain]] [opt --] [arg filename1] [arg filename2]]
23 | [list_end]
24 |
25 | [section EXAMPLES]
26 |
27 | [example_begin]
28 | ns_symlink $file1 $file2
29 | [example_end]
30 |
31 | [para]is equivalent to:
32 |
33 | [example_begin]
34 | file link -symbolic $file1 $file2
35 | [example_end]
36 |
37 | [keywords "global built-in" filesystem]
38 |
39 | [manpage_end]
40 |
41 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_truncate.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_truncate n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Truncate file in size}]
6 |
7 | [description]
8 | This command truncates a given file to the given length.
9 |
10 | [section {COMMANDS}]
11 |
12 | [list_begin definitions]
13 |
14 | [call [cmd ns_truncate] [arg filename] [opt [arg length]]]
15 |
16 | [para]
17 | [arg filename]
18 | File to be truncated.
19 |
20 | [para]
21 | [arg length]
22 | If specified, truncate up to this length otherwise make file 0 size.
23 |
24 | [list_end]
25 |
26 | [see_also nsd]
27 | [keywords "global built-in" NaviServer file truncate]
28 | [manpage_end]
29 |
30 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_url2file.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_url2file n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 |
6 |
7 | [titledesc {Return the path to a file referenced by a URL}]
8 |
9 | [description]
10 |
11 | This command returns the absolute path to a file referenced by the given URL.
12 | The file returned is located in the "pages" directory on the current virtual server.
13 |
14 | [section {COMMANDS}]
15 |
16 | [list_begin definitions]
17 |
18 |
19 | [call [cmd ns_url2file] [arg url]]
20 |
21 |
22 | [list_end]
23 |
24 |
25 | [section EXAMPLES]
26 | This is especially useful when using the ns_adp_include command.
27 |
28 | [example_begin]
29 | <% ns_adp_include [lb]ns_url2file /include/myfile.inc[rb] %>
30 | [example_end]
31 |
32 |
33 | [example_begin]
34 | % ns_url2file /test.adp
35 | /usr/local/ns/pages/test.adp
36 | [example_end]
37 |
38 |
39 | [see_also nsd]
40 | [keywords "server built-in" URL]
41 |
42 | [manpage_end]
43 |
44 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_urlcharset.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_urlcharset n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 |
6 |
7 | [titledesc {Set the current connections url charset}]
8 |
9 | [description]
10 |
11 | Set the current connections urlcharset. Returns the encoding value for the specified charset. If the connection's urlencoding value is being changed then flush any form set cached locally, ns_conn will do the same.
12 |
13 | [section {COMMANDS}]
14 |
15 | [list_begin definitions]
16 |
17 |
18 | [call [cmd ns_urlcharset] [arg charset]]
19 |
20 |
21 | [list_end]
22 |
23 |
24 | [section EXAMPLES]
25 |
26 | [example_begin]
27 | % ns_urlcharset iso-8859-1
28 | iso8859-1
29 | [example_end]
30 |
31 |
32 | [see_also nsd]
33 | [keywords charset URL i18n]
34 |
35 | [manpage_end]
36 |
37 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_uudecode.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_uudecode n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Binary-to-text decoding using "htuu" encoding}]
6 |
7 | [description]
8 |
9 | This command performs a text to potentially binary conversion,
10 | based on the base64 encoding scheme. The command is kept
11 | for backward compatibility, the command [cmd ns_base64decode]
12 | should be used instead.
13 |
14 | [para]
15 | NOTE: This stype of encoding is sometimes called "htuu". This command
16 | converts the specified argument from RFC 1113 printable encoding
17 | format to its native representation. This technique is similar to the
18 | familiar Unix uuencode format in that it maps 6 binary bits to one
19 | ASCII character (or more aptly, 3 binary bytes to 4 ASCII
20 | characters). However, RFC 1113 does not use the same mapping to
21 | printable characters as uuencode.
22 |
23 | [list_begin definitions]
24 |
25 | [call [cmd ns_uudecode] \
26 | [opt [option -binary]] \
27 | [opt [option -strict]] \
28 | [opt [option --]] \
29 | [arg string]]
30 |
31 | In case, the result might contain binary content,
32 | it is recommend to use the option [option -binary], which causes the
33 | result to be a Tcl byte array.
34 |
35 | [para]
36 | When the option [option -strict] is used, an exception is raised
37 | when in unexpected character is contained in the input. Otherwise
38 | a warning is written to the system log.
39 |
40 | [list_end]
41 |
42 |
43 | [section EXAMPLES]
44 |
45 | [example_begin]
46 | oss2:nscp 7> ns_uuencode test
47 | dGVzdA==
48 |
49 | oss2:nscp 6> ns_uudecode dGVzdA==
50 | test
51 | [example_end]
52 |
53 | [see_also ns_uuencode ns_base64]
54 | [keywords "global built-in" encoding]
55 | [manpage_end]
56 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_uuencode.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_uuencode n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Binary-to-text encoding using "htuu" encoding}]
6 |
7 | [description]
8 |
9 | This command performs a binary-to-text encoding on string. The
10 | encoded string will be approximately 33% longer than the original by
11 | using he base64 encoding scheme. The command is kept
12 | for backward compatibility, the command [cmd ns_base64encode]
13 | should be used instead.
14 |
15 | [para]
16 | NOTE: This type of encoding is sometimes called "htuu". This
17 | command converts the specified argument to RFC 1113 printable
18 | encoding format. This technique is similar to the familiar Unix
19 | uuencode format in that it maps 6 binary bits to one ASCII character
20 | (or more aptly, 3 binary bytes to 4 ASCII characters). However, RFC
21 | 1113 does not use the same mapping to printable characters as
22 | uuencode.
23 |
24 | [list_begin definitions]
25 |
26 | [call [cmd ns_uuencode] \
27 | [opt [option -binary]] \
28 | [opt [option --]] \
29 | [arg string]]
30 |
31 | When the option [option -binary] is used, the Tcl byte array value
32 | of the provided input argument is used and no UTF-8 interpretation
33 | is performed.
34 |
35 | [list_end]
36 |
37 | [section EXAMPLES]
38 |
39 | [example_begin]
40 | oss2:nscp 7> ns_uuencode test
41 | dGVzdA==
42 |
43 | oss2:nscp 6> ns_uudecode dGVzdA==
44 | test
45 | [example_end]
46 |
47 | [see_also ns_uudecode ns_base64]
48 | [keywords "global built-in" encoding]
49 | [manpage_end]
50 |
--------------------------------------------------------------------------------
/doc/src/naviserver/ns_valid_utf8.man:
--------------------------------------------------------------------------------
1 | [include version_include.man]
2 | [manpage_begin ns_valid_utf8 n [vset version]]
3 | [moddesc {NaviServer Built-in Commands}]
4 |
5 | [titledesc {Check whether the provided byte-array contains a valid UTF-8 byte sequence}]
6 |
7 | [description]
8 |
9 | [section {COMMANDS}]
10 |
11 | [list_begin definitions]
12 |
13 | [call [cmd ns_valid_utf8] \
14 | [arg string] \
15 | [opt [arg varname]] \
16 | ]
17 |
18 | [para] Checks whether the provided argument (a Tcl byte-array)
19 | contains a valid UTF-8 code). The function returns a boolean
20 | result. When the optional [arg varname] is specified, a variable
21 | with this name is set in failure cases to the invalid part of the
22 | input [arg value].
23 |
24 | [para] Note that this function only makes sense when applied on binary
25 | data, typically read from a socket or a file.
26 |
27 | [example_begin]
28 | % ns_valid_utf8 [encoding convertto utf-8 motörhead]
29 | 1
30 |
31 | % ns_valid_utf8 "foo\x85"
32 | 0
33 |
34 | % ns_valid_utf8 mot\x85rhead errorString
35 | 0
36 | % set errorString
37 | mot|\x85r|...
38 | [example_end]
39 |
40 | [list_end]
41 |
42 | [keywords "global built-in" parse utf-8 encoding i18n]
43 | [manpage_end]
44 |
45 |
46 |
--------------------------------------------------------------------------------
/doc/src/template.man:
--------------------------------------------------------------------------------
1 | [manpage_begin {Template for new COMMAND} n [vset version]]
2 | [moddesc {NaviServer Built-in Commands}]
3 |
4 | [titledesc {One-line summary what the command does}]
5 |
6 | [description]
7 | One or more paragraphs describing the command in detail.
8 |
9 | [section {COMMANDS}]
10 | Optional: list and description of sub-commands.
11 |
12 | [list_begin definitions]
13 |
14 | [call [cmd COMMAND] [arg 1]]
15 |
16 | [para]
17 | [arg 1]
18 | Description for arg1
19 |
20 | [list_end]
21 |
22 | [section CONFIGURATION]
23 |
24 | [para]
25 | [emph {Basic configuration options:}]
26 |
27 | [list_begin definitions]
28 | [def {{PARAM1 = CONFIGVALUE1}}]
29 | [list_end]
30 |
31 | [section EXAMPLES]
32 |
33 | [example_begin]
34 | Put some examples here to illustrate command usage.
35 | [example_end]
36 |
37 |
38 | [see_also nsd]
39 | [keywords NaviServer]
40 | [manpage_end]
41 |
--------------------------------------------------------------------------------
/include/Makefile.build:
--------------------------------------------------------------------------------
1 | # Emacs mode: -*-Makefile-*-
2 |
3 | # This Source Code Form is subject to the terms of the Mozilla Public
4 | # License, v. 2.0. If a copy of the MPL was not distributed with this
5 | # file, You can obtain one at https://mozilla.org/MPL/2.0/.
6 | #
7 | # The Initial Developer of the Original Code and related documentation
8 | # is America Online, Inc. Portions created by AOL are Copyright (C) 1999
9 | # America Online, Inc. All Rights Reserved.
10 | #
11 |
12 | #
13 | # Makefile.build --
14 | #
15 | # Makefile for building AOLserver distribution.
16 | #
17 |
18 | NSBUILD=1
19 |
20 | # For Unix we must run Makefile.module below, for Windows we must
21 | # instead run Makefile.win32. Unfortunately there is no normal way to
22 | # write if statements that work in both Gnu Make and Windows nmake.
23 | # But there is a clever hack, described by Bevan Collins here:
24 | # https://stackoverflow.com/questions/8270391/use-the-same-makefile-for-make-linux-and-nmake-windows/30906085#30906085
25 | # Basically, Gnu make recognized line continuation on comment lines,
26 | # but nmake does not. We use this below:
27 |
28 | # \
29 | !ifndef 0 # \
30 | ## Microsoft nmake here, for compiling on Windows: \
31 | #!message Running Microsfot nmake in Makefile.build. # \
32 | !include ../include/Makefile.win32 # \
33 | !else
34 | ## Gnu make here, for compiling on Unix:
35 | #$(info 'Running Gnu make in Makefile.build')
36 | include ../include/Makefile.module
37 | # \
38 | !endif
39 |
--------------------------------------------------------------------------------
/include/nsconfig-win32.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Activate HAVE_OPENSSL_EVP_H for OpenSSL on Windows. This assumes
3 | * that openssl include files (e.g. openssl/evp.h) are on the include
4 | * path, and the lib files (e.g. libssl, libcrypto) are available for
5 | * linking. The locations are provided in include/Makefile.win32
6 | */
7 | #define HAVE_OPENSSL_EVP_H 1
8 |
9 | /*
10 | * Activate HAVE_ZLIB_H for using zlib on Windows. This assumes that
11 | * zlib.h and zconf.h can be found on the include path, and zlib*.lib
12 | * is available for linking.
13 | */
14 | #define HAVE_ZLIB_H 1
15 |
16 | #define HAVE_STDINT_H 1
17 | #define HAVE_TIMEGM 1
18 |
--------------------------------------------------------------------------------
/include/nsversion.h.in:
--------------------------------------------------------------------------------
1 | /*
2 | * This Source Code Form is subject to the terms of the Mozilla Public
3 | * License, v. 2.0. If a copy of the MPL was not distributed with this
4 | * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 | *
6 | * The Initial Developer of the Original Code and related documentation
7 | * is America Online, Inc. Portions created by AOL are Copyright (C) 1999
8 | * America Online, Inc. All Rights Reserved.
9 | *
10 | */
11 |
12 | /*
13 | * nsversion.h --
14 | *
15 | * Version info maintained in configure.in
16 | *
17 | */
18 |
19 | #ifndef NSVERSION_H
20 | #define NSVERSION_H
21 |
22 |
23 | #define NS_MAJOR_VERSION @NS_MAJOR_VERSION@
24 | #define NS_MINOR_VERSION @NS_MINOR_VERSION@
25 | #define NS_RELEASE_SERIAL @NS_RELEASE_SERIAL@
26 | #define NS_VERSION_NUM (NS_MAJOR_VERSION * 10000 \
27 | + NS_MINOR_VERSION * 100 \
28 | + NS_RELEASE_SERIAL)
29 |
30 | #define NS_VERSION @NS_VERSION@
31 | #define NS_PATCH_LEVEL @NS_PATCH_LEVEL@
32 |
33 | #define NS_ALPHA_RELEASE 1
34 | #define NS_BETA_RELEASE 2
35 | #define NS_FINAL_RELEASE 3
36 | #define NS_RELEASE_LEVEL (@NS_RELEASE_LEVEL@)
37 | #define NS_NAVISERVER "@NAVISERVER@"
38 |
39 | #endif /* NSVERSION_H */
40 |
--------------------------------------------------------------------------------
/license.terms:
--------------------------------------------------------------------------------
1 | This Source Code Form is subject to the terms of the Mozilla Public
2 | License, v. 2.0. If a copy of the MPL was not distributed with this
3 | file, You can obtain one at https://mozilla.org/MPL/2.0/.
4 |
5 | The Initial Developer of the Original Code and related documentation
6 | is America Online, Inc. Portions created by AOL are Copyright (C) 1999
7 | America Online, Inc. All Rights Reserved.
8 |
9 | Contributor(s):
10 | apisano@wu.ac.at: 2022
11 | atp@piskorski.com: 2006, 2014, 2017, 2019-2020
12 | costashsrc@gmail.com: 2016
13 | danb@aol.net: 2002
14 | david@qcode.co.uk: 2015, 2017, 2022
15 | dossy@panoptic.com: 2001, 2004-2005
16 | dvrsn@diphi.com: 2012-2015
17 | eathomas93@aol.com: 2003
18 | eidenschink@web.de: 2005-2006
19 | filip.minic@s.wu.ac.at 2021
20 | hanzer@riseup.net 2016
21 | itannir@archiware.com: 2005-2007
22 | jcollins@phpsource.net: 2002
23 | jeffh@activestate.com: 2002
24 | jgdavidson@aol.com: 2000-2003
25 | jrasmuss@mle.ie: 2003
26 | kriston@aol.com: 2000-2001
27 | michael@cleverly.com: 2006
28 | mooooooo@avenues.org: 2008
29 | mpagenva@aol.com: 2002-2004
30 | nathan.folkman@gmail.com: 2003
31 | neumann@wu-wien.ac.at: 2010-2022
32 | petej@clickvision.com: 2003
33 | pkhincha@aol.com: 2003
34 | pwmoosman@aol.com: 2003
35 | rahul032213@aol.com: 2003
36 | rcrittenden0569@aol.com: 2004
37 | scott@scottg.net: 2000-2003
38 | sdeasey@gmail.com: 2005-2009
39 | suhti@aol.com: 2004
40 | vguerra@gmail.com 2015
41 | uid24488@users.sf.net: 2002
42 | vseryakov@gmail.com: 2005-2010
43 | zv@archiware.com: 2003, 2005-2008, 2010, 2015, 2017-2022
--------------------------------------------------------------------------------
/m4/gettid.m4:
--------------------------------------------------------------------------------
1 | #
2 | # This Source Code Form is subject to the terms of the Mozilla Public
3 | # License, v. 2.0. If a copy of the MPL was not distributed with this
4 | # file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 | #
6 | # The Initial Developer of the Original Code and related documentation
7 | # is America Online, Inc. Portions created by AOL are Copyright (C) 1999
8 | # America Online, Inc. All Rights Reserved.
9 | #
10 | AC_DEFUN([AX_HAVE_GETTID], [
11 | AC_MSG_CHECKING([for gettid system call])
12 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
13 | #include
14 | #include
15 | ]], [[
16 | int main(void) { return syscall(SYS_gettid); }
17 | ]])], [
18 | AC_DEFINE([HAVE_GETTID],1,[Define to 1 when gettid system call is available.])
19 | AC_MSG_RESULT([yes])
20 | ],[
21 | AC_MSG_RESULT([no])
22 | ])
23 | ]) # AX_HAVE_GETTID
24 |
25 | AC_DEFUN([AX_HAVE_TCP_FASTOPEN], [
26 | AC_MSG_CHECKING([for TCP_FASTOPEN support])
27 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
28 | #include
29 | ]], [[
30 | int main(void) { return TCP_FASTOPEN != 0; }
31 | ]])], [
32 | AC_DEFINE([HAVE_TCP_FASTOPEN],1,[Define to 1 when TCP_FASTOPEN is available.])
33 | AC_MSG_RESULT([yes])
34 | ],[
35 | AC_MSG_RESULT([no])
36 | ])
37 | ]) # AX_HAVE_TCP_FASTOPEN
38 |
--------------------------------------------------------------------------------
/m4/usermgt.m4:
--------------------------------------------------------------------------------
1 | #
2 | # This Source Code Form is subject to the terms of the Mozilla Public
3 | # License, v. 2.0. If a copy of the MPL was not distributed with this
4 | # file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 | #
6 | # The Initial Developer of the Original Code and related documentation
7 | # is America Online, Inc. Portions created by AOL are Copyright (C) 1999
8 | # America Online, Inc. All Rights Reserved.
9 | #
10 | #
11 | #
12 |
13 | dnl
14 | dnl Check to see whether we have the get*_r function for user and group
15 | dnl management available.
16 | dnl
17 |
18 | AC_DEFUN([AX_HAVE_GETPWNAM_R],
19 | [AC_CHECK_FUNC([getpwnam_r], [
20 | AC_DEFINE([HAVE_GETPWNAM_R],[1],[Define to 1 if getpwnam_r is available.])
21 | ])]
22 | )
23 |
24 | AC_DEFUN([AX_HAVE_GETPWUID_R],
25 | [AC_CHECK_FUNC([getpwuid_r], [
26 | AC_DEFINE([HAVE_GETPWUID_R],[1],[Define to 1 if getpwuid_r is available.])
27 | ])]
28 | )
29 |
30 | AC_DEFUN([AX_HAVE_GETGRNAM_R],
31 | [AC_CHECK_FUNC([getgrnam_r], [
32 | AC_DEFINE([HAVE_GETGRNAM_R],[1],[Define to 1 if getgrnam_r is available.])
33 | ])]
34 | )
35 |
36 | AC_DEFUN([AX_HAVE_GETGRGID_R],
37 | [AC_CHECK_FUNC([getgrgid_r], [
38 | AC_DEFINE([HAVE_GETGRGID_R],[1],[Define to 1 if getgrgid_r is available.])
39 | ])]
40 | )
41 |
--------------------------------------------------------------------------------
/nscgi/Makefile:
--------------------------------------------------------------------------------
1 | #
2 | # This Source Code Form is subject to the terms of the Mozilla Public
3 | # License, v. 2.0. If a copy of the MPL was not distributed with this
4 | # file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 | #
6 | # The Initial Developer of the Original Code and related documentation
7 | # is America Online, Inc. Portions created by AOL are Copyright (C) 1999
8 | # America Online, Inc. All Rights Reserved.
9 | #
10 | #
11 | #
12 |
13 | MOD = nscgi.so
14 | MODOBJS = nscgi.o
15 | include ../include/Makefile.build
16 |
--------------------------------------------------------------------------------
/nscp/Makefile:
--------------------------------------------------------------------------------
1 | #
2 | # This Source Code Form is subject to the terms of the Mozilla Public
3 | # License, v. 2.0. If a copy of the MPL was not distributed with this
4 | # file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 | #
6 | # The Initial Developer of the Original Code and related documentation
7 | # is America Online, Inc. Portions created by AOL are Copyright (C) 1999
8 | # America Online, Inc. All Rights Reserved.
9 | #
10 | #
11 | #
12 |
13 | MOD = nscp.so
14 | MODOBJS = nscp.o
15 | include ../include/Makefile.build
16 |
--------------------------------------------------------------------------------
/nsd/nsthread.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This Source Code Form is subject to the terms of the Mozilla Public
3 | * License, v. 2.0. If a copy of the MPL was not distributed with this
4 | * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 | *
6 | * The Initial Developer of the Original Code and related documentation
7 | * is America Online, Inc. Portions created by AOL are Copyright (C) 1999
8 | * America Online, Inc. All Rights Reserved.
9 | *
10 | */
11 |
12 |
13 | /*
14 | * nsthread.c --
15 | *
16 | * Compatibility wrappers for thread calls.
17 | */
18 |
19 | #include "nsd.h"
20 |
21 | #ifdef NS_WITH_DEPRECATED
22 | /*
23 | *----------------------------------------------------------------------
24 | *
25 | * Ns_SetThreadServer --
26 | *
27 | * Sets the thread name to the name of the server.
28 | *
29 | * Results:
30 | * None.
31 | *
32 | * Side effects:
33 | * None.
34 | *
35 | *----------------------------------------------------------------------
36 | */
37 |
38 | void
39 | Ns_SetThreadServer(const char *server)
40 | {
41 | Ns_ThreadSetName("%s", server);
42 | }
43 |
44 |
45 | /*
46 | *----------------------------------------------------------------------
47 | *
48 | * Ns_GetThreadServer --
49 | *
50 | * Get the name of this server/thread.
51 | *
52 | * Results:
53 | * A thread/server name
54 | *
55 | * Side effects:
56 | * None.
57 | *
58 | *----------------------------------------------------------------------
59 | */
60 |
61 | const char *
62 | Ns_GetThreadServer(void)
63 | {
64 | return Ns_ThreadGetName();
65 | }
66 | #endif
67 |
68 | /*
69 | * Local Variables:
70 | * mode: c
71 | * c-basic-offset: 4
72 | * fill-column: 78
73 | * indent-tabs-mode: nil
74 | * End:
75 | */
76 |
--------------------------------------------------------------------------------
/nsd/stamp.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This Source Code Form is subject to the terms of the Mozilla Public
3 | * License, v. 2.0. If a copy of the MPL was not distributed with this
4 | * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 | *
6 | * The Initial Developer of the Original Code and related documentation
7 | * is America Online, Inc. Portions created by AOL are Copyright (C) 1999
8 | * America Online, Inc. All Rights Reserved.
9 | *
10 | */
11 |
12 | #include "nsd.h"
13 |
14 | /*
15 | * stamp.c --
16 | *
17 | * Timestamp for link return by Ns_InfoBuildDate().
18 | */
19 |
20 | const char *nsBuildDate = __DATE__ " at " __TIME__;
21 |
--------------------------------------------------------------------------------
/nsdb/Makefile:
--------------------------------------------------------------------------------
1 | #
2 | # This Source Code Form is subject to the terms of the Mozilla Public
3 | # License, v. 2.0. If a copy of the MPL was not distributed with this
4 | # file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 | #
6 | # The Initial Developer of the Original Code and related documentation
7 | # is America Online, Inc. Portions created by AOL are Copyright (C) 1999
8 | # America Online, Inc. All Rights Reserved.
9 | #
10 | #
11 |
12 | MODNAME = nsdb
13 | MOD = nsdb.so
14 | MODOBJS = nsdb.o
15 | LIBNM = nsdb
16 | LIBOBJS = dbinit.o dbdrv.o dbtcl.o dbutil.o
17 | LIBHDRS = nsdb.h
18 | HDRS = db.h
19 | TCL = util.tcl
20 |
21 | include ../include/Makefile.build
22 |
--------------------------------------------------------------------------------
/nsdb/db.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This Source Code Form is subject to the terms of the Mozilla Public
3 | * License, v. 2.0. If a copy of the MPL was not distributed with this
4 | * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 | *
6 | * The Initial Developer of the Original Code and related documentation
7 | * is America Online, Inc. Portions created by AOL are Copyright (C) 1999
8 | * America Online, Inc. All Rights Reserved.
9 | *
10 | */
11 |
12 | #ifndef DB_H
13 | #define DB_H
14 |
15 | #include "nsdb.h"
16 |
17 | NS_EXTERN void NsDbInitPools(void);
18 | NS_EXTERN void NsDbInitServer(const char *server);
19 | NS_EXTERN Ns_TclTraceProc NsDbAddCmds, NsDbReleaseHandles;
20 | NS_EXTERN Ns_ReturnCode NsDbClose(Ns_DbHandle *handle) NS_GNUC_NONNULL(1);
21 | NS_EXTERN void NsDbDisconnect(Ns_DbHandle *handle)
22 | NS_GNUC_NONNULL(1);
23 | NS_EXTERN struct DbDriver *NsDbGetDriver(const Ns_DbHandle *handle) NS_GNUC_PURE;
24 | NS_EXTERN struct DbDriver *NsDbLoadDriver(const char *driver)
25 | NS_GNUC_NONNULL(1);
26 | NS_EXTERN void NsDbLogSql(const Ns_Time *startTime, Ns_DbHandle *handle, const char *sql)
27 | NS_GNUC_NONNULL(1) NS_GNUC_NONNULL(2) NS_GNUC_NONNULL(3);
28 | NS_EXTERN Ns_ReturnCode NsDbOpen(Ns_DbHandle *handle)
29 | NS_GNUC_NONNULL(1);
30 | NS_EXTERN void NsDbDriverInit(const char *server, const struct DbDriver *driverPtr)
31 | NS_GNUC_NONNULL(2);
32 | NS_EXTERN uintptr_t NsDbGetSessionId(const Ns_DbHandle *handle) NS_GNUC_PURE
33 | NS_GNUC_NONNULL(1);
34 |
35 | #endif
36 |
37 |
38 | /*
39 | * Local Variables:
40 | * mode: c
41 | * c-basic-offset: 4
42 | * fill-column: 78
43 | * indent-tabs-mode: nil
44 | * End:
45 | */
46 |
--------------------------------------------------------------------------------
/nsdbtest/Makefile:
--------------------------------------------------------------------------------
1 | #
2 | #
3 | #
4 |
5 | MODNAME = nsdbtest
6 | MOD = nsdbtest.so
7 | MODOBJS = nsdbtest.o
8 | include ../include/Makefile.build
9 |
--------------------------------------------------------------------------------
/nslog/Makefile:
--------------------------------------------------------------------------------
1 | #
2 | # This Source Code Form is subject to the terms of the Mozilla Public
3 | # License, v. 2.0. If a copy of the MPL was not distributed with this
4 | # file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 | #
6 | # The Initial Developer of the Original Code and related documentation
7 | # is America Online, Inc. Portions created by AOL are Copyright (C) 1999
8 | # America Online, Inc. All Rights Reserved.
9 | #
10 | #
11 | #
12 |
13 | MOD = nslog.so
14 | MODOBJS = nslog.o
15 | include ../include/Makefile.build
16 |
--------------------------------------------------------------------------------
/nsperm/Makefile:
--------------------------------------------------------------------------------
1 | #
2 | # This Source Code Form is subject to the terms of the Mozilla Public
3 | # License, v. 2.0. If a copy of the MPL was not distributed with this
4 | # file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 | #
6 | # The Initial Developer of the Original Code and related documentation
7 | # is America Online, Inc. Portions created by AOL are Copyright (C) 1999
8 | # America Online, Inc. All Rights Reserved.
9 | #
10 | #
11 | #
12 |
13 | MODNAME = nsperm
14 | MOD = nsperm.so
15 | MODOBJS = nsperm.o
16 | TCL = init.tcl compat.tcl htaccess.tcl
17 | MODINST = cpfiles
18 |
19 | include ../include/Makefile.build
20 |
21 | moddat = $(DESTDIR)$(INSTSRVMOD)/$(MODNAME)
22 |
23 | cpfiles:
24 | @$(MKDIR) $(moddat)
25 | for f in passwd group hosts.allow hosts.deny perms; do \
26 | test -f $(moddat)/$$f || $(INSTALL_DATA) $$f $(moddat)/; \
27 | done
28 |
--------------------------------------------------------------------------------
/nsperm/compat.tcl:
--------------------------------------------------------------------------------
1 | #
2 | # This Source Code Form is subject to the terms of the Mozilla Public
3 | # License, v. 2.0. If a copy of the MPL was not distributed with this
4 | # file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 | #
6 | # The Initial Developer of the Original Code and related documentation
7 | # is America Online, Inc. Portions created by AOL are Copyright (C) 1999
8 | # America Online, Inc. All Rights Reserved.
9 | #
10 | #
11 |
12 | #
13 | # compat.tcl -
14 | # Compatibility functions
15 | #
16 |
17 | proc ns_passwordcheck { user password } {
18 | ns_deprecated "ns_perm checkpass"
19 | set ret [catch {ns_perm checkpass $user $password} err]
20 | if {$ret == 0} {
21 | return 0
22 | } else {
23 | return 1
24 | }
25 | }
26 |
27 | # Local variables:
28 | # mode: tcl
29 | # tcl-indent-level: 4
30 | # indent-tabs-mode: nil
31 | # End:
32 |
--------------------------------------------------------------------------------
/nsperm/group:
--------------------------------------------------------------------------------
1 | system:::nsadmin
2 | users:::nsadmin,nobody
3 | all:::nsadmin,nobody,""
4 | public:::""
5 |
--------------------------------------------------------------------------------
/nsperm/hosts.allow:
--------------------------------------------------------------------------------
1 | #
2 | # This is the NaviServer hosts.allow file. It allows you to specify which
3 | # hosts may log in as certain users. If you have an entry in this
4 | # file for a given user, you may not have an entry in hosts.deny for
5 | # that same user.
6 | #
7 | # Example:
8 | #
9 | # nsadmin: ::1/64, 10.0.0.0/24, .internal.mycompany.com, home.me.com
10 | #
11 |
--------------------------------------------------------------------------------
/nsperm/hosts.deny:
--------------------------------------------------------------------------------
1 | #
2 | # This is the AOLserver hosts.deny file. It allows you to specify which
3 | # hosts may not log in as certain users. If you have an entry in this
4 | # file for a given user, you may not have an entry in hosts.allow for
5 | # that same user.
6 | #
7 | # Example:
8 | #
9 | # nsadmin: hacker.badguy.com, .aol.com, 10.2.114.0/255.255.255.0
10 | #
11 |
12 |
--------------------------------------------------------------------------------
/nsperm/passwd:
--------------------------------------------------------------------------------
1 | ""::::::
2 | nsadmin:ubphBI5lDzSYc:::::
3 | nobody::::::
4 |
--------------------------------------------------------------------------------
/nsperm/perms:
--------------------------------------------------------------------------------
1 | # This is the AOLserver perms file which defines which users
2 | # and groups may or may not visit certain URLs.
3 | #
4 | # The format is:
5 | # ACTION INHERITANCE METHOD URL ENTITY
6 | #
7 | # ACTION can be: denygroup, allowgroup, denyuser, or allowuser
8 | # INHERITANCE can be: inherit or noinherit
9 | # METHOD can be: PUT, GET, POST, or any other supported method.
10 | # URL is the path relative to pageroot, such as /index.html or /images
11 | # ENTITY is either the name of a user or group, as specified in the
12 | # passwd and group files.
13 | #
14 | # Example:
15 | # allowuser inherit GET /NS nsadmin
16 |
--------------------------------------------------------------------------------
/nsproxy/Makefile:
--------------------------------------------------------------------------------
1 | #
2 | # This Source Code Form is subject to the terms of the Mozilla Public
3 | # License, v. 2.0. If a copy of the MPL was not distributed with this
4 | # file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 | #
6 | # The Initial Developer of the Original Code and related documentation
7 | # is America Online, Inc. Portions created by AOL are Copyright (C) 1999
8 | # America Online, Inc. All Rights Reserved.
9 | #
10 | #
11 |
12 | MODNAME = nsproxy
13 | LIBNM = $(MODNAME)
14 | PGM = $(MODNAME)-helper
15 | MOD = $(MODNAME).so
16 | LIBHDRS = nsproxy.h
17 | LIBOBJS = nsproxylib.o
18 | PGMOBJS = nsproxy.o
19 | MODOBJS = nsproxymod.o
20 | MANSRCS = ns_proxy.man
21 |
22 | CFLAGS += -DNSPROXY_HELPER='"$(MODNAME)-helper"'
23 |
24 |
25 | include ../include/Makefile.build
26 |
--------------------------------------------------------------------------------
/nsproxy/Makefile.win32:
--------------------------------------------------------------------------------
1 |
2 | MODNAME = nsproxy
3 | LIBNM = $(MODNAME)
4 | PGM = $(MODNAME)-helper
5 | MOD = $(MODNAME).so
6 | LIBHDRS = nsproxy.h
7 | LIBOBJS = nsproxylib.o
8 | PGMOBJS = nsproxy.o
9 | MODOBJS = nsproxymod.o
10 | MANSRCS = ns_proxy.man
11 |
12 | CFLAGS = $(CFLAGS) -DNSPROXY_HELPER='"$(MODNAME)-helper"'
13 |
14 | include ../include/Makefile.build
15 |
--------------------------------------------------------------------------------
/nsproxy/nsproxy.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This Source Code Form is subject to the terms of the Mozilla Public
3 | * License, v. 2.0. If a copy of the MPL was not distributed with this
4 | * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 | *
6 | * The Initial Developer of the Original Code and related documentation
7 | * is America Online, Inc. Portions created by AOL are Copyright (C) 1999
8 | * America Online, Inc. All Rights Reserved.
9 | *
10 | */
11 |
12 | /*
13 | * nsproxy.c --
14 | *
15 | * Simple main for ns_proxy slave.
16 | */
17 |
18 | #include "nsproxy.h"
19 |
20 | static int
21 | MyInit(Tcl_Interp *UNUSED(interp))
22 | {
23 | return TCL_OK;
24 | }
25 |
26 | int
27 | main(int argc, char **argv)
28 | {
29 | return Ns_ProxyMain(argc, argv, MyInit);
30 | }
31 |
--------------------------------------------------------------------------------
/nsproxy/test-nsproxy.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # test-nsproxy.sh --
4 | #
5 | # Make sure the nsproxy executable can find the newly built libraries.
6 | # This wrapper script is specified to be called from: tests/test.nscfg
7 | #
8 |
9 | LD_LIBRARY_PATH="../nsd:../nsthread:../nsproxy:$LD_LIBRARY_PATH"
10 | export LD_LIBRARY_PATH
11 |
12 | exec ../nsproxy/nsproxy-helper $@
13 |
--------------------------------------------------------------------------------
/nssock/Makefile:
--------------------------------------------------------------------------------
1 | #
2 | # This Source Code Form is subject to the terms of the Mozilla Public
3 | # License, v. 2.0. If a copy of the MPL was not distributed with this
4 | # file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 | #
6 | # The Initial Developer of the Original Code and related documentation
7 | # is America Online, Inc. Portions created by AOL are Copyright (C) 1999
8 | # America Online, Inc. All Rights Reserved.
9 | #
10 |
11 | MOD = nssock.so
12 | MODOBJS = nssock.o
13 |
14 | include ../include/Makefile.build
15 |
--------------------------------------------------------------------------------
/nsssl/Makefile:
--------------------------------------------------------------------------------
1 | # Emacs mode: -*-Makefile-*-
2 |
3 | # This is the Linux/Unix specific file, do NOT put Microsoft Windows
4 | # nmake stuff here.
5 |
6 | #
7 | # NOTE: PEM_FILE creation is now part of the server's main Makefile.
8 | #
9 |
10 | include Makefile.common
11 | CLEAN += clean-cert
12 |
13 |
14 | LD_LIBRARY_PATH = LD_LIBRARY_PATH="./:$$LD_LIBRARY_PATH"
15 | NSD = $(NAVISERVER)/bin/nsd
16 | NS_TEST_CFG = -c -d -t tests/config.tcl -u nsadmin
17 | NS_TEST_ALL = all.tcl $(TESTFLAGS)
18 | PEM_FILE = tests/etc/server.pem
19 |
20 | certificate: $(PEM_FILE)
21 |
22 | $(PEM_FILE):
23 | $(OPENSSL) genrsa 2048 > host.key
24 | $(OPENSSL) req -new -config tests/etc/openssl.cnf -x509 -nodes -sha1 -days 365 -key host.key > host.cert
25 | $(CAT) host.cert host.key > server.pem
26 | $(RM) host.cert host.key
27 | $(OPENSSL) dhparam 1024 >> server.pem
28 | $(MV) server.pem $(PEM_FILE)
29 |
30 | clean-cert:
31 | rm -f $(PEM_FILE)
32 |
33 | test: certificate all
34 | export $(LD_LIBRARY_PATH); $(NSD) $(NS_TEST_CFG) $(NS_TEST_ALL)
35 |
--------------------------------------------------------------------------------
/nsssl/Makefile.common:
--------------------------------------------------------------------------------
1 | # Emacs mode: -*-Makefile-*-
2 |
3 | MOD = nsssl.so
4 | DLL = nsssl
5 | MODOBJS = nsssl.o
6 | include ../include/Makefile.build
7 |
8 |
--------------------------------------------------------------------------------
/nsssl/Makefile.win32:
--------------------------------------------------------------------------------
1 | # Emacs mode: -*-Makefile-*-
2 |
3 | # This is the Microsoft Windows specific file, for use with nmake. Do
4 | # NOT put Linux stuff here.
5 |
6 | include Makefile.common
7 | CLEAN = $(CLEAN) clean-cert
8 | !message Debug: nsssl: HAVE_OPENSSL_EVP_H: $(HAVE_OPENSSL_EVP_H)
9 |
10 | _dhparams:
11 | openssl dhparam -C -2 -noout 512 >> dhparams-win.h
12 | openssl dhparam -C -2 -noout 1024 >> dhparams-win.h
13 |
--------------------------------------------------------------------------------
/nsssl/tests/all.tcl:
--------------------------------------------------------------------------------
1 | #
2 | # This Source Code Form is subject to the terms of the Mozilla Public
3 | # License, v. 2.0. If a copy of the MPL was not distributed with this
4 | # file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 | #
6 | # Copyright 2006 (C) Stephen Deasey
7 | #
8 | #
9 |
10 | #
11 | # all.tcl --
12 | #
13 | # This file contains a top-level script to run all of the tests.
14 | # Execute it by invoking "source all.tcl" when running nsd in
15 | # command mode in this directory.
16 | #
17 |
18 | package require Tcl 8.5-
19 | package require tcltest 2.2
20 | namespace import tcltest::*
21 | configure {*}$argv -singleproc true -testdir [file dirname [info script]]
22 |
23 |
24 | rename tcltest::test tcltest::__test
25 |
26 | proc tcltest::test args {
27 |
28 | ns_log debug >->-> \
29 | [format "%-16s" "[lindex $args 0]:"] ([lindex $args 1])
30 |
31 | uplevel 1 tcltest::__test $args
32 | }
33 |
34 | runAllTests
35 |
--------------------------------------------------------------------------------
/nsssl/tests/config.tcl:
--------------------------------------------------------------------------------
1 | #
2 | # nsssl configuration test.
3 | #
4 |
5 | set homedir [pwd]/tests
6 | set bindir [file dirname [ns_info nsd]]
7 |
8 | ns_section "ns/parameters"
9 | ns_param home $homedir
10 | ns_param tcllibrary $bindir/../tcl
11 | ns_param logdebug false
12 |
13 | ns_section "ns/servers"
14 | ns_param test "Test Server"
15 |
16 | ns_section "ns/server/test/tcl"
17 | ns_param initfile $bindir/init.tcl
18 | ns_param library $homedir/modules
19 |
20 | ns_section "ns/server/test/modules"
21 | ns_param nsssl [pwd]/nsssl.so
22 |
23 | ns_section "ns/server/test/module/nsssl"
24 | ns_param port 8443
25 | ns_param hostname localhost
26 | ns_param address [expr {[ns_info ipv6] ? "::1" : "127.0.0.1"}]
27 | ns_param ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305"
28 | ns_param protocols "!SSLv2:!SSLv3:!TLSv1.0:!TLSv1.1"
29 | ns_param certificate $homedir/etc/server.pem
30 | ns_param verify 0
31 | ns_param writerthreads 2
32 | ns_param writersize 2048
33 |
34 | ns_section test
35 | ns_param listenport [ns_config "ns/server/test/module/nsssl" port]
36 | ns_param listenurl https://\[[ns_config "ns/server/test/module/nsssl" address]\]:[ns_config "ns/server/test/module/nsssl" port]
37 |
--------------------------------------------------------------------------------
/nsssl/tests/etc/openssl.cnf:
--------------------------------------------------------------------------------
1 | [ req ]
2 | prompt = no
3 | distinguished_name = req_distinguished_name
4 |
5 | [ req_distinguished_name ]
6 | C = AT
7 | ST = Test State or Province
8 | L = Test Locality
9 | O = Organization Name
10 | OU = Organizational Unit Name
11 | CN = Common Name
12 | emailAddress = test@email.address
--------------------------------------------------------------------------------
/nsssl/tests/pages/123:
--------------------------------------------------------------------------------
1 | 123
--------------------------------------------------------------------------------
/nsthread/.cvsignore:
--------------------------------------------------------------------------------
1 | nsthreadtest
2 |
--------------------------------------------------------------------------------
/nsthread/Makefile:
--------------------------------------------------------------------------------
1 | #
2 | # This Source Code Form is subject to the terms of the Mozilla Public
3 | # License, v. 2.0. If a copy of the MPL was not distributed with this
4 | # file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 | #
6 | # The Initial Developer of the Original Code and related documentation
7 | # is America Online, Inc. Portions created by AOL are Copyright (C) 1999
8 | # America Online, Inc. All Rights Reserved.
9 | #
10 | #
11 |
12 | LIBNM = nsthread
13 | DLL = $(LIBNM)
14 | HDRS = thread.h
15 | PGM = nsthreadtest
16 | PGMOBJS = nsthreadtest.o
17 | LIBOBJS = error.o master.o memory.o mutex.o cslock.o \
18 | rwlock.o reentrant.o sema.o thread.o tls.o time.o \
19 | pthread.o fork.o signal.o winthread.o
20 | PGMLIBS = -lpthread
21 |
22 | # Note that when building on Windows, you need the various centralized
23 | # LIB, INCLUDE, TCLPATH, etc. settings found in naviserver/Makefile.win32,
24 | # so just running this nsthread/Makefile directly will not work.
25 | # --atp@piskorski.com, 2014/09/23 13:40 EDT
26 |
27 | include ../include/Makefile.build
28 |
--------------------------------------------------------------------------------
/nsthread/fork.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This Source Code Form is subject to the terms of the Mozilla Public
3 | * License, v. 2.0. If a copy of the MPL was not distributed with this
4 | * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 | *
6 | * The Initial Developer of the Original Code and related documentation
7 | * is America Online, Inc. Portions created by AOL are Copyright (C) 1999
8 | * America Online, Inc. All Rights Reserved.
9 | *
10 | */
11 |
12 | #ifndef _WIN32
13 |
14 | /*
15 | * fork.c --
16 | *
17 | * Implements "ns_fork".
18 | */
19 |
20 | #include "thread.h"
21 |
22 |
23 | /*
24 | *----------------------------------------------------------------------
25 | *
26 | * ns_fork --
27 | *
28 | * POSIX style fork(), using fork1() on Solaris if needed.
29 | *
30 | * Results:
31 | * See fork(2) man page.
32 | *
33 | * Side effects:
34 | * See fork(2) man page.
35 | *
36 | *----------------------------------------------------------------------
37 | */
38 |
39 | pid_t
40 | ns_fork(void)
41 | {
42 | #ifdef HAVE_FORK1
43 | return fork1();
44 | #else
45 | return fork();
46 | #endif
47 | }
48 |
49 | #ifdef Ns_Fork
50 | #undef Ns_Fork
51 | #endif
52 |
53 | pid_t
54 | Ns_Fork(void)
55 | {
56 | return ns_fork();
57 | }
58 |
59 | #endif
60 |
--------------------------------------------------------------------------------
/nsthread/master.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This Source Code Form is subject to the terms of the Mozilla Public
3 | * License, v. 2.0. If a copy of the MPL was not distributed with this
4 | * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 | *
6 | * The Initial Developer of the Original Code and related documentation
7 | * is America Online, Inc. Portions created by AOL are Copyright (C) 1999
8 | * America Online, Inc. All Rights Reserved.
9 | *
10 | */
11 |
12 | /*
13 | * master.c --
14 | *
15 | * Master lock critical section.
16 | */
17 |
18 | #include "thread.h"
19 |
20 | static Ns_Cs master;
21 | static bool initialized = NS_FALSE;
22 |
23 |
24 | /*
25 | *----------------------------------------------------------------------
26 | *
27 | * Ns_MasterLock, Ns_MasterUnlock --
28 | *
29 | * Enter the single master critical section lock.
30 | *
31 | * Results:
32 | * None.
33 | *
34 | * Side effects:
35 | * None.
36 | *
37 | *----------------------------------------------------------------------
38 | */
39 |
40 | void
41 | NsInitMaster(void)
42 | {
43 | Ns_CsInit(&master);
44 | initialized = NS_TRUE;
45 | }
46 |
47 | void
48 | Ns_MasterLock(void)
49 | {
50 | if (initialized) {
51 | Ns_CsEnter(&master);
52 | }
53 | }
54 |
55 | void
56 | Ns_MasterUnlock(void)
57 | {
58 | if (initialized) {
59 | Ns_CsLeave(&master);
60 | }
61 | }
62 |
63 |
64 | /*
65 | * Local Variables:
66 | * mode: c
67 | * c-basic-offset: 4
68 | * fill-column: 78
69 | * indent-tabs-mode: nil
70 | * End:
71 | */
72 |
--------------------------------------------------------------------------------
/returnnotice.adp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | <%= [ns_quotehtml $title] %>
7 |
8 |
9 | <%= [ns_quotehtml $title] %>
10 | <%= $notice %>
11 | <% if {[info exists noticedetail] && $noticedetail} {
12 | ns_adp_puts [subst [ns_trim -delimiter | {
13 | |
14 | | [ns_info name]/[ns_info patchlevel]
15 | |
16 | }]]
17 | }
18 | %>
19 |
20 |
--------------------------------------------------------------------------------
/revproxy/Makefile:
--------------------------------------------------------------------------------
1 | #
2 | # Name of the modules
3 | #
4 | MODNAME = revproxy
5 |
6 | #
7 | # List of components to be installed as the the Tcl module section
8 | #
9 | TCL = revproxy-procs.tcl \
10 | revproxy-ns-http-procs.tcl \
11 | revproxy-ns-connchan-procs.tcl
12 |
13 | #
14 | # Get the common Makefile rules
15 | #
16 | include ../include/Makefile.build
17 |
--------------------------------------------------------------------------------
/revproxy/doc/mann/revproxy1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/revproxy/doc/mann/revproxy1.png
--------------------------------------------------------------------------------
/simple-config.tcl:
--------------------------------------------------------------------------------
1 | #
2 | # This is a fairly minimal NaviServer configuration file that makes the server to
3 | # accept HTTP requests on 0.0.0.0:8000 (IPv4)
4 | #
5 | # Logs are in the logs/nsd.log and logs/access.log
6 | #
7 | # When the nscp module is enabled it will accept telnet into nscp on
8 | # [::1]:2080 (IPv6) or 127.0.0.1:2080 (IPv4)
9 | #
10 |
11 | ns_section ns/servers {
12 | ns_param default NaviServer
13 | }
14 | ns_section ns/server/default/adp {
15 | ns_param map /*.adp
16 | }
17 | ns_section ns/server/default/modules {
18 | #ns_param nscp nscp
19 | ns_param nssock nssock
20 | ns_param nslog nslog
21 | }
22 | ns_section ns/server/default/module/nssock {
23 | ns_param address 0.0.0.0
24 | ns_param port 8000
25 | }
26 |
--------------------------------------------------------------------------------
/tcl/tcloo.tcl:
--------------------------------------------------------------------------------
1 | # exclude the 8.6 TclOO namespace from blueprint creation for now,
2 | # as we don't yet know how to recreate all the artifacts
3 |
4 | nstrace::excludensp ::oo::*
5 |
--------------------------------------------------------------------------------
/tcl/win32.tcl:
--------------------------------------------------------------------------------
1 |
2 | proc _ns_mktemp_win_temp_dir {} {
3 | # On Windows create the tempdir for use by ns_mktemp.
4 | if {! [set win_p [expr {{windows} eq $::tcl_platform(platform)}]]} { return }
5 | set dd [ns_config ns/parameters tmpdir]
6 | if {{} eq $dd} { set dd {c:/temp} }
7 | if {[file isdirectory $dd]} {
8 | ns_log Debug "Good, tmpdir exists: $dd"
9 | return
10 | }
11 | if {[catch {file mkdir $dd} errmsg ret_opts]} {
12 | ns_log Error "Creating tmpdir failed: $dd with Error:\n${errmsg}"
13 | } else {
14 | ns_log Notice "Successfully created tmpdir: $dd"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/compat.test:
--------------------------------------------------------------------------------
1 | # -*- Tcl -*-
2 |
3 | package require tcltest 2.2
4 | namespace import -force ::tcltest::*
5 |
6 | ::tcltest::configure {*}$argv
7 |
8 | testConstraint with_deprecated [dict get [ns_info buildinfo] with_deprecated]
9 |
10 | test ns_cp-1.1 {basic copy} -constraints with_deprecated -setup {
11 | makeFile "data" f1
12 | } -body {
13 | ns_cp f1 f2
14 | viewFile f2
15 | } -cleanup {
16 | removeFile f1
17 | removeFile f2
18 | } -result {data}
19 |
20 |
21 |
22 | cleanupTests
23 |
24 | # Local variables:
25 | # mode: tcl
26 | # tcl-indent-level: 4
27 | # indent-tabs-mode: nil
28 | # End:
29 |
--------------------------------------------------------------------------------
/tests/errordoc.test:
--------------------------------------------------------------------------------
1 | # -*- Tcl -*-
2 |
3 | package require tcltest 2.2
4 | namespace import -force ::tcltest::*
5 |
6 | ::tcltest::configure {*}$argv
7 |
8 |
9 |
10 | test errordoc-1.1 {adp template} -setup {
11 | ns_register_proc GET /400error { ns_returnbadrequest "uh-oh" ;#}
12 | } -body {
13 | nstest::http -getbody 1 GET /400error
14 | } -cleanup {
15 | ns_unregister_op GET /400error
16 | } -match glob -result {400 *oops*}
17 |
18 |
19 |
20 | cleanupTests
21 |
22 | # Local variables:
23 | # mode: tcl
24 | # tcl-indent-level: 4
25 | # indent-tabs-mode: nil
26 | # End:
27 |
--------------------------------------------------------------------------------
/tests/images/broken.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/tests/images/broken.gif
--------------------------------------------------------------------------------
/tests/images/broken.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/tests/images/broken.jpg
--------------------------------------------------------------------------------
/tests/images/color5x200.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/tests/images/color5x200.gif
--------------------------------------------------------------------------------
/tests/images/color5x200.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/tests/images/color5x200.jpg
--------------------------------------------------------------------------------
/tests/images/color5x200_progressive.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/tests/images/color5x200_progressive.jpg
--------------------------------------------------------------------------------
/tests/images/empty.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/tests/images/empty.gif
--------------------------------------------------------------------------------
/tests/images/empty.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/tests/images/empty.jpg
--------------------------------------------------------------------------------
/tests/images/small.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/tests/images/small.gif
--------------------------------------------------------------------------------
/tests/ns_addrbyhost.test:
--------------------------------------------------------------------------------
1 | # -*- Tcl -*-
2 | #
3 | # This Source Code Form is subject to the terms of the Mozilla Public
4 | # License, v. 2.0. If a copy of the MPL was not distributed with this
5 | # file, You can obtain one at https://mozilla.org/MPL/2.0/.
6 | #
7 | # The Initial Developer of the Original Code and related documentation
8 | # is America Online, Inc. Portions created by AOL are Copyright (C) 1999
9 | # America Online, Inc. All Rights Reserved.
10 | #
11 | #
12 |
13 |
14 | package require tcltest 2.2
15 | namespace import -force ::tcltest::*
16 |
17 | test ns_addrbyhost-1.0 {syntax: ns_addrbyhost} -body {
18 | ns_addrbyhost
19 | } -returnCodes {error ok} -result {wrong # args: should be "ns_addrbyhost ?-all? ?--? /hostname/"}
20 |
21 | test ns_addrbyhost-1.1 {good host} -body {
22 | set addr [ns_addrbyhost localhost]
23 | expr {[string match *.*.*.* $addr] || [string match *:* $addr]}
24 | } -result 1
25 |
26 | test ns_addrbyhost-1.2 {bad host} -body {
27 | ns_addrbyhost this_should_not_resolve
28 | } -returnCodes error -result {could not lookup this_should_not_resolve}
29 |
30 |
31 |
32 | cleanupTests
33 |
34 | # Local variables:
35 | # mode: tcl
36 | # tcl-indent-level: 4
37 | # indent-tabs-mode: nil
38 | # End:
39 |
--------------------------------------------------------------------------------
/tests/ns_cond.test:
--------------------------------------------------------------------------------
1 | # -*- Tcl -*-
2 |
3 | # These two files work together for testing ns_cond:
4 | # tests/testserver/modules/nscond.tcl
5 | # tests/ns_cond.test
6 |
7 | package require tcltest 2.2
8 | namespace import -force ::tcltest::*
9 | ::tcltest::configure {*}$argv
10 |
11 | test ns_cond-1.1 {
12 | Master uses ns_cond to wake up a worker thread.
13 | } -body {
14 | set n_done [tst_cond_master]
15 | } -cleanup {
16 | tst_cond_cleanup
17 | } -result 5
18 |
19 | cleanupTests
20 |
21 | # Local variables:
22 | # mode: tcl
23 | # tcl-indent-level: 4
24 | # indent-tabs-mode: nil
25 | # End:
26 |
--------------------------------------------------------------------------------
/tests/ns_conn_host.test:
--------------------------------------------------------------------------------
1 | # -*- Tcl -*-
2 |
3 | package require tcltest 2.2
4 | namespace import -force ::tcltest::*
5 |
6 | ::tcltest::configure {*}$argv
7 |
8 | #ns_logctl severity Debug(ns:driver) on
9 |
10 | if {[ns_config test listenport]} {
11 | testConstraint serverListen true
12 | }
13 |
14 | set port [ns_config "test" listenport]
15 |
16 | test ns_conn_host-1.1 {default location} -constraints serverListen -setup {
17 | ns_register_proc GET /location {
18 | ns_return 200 text/plain [ns_conn location]
19 | }
20 | } -body {
21 | nstest::http -getbody 1 -- GET /location
22 | } -cleanup {
23 | ns_unregister_op GET /location
24 | } -result [list 200 http://test:$port]
25 |
26 |
27 |
28 | test ns_conn_host-2.1 {virtual host location} -constraints serverListen -setup {
29 | ns_register_proc GET /location {
30 | ns_return 200 text/plain [ns_conn location]
31 | }
32 | } -body {
33 | nstest::http -getbody 1 -setheaders [list host testvhost:$port] -- GET /location
34 | } -result [list 200 http://testvhost:$port]
35 |
36 | # Test bad host headers
37 |
38 | test ns_conn_host-2.2 {multiple host header fields} -constraints serverListen -setup {
39 | ns_register_proc GET /location {
40 | ns_return 200 text/plain [ns_conn location]
41 | }
42 | } -body {
43 | nstest::http -getbody 1 -setheaders [list host testvhost:$port Host testvhost2:$port] -- GET /location
44 | } -result {400}
45 |
46 |
47 | # Custom location
48 |
49 | test ns_conn_host-3.1 {custom location} -constraints serverListen -body {
50 | nstest::http -getbody 1 -setheaders [list host testvhost2:$port] -- GET /location
51 | } -result {200 testlocation.arg}
52 |
53 |
54 |
55 | cleanupTests
56 |
57 | # Local variables:
58 | # mode: tcl
59 | # tcl-indent-level: 4
60 | # indent-tabs-mode: nil
61 | # End:
62 |
--------------------------------------------------------------------------------
/tests/ns_gifsize.test:
--------------------------------------------------------------------------------
1 | # -*- Tcl -*-
2 | #
3 | # Thanks to Michael P. Lex (Kinetiqa)
4 | #
5 |
6 | package require tcltest 2.2
7 | namespace import -force ::tcltest::*
8 |
9 | set testdir [ns_config test home]
10 |
11 |
12 |
13 | test ns_gifsize-1.1 {syntax} -body {
14 | ns_gifsize
15 | } -returnCodes error -result {wrong # args: should be "ns_gifsize /filename/"}
16 |
17 |
18 | test ns_gifsize-2.1 {file does not exist} -body {
19 | ns_gifsize "${testdir}/images/noexist.gif"
20 | } -returnCodes error -match "glob" -result {couldn't open "*": no such file or directory}
21 |
22 | test ns_gifsize-2.2 {file is empty} -body {
23 | ns_gifsize "${testdir}/images/empty.gif"
24 | } -returnCodes error -match "glob" -result {invalid GIF file*}
25 |
26 | test ns_gifsize-2.3 {file is broken} -body {
27 | ns_gifsize "${testdir}/images/broken.gif"
28 | } -returnCodes error -match "glob" -result {invalid GIF file*}
29 |
30 | test ns_gifsize-2.4 {normal indexed gif} -body {
31 | ns_gifsize "${testdir}/images/color5x200.gif"
32 | } -returnCodes {error ok} -result [list 5 200]
33 |
34 | test ns_gifsize-2.5 {small gif} -body {
35 | ns_gifsize "${testdir}/images/small.gif"
36 | } -returnCodes {error ok} -result [list 1 1]
37 |
38 | cleanupTests
39 |
40 | # Local variables:
41 | # mode: tcl
42 | # tcl-indent-level: 4
43 | # indent-tabs-mode: nil
44 | # End:
45 |
--------------------------------------------------------------------------------
/tests/ns_hashpath.test:
--------------------------------------------------------------------------------
1 | # -*- Tcl -*-
2 |
3 | package require tcltest 2.2
4 | namespace import -force ::tcltest::*
5 |
6 | ::tcltest::configure {*}$argv
7 |
8 |
9 | test ns_hashpath-1.1 {basic syntax} -body {
10 | ns_hashpath
11 | } -returnCodes error -result {wrong # args: should be "ns_hashpath /string/ /levels[1,MAX]/"}
12 |
13 | test ns_hashpath-1.2 {basic syntax} -body {
14 | ns_hashpath "" 0
15 | } -returnCodes error -result {expected integer in range [1,MAX] for 'levels', but got 0}
16 |
17 | test ns_hashpath-1.3 {basic syntax} -body {
18 | ns_hashpath "" -1
19 | } -returnCodes error -result {expected integer in range [1,MAX] for 'levels', but got -1}
20 |
21 | test ns_hashpath-1.4 {basic syntax} -body {
22 | ns_hashpath "" notanum
23 | } -returnCodes error -result {expected integer but got "notanum"}
24 |
25 |
26 |
27 | test ns_hashpath-2.1 {paths} -body {
28 | ns_hashpath x 1
29 | } -result /x
30 |
31 | test ns_hashpath-2.2 {paths} -body {
32 | ns_hashpath xxx 1
33 | } -result /x
34 |
35 | test ns_hashpath-2.3 {paths} -body {
36 | ns_hashpath xxx 2
37 | } -result /x/x
38 |
39 | test ns_hashpath-2.4 {paths} -body {
40 | ns_hashpath xxx 3
41 | } -result /x/x/x
42 |
43 |
44 |
45 | test ns_hashpath-3.1 {short paths} -body {
46 | ns_hashpath x 2
47 | } -result /x/_
48 |
49 | test ns_hashpath-3.1 {short paths} -body {
50 | ns_hashpath x 3
51 | } -result /x/_/_
52 |
53 | test ns_hashpath-3.1 {short paths} -body {
54 | ns_hashpath xx 3
55 | } -result /x/x/_
56 |
57 |
58 |
59 |
60 | cleanupTests
61 |
62 | # Local variables:
63 | # mode: tcl
64 | # tcl-indent-level: 4
65 | # indent-tabs-mode: nil
66 | # End:
67 |
--------------------------------------------------------------------------------
/tests/ns_hostbyaddr.test:
--------------------------------------------------------------------------------
1 | # -*- Tcl -*-
2 | #
3 | # This Source Code Form is subject to the terms of the Mozilla Public
4 | # License, v. 2.0. If a copy of the MPL was not distributed with this
5 | # file, You can obtain one at https://mozilla.org/MPL/2.0/.
6 | #
7 | # The Initial Developer of the Original Code and related documentation
8 | # is America Online, Inc. Portions created by AOL are Copyright (C) 1999
9 | # America Online, Inc. All Rights Reserved.
10 | #
11 | #
12 |
13 | package require tcltest 2.2
14 | namespace import -force ::tcltest::*
15 |
16 | # "-constraints {noOldDarwin}" in the following two tests does not seem
17 | # necessary in newest macOS installations. On macOS 10.8
18 | # (Darwin 12.*), everything seems fine, on 10.7 (Darwin 11.*), the
19 | # first test does not hold.
20 |
21 | set ::noOldDarwin 1
22 | if {$::tcl_platform(os) eq "Darwin"} {
23 | if {[lindex [split $::tcl_platform(osVersion) .] 0] < 12} {
24 | set ::noOldDarwin 0
25 | }
26 | }
27 |
28 | tcltest::testConstraint noOldDarwin $::noOldDarwin
29 |
30 | test ns_hostbyaddr-1.0 {syntax: ns_hostbyaddr} -constraints {macOrUnix} -body {
31 | ns_hostbyaddr
32 | } -returnCodes {error ok} -result {wrong # args: should be "ns_hostbyaddr /address/"}
33 |
34 | test ns_hostbyaddr-1.1 {good address} -constraints noOldDarwin -body {
35 | ns_hostbyaddr [ns_config test loopback] ;#127.0.0.1
36 | } -match glob -result *
37 |
38 | test ns_hostbyaddr-1.2 {bad address} -constraints {macOrUnix} -body {
39 | ns_hostbyaddr 0.0.0.0
40 | } -returnCodes {error ok} -result {could not lookup 0.0.0.0}
41 |
42 |
43 | cleanupTests
44 |
45 | # Local variables:
46 | # mode: tcl
47 | # tcl-indent-level: 4
48 | # indent-tabs-mode: nil
49 | # End:
50 |
--------------------------------------------------------------------------------
/tests/ns_jpegsize.test:
--------------------------------------------------------------------------------
1 | # -*- Tcl -*-
2 | #
3 | # Thanks to Michael P. Lex (Kinetiqa)
4 | #
5 |
6 | package require tcltest 2.2
7 | namespace import -force ::tcltest::*
8 |
9 | set testdir [ns_config test home]
10 |
11 |
12 |
13 | test ns_jpegsize-1.1 {syntax} -body {
14 | ns_jpegsize
15 | } -returnCodes error -result {wrong # args: should be "ns_jpegsize /filename/"}
16 |
17 |
18 | test ns_jpegsize-2.1 {file does not exist} -body {
19 | ns_jpegsize "${testdir}/images/noexist.jpg"
20 | } -returnCodes error -match "glob" -result {couldn't open "*": no such file or directory}
21 |
22 | test ns_jpegsize-2.2 {file is empty} -body {
23 | ns_jpegsize "${testdir}/images/empty.jpg"
24 | } -returnCodes error -match "glob" -result {invalid JPEG file*}
25 |
26 | test ns_jpegsize-2.3 {file is broken} -body {
27 | ns_jpegsize "${testdir}/images/broken.jpg"
28 | } -returnCodes error -match "glob" -result {invalid JPEG file*}
29 |
30 | test ns_jpegsize-2.4 {normal jpeg} -body {
31 | ns_jpegsize "${testdir}/images/color5x200.jpg"
32 | } -result [list 5 200]
33 |
34 | test ns_jpegsize-2.5 {normal progressive jpeg} -body {
35 | ns_jpegsize "${testdir}/images/color5x200_progressive.jpg"
36 | } -result [list 5 200]
37 |
38 | cleanupTests
39 |
40 | # Local variables:
41 | # mode: tcl
42 | # tcl-indent-level: 4
43 | # indent-tabs-mode: nil
44 | # End:
45 |
--------------------------------------------------------------------------------
/tests/ns_mime.test:
--------------------------------------------------------------------------------
1 | # -*- Tcl -*-
2 |
3 | package require tcltest 2.2
4 | namespace import -force ::tcltest::*
5 |
6 | ::tcltest::configure {*}$argv
7 |
8 |
9 | test ns_guesstype-5.1 {basic syntax: ns_guesstype} -body {
10 | ns_guesstype
11 | } -returnCodes error -result {wrong # args: should be "ns_guesstype /filename/"}
12 |
13 | test ns_guesstype-5.2 {no extension} -body {
14 | ns_guesstype x
15 | } -result "*/*"
16 |
17 | test ns_guesstype-5.3 {no extension, path} -body {
18 | ns_guesstype /x/y/z
19 | } -result "*/*"
20 |
21 | test ns_guesstype-5.4 {path, extension} -body {
22 | ns_guesstype /x/y/z.txt
23 | } -result "text/plain"
24 |
25 |
26 | test ns_guesstype-6.1 {spot check: .html} -body {
27 | ns_guesstype "filename.html"
28 | } -match "glob" -result "text/html*"
29 |
30 | test ns_guesstype-6.2 {spot check: .gif} -body {
31 | ns_guesstype "filename.gif"
32 | } -result "image/gif"
33 |
34 |
35 |
36 | cleanupTests
37 |
38 | # Local variables:
39 | # mode: tcl
40 | # tcl-indent-level: 4
41 | # indent-tabs-mode: nil
42 | # End:
43 |
--------------------------------------------------------------------------------
/tests/ns_sha1.test:
--------------------------------------------------------------------------------
1 | # -*- Tcl -*-
2 |
3 | package require tcltest 2.2
4 | namespace import -force ::tcltest::*
5 |
6 | ::tcltest::configure {*}$argv
7 |
8 | test ns_sha1-1.1 {basic syntax: plain call} -body {
9 | ns_sha1
10 | } -returnCodes error -result {wrong # args: should be "ns_sha1 ?-binary? ?--? /string/"}
11 |
12 |
13 | test ns_sha1-2.1 {basic operation} -body {
14 | ns_sha1 foo
15 | } -result "0BEEC7B5EA3F0FDBC95D0DD47F3C5BC275DA8A33"
16 |
17 | test ns_sha1-2.2 {basic operation} -body {
18 | for {set i 0} {$i < 999} {incr i +1} {
19 | set nssha1([ns_sha1 foo]) .
20 | }
21 | llength [array names nssha1]
22 | } -cleanup {
23 | array unset nssha1
24 | } -result 1
25 |
26 | test ns_sha1-2.3 {basic operation} -body {
27 | for {set i 0} {$i < 999} {incr i +1} {
28 | set nssha1([ns_sha1 $i]) .
29 | }
30 | llength [array names nssha1]
31 | } -cleanup {
32 | array unset nssha1
33 | } -result 999
34 |
35 | test ns_sha1-2.4 {basic operation} -body {
36 | set hash1 [ns_sha1 ""]
37 | set hash2 [ns_sha1 {}]
38 | set hash3 [ns_sha1 [array names fjfjfjfjfj]]
39 | expr {($hash1 eq $hash2) == ($hash2 eq $hash3)}
40 | } -result 1
41 |
42 | test ns_sha1-2.5 {basic operation} -body {
43 | ns_sha1 [binary format H* 6501ff01]
44 | } -result "97CE1CD8E5D85BA0913976868BC3EB024F6DD214"
45 |
46 | test ns_sha1-2.6 {checksum from binary file} -body {
47 | set f [open [ns_server pagedir]/ns_poweredby.png]
48 | fconfigure $f -translation binary
49 | set c [read $f]
50 | close $f
51 | ns_sha1 $c
52 | } -result "1BFB30C1892435CA0AD6042FA80CE6B222E5121A"
53 |
54 | cleanupTests
55 |
56 | # Local variables:
57 | # mode: tcl
58 | # tcl-indent-level: 4
59 | # indent-tabs-mode: nil
60 | # End:
61 |
--------------------------------------------------------------------------------
/tests/ns_thread_crash.test:
--------------------------------------------------------------------------------
1 | # -*- Tcl -*-
2 |
3 | package require tcltest 2.2
4 | namespace import -force ::tcltest::*
5 |
6 | ::tcltest::configure {*}$argv
7 |
8 | if {![catch {package require Thread}]} {
9 | testConstraint Thread true
10 | }
11 | #ns_log notice "====================starting t1"
12 |
13 | test t-1 {object type conversion / display} -body {
14 | set tid [ns_thread create {set x 1}]
15 | ns_thread wait $tid
16 | } -cleanup {
17 | unset -nocomplain -- tid
18 | } -result {1}
19 |
20 | #ns_log notice "====================starting t2"
21 | test tclconnio-3.1 {thread detach, raw} -constraints Thread -setup {
22 | ns_register_proc GET /tclconnio {
23 | package require Thread
24 | set tid [thread::create]
25 | thread::release $tid
26 | ns_return 200 text/plain 1
27 | }
28 | } -body {
29 | nstest::http -getbody 1 -getheaders {content-length connection} GET /tclconnio
30 | } -cleanup {
31 | ns_unregister_op GET /tclconnio
32 | } -result {200 1 close 1}
33 |
34 | #ns_log notice "====================cleanupTests"
35 | cleanupTests
36 | #ns_log notice "====================cleanupTests DONE"
37 |
38 | # Local variables:
39 | # mode: tcl
40 | # tcl-indent-level: 4
41 | # indent-tabs-mode: nil
42 | # End:
43 |
--------------------------------------------------------------------------------
/tests/ns_uuencode.test:
--------------------------------------------------------------------------------
1 | # -*- Tcl -*-
2 | #
3 | # This Source Code Form is subject to the terms of the Mozilla Public
4 | # License, v. 2.0. If a copy of the MPL was not distributed with this
5 | # file, You can obtain one at https://mozilla.org/MPL/2.0/.
6 | #
7 | # The Initial Developer of the Original Code and related documentation
8 | # is America Online, Inc. Portions created by AOL are Copyright (C) 1999
9 | # America Online, Inc. All Rights Reserved.
10 | #
11 | #
12 |
13 | package require tcltest 2.2
14 | namespace import -force ::tcltest::*
15 |
16 | test ns_uuencode-0.1 {basic syntax: plain call} -body {
17 | ns_uuencode
18 | } -returnCodes error -result {wrong # args: should be "ns_uuencode ?-binary? ?--? /string/"}
19 |
20 | test ns_uudecode-0.2 {basic syntax: plain call} -body {
21 | ns_uudecode
22 | } -returnCodes error -result {wrong # args: should be "ns_uudecode ?-binary? ?-strict? ?--? /string/"}
23 |
24 | test ns_uuencode-1.1 {long string} -body {
25 | ns_uuencode 1234567890
26 | } -result MTIzNDU2Nzg5MA==
27 |
28 | test ns_uuencode-1.2 {short string} -body {
29 | ns_uuencode @
30 | } -result QA==
31 |
32 | test ns_uudecode-1.3 {encoded string} -body {
33 | ns_uudecode MTIzNDU2Nzg5MA==
34 | } -result 1234567890
35 |
36 | test ns_uuencode-2.1 {basic operation ns_uuencode} -body {
37 | ns_uuencode "true friends stab you in the front"
38 | } -result "dHJ1ZSBmcmllbmRzIHN0YWIgeW91IGluIHRoZSBmcm9udA=="
39 |
40 | test ns_uudecode-2.2 {basic operation ns_uudecode} -body {
41 | ns_uudecode "dHJ1ZSBmcmllbmRzIHN0YWIgeW91IGluIHRoZSBmcm9udA=="
42 | } -result "true friends stab you in the front"
43 |
44 | cleanupTests
45 |
46 | #
47 | # Local variables:
48 | # mode: tcl
49 | # tcl-indent-level: 4
50 | # indent-tabs-mode: nil
51 | # End:
52 |
--------------------------------------------------------------------------------
/tests/nscp.test:
--------------------------------------------------------------------------------
1 | # -*- Tcl -*-
2 |
3 | package require tcltest 2.2
4 | namespace import -force ::tcltest::*
5 |
6 | ::tcltest::configure {*}$argv
7 |
8 | testConstraint nscpLoaded [expr {[info commands ::nscp] ne ""}]
9 |
10 | test nscp-1.0 {basic syntax "nscp"} -constraints nscpLoaded -body {
11 | nscp
12 | } -returnCodes error -result {wrong # args: should be "nscp users ?/arg .../"}
13 |
14 | test nscp-1.1 {basic syntax "nscp users"} -constraints nscpLoaded -body {
15 | nscp users x
16 | } -returnCodes error -result {wrong # args: should be "nscp users"}
17 |
18 | test nscp-2.0 {return users from config file} -constraints nscpLoaded -body {
19 | nscp users
20 | } -returnCodes {ok error} -result {{} nsadmin}
21 |
22 | cleanupTests
23 |
24 | # Local variables:
25 | # mode: tcl
26 | # tcl-indent-level: 4
27 | # indent-tabs-mode: nil
28 | # End:
29 |
--------------------------------------------------------------------------------
/tests/progress.test:
--------------------------------------------------------------------------------
1 | # -*- Tcl -*-
2 | #
3 | # This Source Code Form is subject to the terms of the Mozilla Public
4 | # License, v. 2.0. If a copy of the MPL was not distributed with this
5 | # file, You can obtain one at https://mozilla.org/MPL/2.0/.
6 | #
7 | # The Initial Developer of the Original Code and related documentation
8 | # is America Online, Inc. Portions created by AOL are Copyright (C) 1999
9 | # America Online, Inc. All Rights Reserved.
10 | #
11 | #
12 |
13 | package require tcltest 2.2
14 | namespace import -force ::tcltest::*
15 |
16 | ::tcltest::configure {*}$argv
17 |
18 |
19 |
20 | test progress-1.1 {basic command} -body {
21 | ns_upload_stats
22 | } -returnCodes error -result {wrong # args: should be "ns_upload_stats /key/"}
23 |
24 | test progress-1.2 {no progress} -body {
25 | ns_upload_stats url-which-does-not-exist
26 | } -result {}
27 |
28 |
29 | #
30 | # TODO: Active progress...
31 | #
32 |
33 |
34 |
35 | cleanupTests
36 |
37 | # Local variables:
38 | # mode: tcl
39 | # tcl-indent-level: 4
40 | # indent-tabs-mode: nil
41 | # End:
42 |
--------------------------------------------------------------------------------
/tests/revproxy.test:
--------------------------------------------------------------------------------
1 | # -*- Tcl -*-
2 |
3 | package require tcltest 2.2
4 | namespace import -force ::tcltest::*
5 |
6 | ::tcltest::configure {*}$argv
7 |
8 | #
9 | # Most of these tests require the OpenSSL API, some require nsf
10 | #
11 | tcltest::testConstraint nsf [expr {[info commands ::nsf::proc] ne ""}]
12 |
13 | test revproxy-1.0 {syntax test} -constraints {nsf} -body {
14 | revproxy::upstream
15 | } -match glob -returnCodes error -result {required argument 'when' is missing, should be:*revproxy::upstream /when/ -target /value/ ?-backend_reply_callback /value/? ?-backend_response_callback /value/? ?-backendconnection /value/? ?-connecttimeout /value/? ?-exception_callback /value/? ?-insecure? ?-receivetimeout /value/? ?-regsubs /value .../? ?-response_header_callback /value/? ?-sendtimeout /value/? ?-targethost /value/? ?-timeout /value/? ?-url_rewrite_callback /value/? ?-use_target_host_header /boolean/? ?-validation_callback /value/?}
16 |
17 | # emulated {wrong # args: should be "revproxy::upstream /when/ -target /value/ ?-backendconnection /value/? ?-insecure? ?-connecttimeout /value/? ?-receivetimeout /value/? ?-sendtimeout /value/? ?-timeout /value/? ?-use_target_host_header true|false? ?-targethost /value/? ?-regsubs /value .../? ?-url_rewrite_callback /value/? ?-response_header_callback /value/? ?-backend_response_callback /value/? ?-exception_callback /value/? ?-validation_callback /value/?"}
18 |
--------------------------------------------------------------------------------
/tests/testserver/certificates/TESTKEY.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN RSA PRIVATE KEY-----
2 | MIIBOwIBAAJBAMv7Reawnxr0DfYN3IZbb5ih/XJGeLWDv7WuhTlie//c2TDXw/mW
3 | 914VFyoBfxQxAezSj8YpuADiTwqDZl13wKMCAwEAAQJAYaTrFT8/KpvhgwOnqPlk
4 | NmB0/psVdW6X+tSMGag3S4cFid3nLkN384N6tZ+na1VWNkLy32Ndpxo6pQq4NSAb
5 | YQIhAPNlJsV+Snpg+JftgviV5+jOKY03bx29GsZF+umN6hD/AiEA1ouXAO2mVGRk
6 | BuoGXe3o/d5AOXj41vTB8D6IUGu8bF0CIQC6zah7LRmGYYSKPk0l8w+hmxFDBAex
7 | IGE7SZxwwm2iCwIhAInnDbe2CbyjDrx2/oKvopxTmDqY7HHWvzX6K8pthZ6tAiAw
8 | w+DJoSx81QQpD8gY/BXjovadVtVROALaFFvdmN64sw==
9 | -----END RSA PRIVATE KEY-----
10 |
--------------------------------------------------------------------------------
/tests/testserver/certificates/openssl.cnf:
--------------------------------------------------------------------------------
1 | [ req ]
2 | prompt = no
3 | distinguished_name = req_distinguished_name
4 |
5 | [ req_distinguished_name ]
6 | C = AT
7 | ST = Test State or Province
8 | L = Test Locality
9 | O = Organization Name
10 | OU = Organizational Unit Name
11 | CN = Common Name
12 | emailAddress = test@email.address
--------------------------------------------------------------------------------
/tests/testserver/cgi/info.tclcgi:
--------------------------------------------------------------------------------
1 | ../pages/info.cgi
--------------------------------------------------------------------------------
/tests/testserver/cgi/resource-cgi.txt:
--------------------------------------------------------------------------------
1 | ../pages/10bytes
--------------------------------------------------------------------------------
/tests/testserver/cgi/sub/resource-cgi-sub.txt:
--------------------------------------------------------------------------------
1 | ../resource-cgi.txt
--------------------------------------------------------------------------------
/tests/testserver/modules/init-test.tcl:
--------------------------------------------------------------------------------
1 | # -*- Tcl -*-
2 | #
3 | # This Source Code Form is subject to the terms of the Mozilla Public
4 | # License, v. 2.0. If a copy of the MPL was not distributed with this
5 | # file, You can obtain one at https://mozilla.org/MPL/2.0/.
6 | #
7 | # The Initial Developer of the Original Code and related documentation
8 | # is America Online, Inc. Portions created by AOL are Copyright (C) 1999
9 | # America Online, Inc. All Rights Reserved.
10 | #
11 | #
12 |
13 | # init-test.tcl -
14 | #
15 | # Support routines for the tests in tests/init.test
16 | #
17 |
18 | #
19 | # A simple proc which should be replicated in all interps after startup.
20 | #
21 |
22 | proc testproc1 {} {
23 | ns_log notice testproc1
24 | }
25 |
26 | #
27 | # A namespaced proc which should be replicated in all interps after startup.
28 | #
29 |
30 | namespace eval testnamespace {}
31 |
32 | proc testnamespace::testproc2 {} {
33 | ns_log notice testproc1
34 | }
35 |
36 | #
37 | # Variables in the global namespace should not get replicated.
38 | #
39 |
40 | set testglobalvariable 1
41 |
42 | #
43 | # Variables in namespaces should not get replicated?
44 | #
45 |
46 | set testnamespace::testvariable2 1
47 |
48 | interp alias {} ::testalias1 {} testproc1
49 | interp alias {} ::testnamespace::testalias2 {} testnamespace::testproc2
50 | interp alias {} testalias11 {} testproc1
51 | interp alias {} testnamespace::testalias12 {} testnamespace::testproc2
52 |
--------------------------------------------------------------------------------
/tests/testserver/modules/listencallback-procs.tcl:
--------------------------------------------------------------------------------
1 | namespace eval ::ns_listencallback {
2 | proc conn_handler {rfd wfd} {
3 | #ns_log notice "--- conn_handler called with $rfd $wfd"
4 | puts $wfd "Welcome to the test server"
5 | flush $wfd
6 | #ns_log notice "--- conn_handler reads from $rfd"
7 | gets $rfd line
8 | #ns_log notice "--- conn_handler got <$line>"
9 | puts $wfd "Well isn't that nice"
10 | flush $wfd
11 | }
12 | }
13 |
14 | # Local variables:
15 | # mode: tcl
16 | # tcl-indent-level: 4
17 | # indent-tabs-mode: nil
18 | # End:
19 |
--------------------------------------------------------------------------------
/tests/testserver/modules/ns_filter.tcl:
--------------------------------------------------------------------------------
1 | # -*- Tcl -*-
2 |
3 | # These two files work together for testing ns_cond:
4 | # tests/testserver/modules/nscond.tcl
5 | # tests/ns_cond.test
6 |
7 | proc ::_ns_filter_test {what result args} {
8 | #ns_log notice "CALLED ::_ns_filter_test $what $result <$args>"
9 | if {[llength $args] ne 0} {
10 | set script [lindex $args 0]
11 | eval $script
12 | }
13 | return $result
14 | }
15 |
16 |
17 | # Local variables:
18 | # mode: tcl
19 | # tcl-indent-level: 4
20 | # indent-tabs-mode: nil
21 | # End:
22 |
--------------------------------------------------------------------------------
/tests/testserver/modules/vhost.tcl:
--------------------------------------------------------------------------------
1 | # -*- Tcl -*-
2 | #
3 | # This Source Code Form is subject to the terms of the Mozilla Public
4 | # License, v. 2.0. If a copy of the MPL was not distributed with this
5 | # file, You can obtain one at https://mozilla.org/MPL/2.0/.
6 | #
7 | # Copyright (C) 2005 Stephen Deasey
8 | #
9 | #
10 |
11 | if {![string match "testvhost*" [ns_info server]]} {
12 | return
13 | }
14 |
15 | ns_register_proc GET /serverpath {
16 | set cmd [list ns_serverpath]
17 | if {[ns_queryexists host]} {
18 | lappend cmd -host [ns_queryget host] --
19 | } else {
20 | lappend cmd --
21 | }
22 | if {[ns_queryexists path]} {
23 | lappend cmd [ns_queryget path]
24 | }
25 | ns_return 200 text/plain [eval $cmd] ;#}
26 |
27 |
28 | ns_register_proc GET /pagepath {
29 | set cmd [list ns_pagepath]
30 | if {[ns_queryexists host]} {
31 | lappend cmd -host [ns_queryget host] --
32 | } else {
33 | lappend cmd --
34 | }
35 | if {[ns_queryexists path]} {
36 | lappend cmd [ns_queryget path]
37 | }
38 | ns_return 200 text/plain [eval $cmd] ;#}
39 |
40 |
41 | ns_register_proc GET /location {
42 | ns_return 200 text/plain [ns_conn location] ;#}
43 |
44 |
45 |
46 | if {"testvhost2" ne [ns_info server] } {
47 | return
48 | }
49 |
50 | ns_serverrootproc nstest::serverroot arg
51 | ns_locationproc nstest::location arg
52 |
53 | proc nstest::serverroot {{host ""} args} {
54 | if {$host ne "" } {
55 | set path [eval file join testserverroot $host $args]
56 | } else {
57 | set path [eval file join testserverroot $args]
58 | }
59 | return /$path
60 | }
61 |
62 | proc nstest::location {args} {
63 | return "testlocation.$args"
64 | }
65 |
--------------------------------------------------------------------------------
/tests/testserver/pages/1:
--------------------------------------------------------------------------------
1 | 1
2 |
3 |
--------------------------------------------------------------------------------
/tests/testserver/pages/10bytes:
--------------------------------------------------------------------------------
1 | 0123456789
--------------------------------------------------------------------------------
/tests/testserver/pages/123:
--------------------------------------------------------------------------------
1 | 123
--------------------------------------------------------------------------------
/tests/testserver/pages/2:
--------------------------------------------------------------------------------
1 | 22
2 |
3 |
--------------------------------------------------------------------------------
/tests/testserver/pages/3:
--------------------------------------------------------------------------------
1 | 333
2 |
3 |
--------------------------------------------------------------------------------
/tests/testserver/pages/400return.adp:
--------------------------------------------------------------------------------
1 | oops
2 |
--------------------------------------------------------------------------------
/tests/testserver/pages/adp1.adp:
--------------------------------------------------------------------------------
1 | 2 + 2 = <%= [expr 2 + 2] %> !!!
2 |
--------------------------------------------------------------------------------
/tests/testserver/pages/adp2.adp:
--------------------------------------------------------------------------------
1 | 2 + 2 = <%= [expr 2 + 2] %> !!!
2 | argc <%= [ns_adp_argc] %>
3 | argv <%= [ns_adp_argv] %>
4 |
--------------------------------------------------------------------------------
/tests/testserver/pages/binary:
--------------------------------------------------------------------------------
1 | ☀
--------------------------------------------------------------------------------
/tests/testserver/pages/cgi-wc/listdir.tclcgi:
--------------------------------------------------------------------------------
1 | ../info.cgi
--------------------------------------------------------------------------------
/tests/testserver/pages/cgi-wc/resource-cgi-wc.txt:
--------------------------------------------------------------------------------
1 | ../10bytes
--------------------------------------------------------------------------------
/tests/testserver/pages/cgi-wc/sub/sub.tclcgi:
--------------------------------------------------------------------------------
1 | ../listdir.tclcgi
--------------------------------------------------------------------------------
/tests/testserver/pages/csv:
--------------------------------------------------------------------------------
1 | "aaa","bbb","ccc"
2 | "aaa","b
3 | bb","ccc"
4 | zzz,yyy,xxx
5 | 1 , 2 , 3
6 | includes(")quote,"quoted includes ("") quote"
7 | elm2,,empty
8 | single
9 | last3,empty,,,
10 |
11 |
--------------------------------------------------------------------------------
/tests/testserver/pages/deepnest.adp:
--------------------------------------------------------------------------------
1 | <%
2 | #
3 | # An ADP page with deeply nested delimiters
4 | #
5 | set choice [ns_queryget choice 1]
6 |
7 | %><%= [ns_adp_parse {<%
8 | ns_adp_puts -nonewline [ns_adp_parse {<%
9 | ns_adp_puts -nonewline "deep"
10 | %>}]
11 | %>}]
12 | %>
13 |
--------------------------------------------------------------------------------
/tests/testserver/pages/encoding.iso-8859-2_adp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/tests/testserver/pages/encoding.iso-8859-2_adp
--------------------------------------------------------------------------------
/tests/testserver/pages/encoding.iso2iso_adp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/tests/testserver/pages/encoding.iso2iso_adp
--------------------------------------------------------------------------------
/tests/testserver/pages/encoding.iso2utf_adp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/tests/testserver/pages/encoding.iso2utf_adp
--------------------------------------------------------------------------------
/tests/testserver/pages/encoding.iso_adp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/tests/testserver/pages/encoding.iso_adp
--------------------------------------------------------------------------------
/tests/testserver/pages/encoding.utf2iso_adp:
--------------------------------------------------------------------------------
1 | <% #this is an utf-8 adp-page which should be converted to iso-8859-1%>äöü
--------------------------------------------------------------------------------
/tests/testserver/pages/encoding.utf2utf_adp:
--------------------------------------------------------------------------------
1 | <%
2 | #this is an utf-8 adp-page which should not be converted
3 |
4 | if {[ns_queryget mime NULL] eq "iso"} {
5 | ns_adp_mimetype "text/plain; charset=iso-8859-1"
6 | }
7 |
8 | %>äöü
--------------------------------------------------------------------------------
/tests/testserver/pages/encoding.utf_adp:
--------------------------------------------------------------------------------
1 | <% #this is an utf-8 adp-page which should be converted to OutputCharset%>äöü
--------------------------------------------------------------------------------
/tests/testserver/pages/hello.cgi:
--------------------------------------------------------------------------------
1 | # -*- Tcl -*-
2 | puts "Content-type: text/html"
3 | puts ""
4 | puts "Hello"
5 | puts ""
6 | puts "You are using $::env(HTTP_USER_AGENT)."
7 | puts ""
--------------------------------------------------------------------------------
/tests/testserver/pages/hello.html:
--------------------------------------------------------------------------------
1 | Hello World!
--------------------------------------------------------------------------------
/tests/testserver/pages/hello.xhtml:
--------------------------------------------------------------------------------
1 | Hello World!
--------------------------------------------------------------------------------
/tests/testserver/pages/helloworld.adp:
--------------------------------------------------------------------------------
1 | <%
2 | #
3 | # A simple ADP page.
4 | #
5 |
6 | set data [ns_queryget data "Hello World!"]
7 | set repeat [ns_queryget repeat 1]
8 |
9 | %><%= [string repeat $data $repeat] %>
--------------------------------------------------------------------------------
/tests/testserver/pages/helloworld.tcl:
--------------------------------------------------------------------------------
1 | #
2 | # A simple Tcl page.
3 | #
4 |
5 | set data [ns_queryget data "Hello World!"]
6 | set repeat [ns_queryget repeat 1]
7 |
8 | ns_return 200 text/plain [string repeat $data $repeat]
--------------------------------------------------------------------------------
/tests/testserver/pages/http_chunked.adp:
--------------------------------------------------------------------------------
1 | <%
2 | # If streaming is enabled but the browser does not support
3 | # chunked encoding, revert to Connection: close to mark
4 | # end of content.
5 |
6 | ns_adp_ctl stream [ns_queryget stream 0]
7 |
8 |
9 | # Manipulate the ADP buffer size to force streaming behaviour
10 | # or fully buffered.
11 |
12 | ns_adp_ctl bufsize [ns_queryget bufsize 8192]
13 |
14 |
15 | # When streaming the buffer is flushed after each call to append.
16 | # Otherwise, everything is buffered and chunking is not required
17 | # as the content length is known.
18 |
19 | ns_adp_append 0123456789
20 | ns_adp_append 01234
21 | %>
--------------------------------------------------------------------------------
/tests/testserver/pages/http_nonexistent.adp:
--------------------------------------------------------------------------------
1 | <%
2 | # Issue an HTTP request to a nonexistent address
3 | if {0} {
4 | ns_log notice "REQUEST START"
5 | set r [ns_http run http://192.0.2.1/]
6 | ns_log notice "REQUEST DONE $r"
7 | ns_adp_puts $r
8 | set r
9 | } {
10 | if {$::tcl_version < 8.6} {package require try}
11 | try {
12 | ns_log notice "REQUEST START"
13 | set r [ns_http run http://192.0.2.1/]
14 | ns_log notice "REQUEST DONE $r"
15 | ns_adp_puts $r
16 | set r
17 | } trap NS_TIMEOUT {r} {
18 | #puts stderr "REQUEST ends in Timeout"
19 | ns_log notice "Trap NS_TIMEOUT $r"
20 | } on error {errorMsg} {
21 | #puts stderr "REQUEST ends in ERROR: $errorMsg"
22 | #
23 | # The behavior on Linux and macOS is different. While an
24 | # attempt to connect to a non-existent IP address under macOS
25 | # leads for async connections to a timeout, we see an error
26 | # under Linux (socket is not connected). Make sure, we trigger
27 | # a timeout as well.
28 | #
29 | ns_log error "connect to a nonexistent address: $::errorCode, errorMsg $errorMsg"
30 | ns_sleep 5s
31 | } on ok {r} {
32 | ns_log notice "REQUEST ends OK"
33 | }
34 | }
35 | %>
36 |
--------------------------------------------------------------------------------
/tests/testserver/pages/http_returntimeout.adp:
--------------------------------------------------------------------------------
1 | <%
2 | # http request to a nonexistent address
3 | ns_adp_puts [ns_http run -timeout 0.5s http://192.0.2.1/]
4 | %>
5 |
--------------------------------------------------------------------------------
/tests/testserver/pages/nested.adp:
--------------------------------------------------------------------------------
1 | <%
2 | #
3 | # An ADP page with nested delimiters
4 | #
5 | set choice [ns_queryget choice 1]
6 |
7 | %><%= [switch -exact -- $choice {
8 | case 1 {
9 | ns_adp_parse {<% # anything %>anything}
10 | }
11 | case 2 {
12 | ns_adp_parse {<% # anything %>anything}
13 | }
14 | default {
15 | ns_adp_parse {<% # anything %>anything}
16 | }
17 | }]
18 | %>
19 |
--------------------------------------------------------------------------------
/tests/testserver/pages/ns_adp_compress.adp:
--------------------------------------------------------------------------------
1 | <%
2 | ns_conn compress 1
3 | ns_adp_ctl stream [ns_queryget stream 0]
4 | ns_adp_ctl bufsize [ns_queryget bufsize 8192]
5 |
6 | %>this is a test
--------------------------------------------------------------------------------
/tests/testserver/pages/ns_http-6.5.2-multipart-mixed.request:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/tests/testserver/pages/ns_http-6.5.2-multipart-mixed.request
--------------------------------------------------------------------------------
/tests/testserver/pages/ns_poweredby.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/tests/testserver/pages/ns_poweredby.png
--------------------------------------------------------------------------------
/tests/testserver/pages/test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World
4 |
5 |
6 | HelloWorld
7 |
8 |
9 |
--------------------------------------------------------------------------------
/tests/testserver/pages/test.html.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/tests/testserver/pages/test.html.gz
--------------------------------------------------------------------------------
/tests/testserver/pages/timeout-inc.adp:
--------------------------------------------------------------------------------
1 | OK
2 | <% ns_adp_include timeout.adp %>
3 | OK
--------------------------------------------------------------------------------
/tests/testserver/pages/timeout.adp:
--------------------------------------------------------------------------------
1 | <% error "timeout waiting for x" "" NS_TIMEOUT %>
--------------------------------------------------------------------------------
/tests/testserver/pages/timeout.tcl:
--------------------------------------------------------------------------------
1 | error "timeout waiting for x" "" NS_TIMEOUT
2 |
--------------------------------------------------------------------------------
/tests/testserver/pages/utf-8-chars:
--------------------------------------------------------------------------------
1 | äüö☀
--------------------------------------------------------------------------------
/tests/testserver/vhosts/t/e/s/testvhost/pages/404.tcl:
--------------------------------------------------------------------------------
1 | ns_return 200 text/plain "CUSTOM 404 page"
2 |
--------------------------------------------------------------------------------
/tests/testserver/vhosts/t/e/s/testvhost/pages/405.tcl:
--------------------------------------------------------------------------------
1 | ns_return 200 text/plain "CUSTOM 405 page"
2 |
--------------------------------------------------------------------------------
/tests/timeout.test:
--------------------------------------------------------------------------------
1 | # -*- Tcl -*-
2 |
3 | package require tcltest 2.2
4 | namespace import -force ::tcltest::*
5 |
6 | ::tcltest::configure {*}$argv
7 |
8 |
9 |
10 | test timeout-1.1 {Tcl page} -body {
11 | nstest::http -getbody 1 GET /timeout.tcl
12 | } -match glob -result {503 *Service Unavailable*}
13 |
14 | test timeout-1.2 {Tcl filter} -setup {
15 | ns_register_filter preauth GET /timeout-1.2 \
16 | {error "timeout waiting for x" "" NS_TIMEOUT ;# }
17 | } -body {
18 | nstest::http -getbody 1 GET /timeout-1.2
19 | } -match glob -result {503 *Service Unavailable*}
20 |
21 | test timeout-1.3 {registered proc} -setup {
22 | ns_register_proc GET /timeout-1.3 \
23 | error "timeout waiting for x" "" NS_TIMEOUT
24 | } -body {
25 | nstest::http -getbody 1 GET /timeout-1.3
26 | } -cleanup {
27 | ns_unregister_op GET /timeout-1.3
28 | } -match glob -result {503 *Service Unavailable*}
29 |
30 | test timeout-1.4 {extra error info} -setup {
31 | ns_register_proc GET /timeout-1.4 \
32 | error "timeout waiting for x" "" "NS_TIMEOUT YoHoHo"
33 | } -body {
34 | nstest::http -getbody 1 GET /timeout-1.4
35 | } -cleanup {
36 | ns_unregister_op GET /timeout-1.4
37 | } -match glob -result {503 *Service Unavailable*}
38 |
39 | test timeout-1.5 {ADP page} -body {
40 | nstest::http -getbody 1 GET /timeout.adp
41 | } -match glob -result {503 *Service Unavailable*}
42 |
43 | test timeout-1.6 {ADP page w/include} -body {
44 | nstest::http -getbody 1 GET /timeout-inc.adp
45 | } -match glob -result {503 *Service Unavailable*}
46 |
47 |
48 |
49 | cleanupTests
50 |
51 | # Local variables:
52 | # mode: tcl
53 | # tcl-indent-level: 4
54 | # indent-tabs-mode: nil
55 | # End:
56 |
--------------------------------------------------------------------------------
/version_include.man.in:
--------------------------------------------------------------------------------
1 | [vset version @PACKAGE_VERSION@]
--------------------------------------------------------------------------------
/win/cgitest/main.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This Source Code Form is subject to the terms of the Mozilla Public
3 | * License, v. 2.0. If a copy of the MPL was not distributed with this
4 | * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 | *
6 | * The Initial Developer of the Original Code and related documentation
7 | * is America Online, Inc. Portions created by AOL are Copyright (C) 1999
8 | * America Online, Inc. All Rights Reserved.
9 | *
10 | */
11 |
12 | #include
13 | #include
14 | #include
15 |
16 | /*
17 | * This file is just for testing purposes under windows to check the
18 | * CGI interface.
19 | */
20 |
21 | int
22 | main(TCL_SIZE_T argc, char **argv)
23 | {
24 | TCL_SIZE_T i;
25 | char buf[8192];
26 |
27 | if (strstr(argv[0], "nph-") != NULL) {
28 | printf("HTTP/1.0 200 OK\r\nServer: %s\r\n", argv[0]);
29 | }
30 | printf("content-type: text/plain\r\n\r\n");
31 | puts("\nArgs:");
32 | for (i = 0; i < argc; ++i) {
33 | puts(argv[i]);
34 | }
35 |
36 | puts("\nEnvironment:");
37 | for (i = 0; _environ[i] != NULL; ++i) {
38 | printf("%s\n", _environ[i]);
39 | }
40 |
41 | puts("\nContent:");
42 | while ((i = fread(buf, 1, sizeof(buf), stdin)) > 0) {
43 | fwrite(buf, 1, i, stdout);
44 | }
45 | return 0;
46 | }
47 |
48 | /*
49 | * Local Variables:
50 | * mode: c
51 | * c-basic-offset: 4
52 | * fill-column: 78
53 | * indent-tabs-mode: nil
54 | * End:
55 | */
56 |
--------------------------------------------------------------------------------
/win/main/main.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {9d91219d-4b21-478e-a829-cd940a65d506}
6 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
7 |
8 |
9 | {9d41117d-9883-4ba3-9a13-1d3db5c2da60}
10 | h;hpp;hxx;hm;inl
11 |
12 |
13 | {f94f45bf-7124-480f-ad7c-055db331d19b}
14 | ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 |
--------------------------------------------------------------------------------
/win/main/main.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | C:\naviserver-4.99.4\win\debug\nsd.exe
5 | WindowsLocalDebugger
6 |
7 |
8 | ..\debug
9 |
10 |
11 | C:\naviserver-4.99.4\win\release\nsd.exe
12 | WindowsLocalDebugger
13 |
14 |
--------------------------------------------------------------------------------
/win/nscgi/nscgi.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {eea8a8a1-df1d-4953-8ea2-7b3040ec67f7}
6 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
7 |
8 |
9 | {e320cd2e-6564-40d5-8998-f6d7ce050a04}
10 | h;hpp;hxx;hm;inl
11 |
12 |
13 | {8c157bc1-eac1-4e82-ae58-1a55eb576e07}
14 | ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 |
--------------------------------------------------------------------------------
/win/nscp/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/win/nscp/.DS_Store
--------------------------------------------------------------------------------
/win/nscp/nscp.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {6e6ae719-a562-4656-bb87-3690fd9725f1}
6 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
7 |
8 |
9 | {ee23ce9b-2460-4d62-85b9-b49c877b7ded}
10 | h;hpp;hxx;hm;inl
11 |
12 |
13 | {3f0b4adb-70ae-42f8-860b-c9d5be863155}
14 | ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 |
--------------------------------------------------------------------------------
/win/nscp/x64/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/win/nscp/x64/.DS_Store
--------------------------------------------------------------------------------
/win/nsd/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/win/nsd/.DS_Store
--------------------------------------------------------------------------------
/win/nsd/Release/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/win/nsd/Release/.DS_Store
--------------------------------------------------------------------------------
/win/nsd/nsd.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/win/nsdb/nsdb.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {ecd8c0fc-15aa-40f2-8138-0cb171bfe0eb}
6 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
7 |
8 |
9 | {0a4f26c8-df11-44f2-ba89-7f9ddb275ef3}
10 | h;hpp;hxx;hm;inl
11 |
12 |
13 | {7220a6fc-376d-4047-97e2-407a02d2e040}
14 | ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 | Source Files
23 |
24 |
25 | Source Files
26 |
27 |
28 | Source Files
29 |
30 |
31 | Source Files
32 |
33 |
34 |
35 |
36 | Header Files
37 |
38 |
39 | Header Files
40 |
41 |
42 |
--------------------------------------------------------------------------------
/win/nsdb/nsdb.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/win/nsdbpg/nsdbpg.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Header Files
20 |
21 |
22 |
23 |
24 | Source Files
25 |
26 |
27 | Source Files
28 |
29 |
30 |
--------------------------------------------------------------------------------
/win/nslog/nslog.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {3bf73d78-8738-4510-8698-cdf89868dcad}
6 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
7 |
8 |
9 | {8dfbcea6-cbaa-4af0-b6d7-0bedfbc73d33}
10 | h;hpp;hxx;hm;inl
11 |
12 |
13 | {e8b4be93-b8ef-43e4-bf14-c9a24cc4406e}
14 | ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 |
--------------------------------------------------------------------------------
/win/nsoracle/Project1.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Header Files
20 |
21 |
22 |
23 |
24 | Source Files
25 |
26 |
27 |
--------------------------------------------------------------------------------
/win/nsoracle/Project1.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/win/nsperm/nsperm.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {b1318ded-9a3d-4353-9b01-1e0c12c67c8b}
6 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
7 |
8 |
9 | {6abccd0a-0830-4ece-b741-060be3ae37b9}
10 | h;hpp;hxx;hm;inl
11 |
12 |
13 | {70f3cff6-f3fb-4280-a53f-b55b2cfba6d1}
14 | ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 |
--------------------------------------------------------------------------------
/win/nssock/nssock.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {8b68dc10-a4f5-41d6-a0ee-03eab39ce17e}
6 | cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
7 |
8 |
9 | {afeec222-39ba-4dd3-9e7e-c9b3af48cb9c}
10 | h;hpp;hxx;hm;inl
11 |
12 |
13 | {34c0c3b2-64c8-47ff-ba0e-39e4cce8bd40}
14 | ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 |
--------------------------------------------------------------------------------
/win/nsthread/Release/vc110.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naviserver-project/naviserver/db8928194324e89ca489d99bcc1f053e0012a276/win/nsthread/Release/vc110.pdb
--------------------------------------------------------------------------------
/win/nsthread/nsthread.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/win/test/nsd.tcl:
--------------------------------------------------------------------------------
1 | set home [file dirname [ns_info config]]
2 | set bin [file dirname [info nameofexecutable]]
3 | set server test
4 | set sroot servers/$server
5 | set db test
6 |
7 | foreach d [list log servers $sroot $sroot/modules $sroot/pages] {
8 | if ![file exists $home/$d] {
9 | file mkdir $home/$d
10 | }
11 | }
12 |
13 | ns_section ns/parameters
14 | ns_param home $home
15 |
16 | ns_section ns/servers
17 | ns_param $server $server
18 |
19 | ns_section ns/server/$server
20 | ns_param directoryfile index.adp
21 | ns_param threadtimeout 5
22 |
23 | ns_section ns/server/$server/modules
24 | foreach m [list nssock nslog nscp nscgi] {
25 | ns_param $m $bin/$m.dll
26 | }
27 |
28 | ns_section ns/server/$server/adp
29 | ns_param map /*.adp
30 |
31 | ns_section ns/server/$server/module/nssock
32 | ns_param port 8080
33 |
34 | ns_section ns/server/$server/module/nscgi
35 | foreach method {GET POST} {
36 | ns_param map "$method /*.bat"
37 | ns_param map "$method /cgi $bin"
38 | }
39 |
40 | ns_section ns/server/$server/module/nscp
41 | ns_param address 127.0.0.1
42 | ns_param port 9999
43 |
44 | ns_section ns/server/$server/module/nscp/users
45 | # password is "x"
46 | ns_param user nsadmin:t2GqvvaiIUbF2:
47 |
48 |
49 | # nsdb section for "test" odbc datasource
50 | ns_section ns/db/drivers
51 | ns_param odbc $bin/nsodbc.so
52 |
53 | ns_section ns/db/pools
54 | ns_param $db $db
55 |
56 | ns_section ns/db/pool/$db
57 | ns_param driver odbc
58 | ns_param datasource $db
59 |
60 | ns_section ns/server/$server/db
61 | ns_param pools *
62 |
--------------------------------------------------------------------------------
/win/test/servers/test/pages/cgitest.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | echo Content-type: text/plain
3 | echo.
4 | set
5 |
6 |
--------------------------------------------------------------------------------
/win/test/servers/test/pages/index.adp:
--------------------------------------------------------------------------------
1 | Batch CGI test
2 | EXE CGI test
3 | NPH CGI test
4 | <%
5 | set q ""
6 | set g ""
7 | set f [ns_conn form]
8 | if {$f != ""} {
9 | set q [ns_set get $f query]
10 | set g [ns_set get $f go]
11 | }
12 | set infos [list threads locks scheduled callbacks sockcallbacks]
13 | %>
14 |
23 |
24 | <%
25 | set result ""
26 | if {[lsearch $infos $g] >= 0} {
27 | set result [join [lsort [ns_info $g]] \n]
28 | } elseif {$q != ""} {
29 | set err [catch {set result [eval $q]} errMsg]
30 | if $err {
31 | ns_puts "Tcl Error:
"
32 | ns_puts [ns_quotehtml $errMsg]
33 | } else {
34 | ns_puts "Tcl Output:
"
35 | switch $g {
36 | join {
37 | set result [join $result \n]
38 | }
39 | sort {
40 | set result [join [lsort $result] \n]
41 | }
42 | }
43 | }
44 | }
45 | ns_puts [ns_quotehtml $result]
46 | %>
47 |
48 |
--------------------------------------------------------------------------------
/win32/cgitest/main.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This Source Code Form is subject to the terms of the Mozilla Public
3 | * License, v. 2.0. If a copy of the MPL was not distributed with this
4 | * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5 | *
6 | * The Initial Developer of the Original Code and related documentation
7 | * is America Online, Inc. Portions created by AOL are Copyright (C) 1999
8 | * America Online, Inc. All Rights Reserved.
9 | *
10 | */
11 | #include
12 | #include
13 | #include
14 |
15 | /*
16 | * This file is just for testing purposes under windows to check the
17 | * CGI interface.
18 | */
19 |
20 | int
21 | main(int argc, char **argv)
22 | {
23 | int i;
24 | char buf[8192];
25 |
26 | if (strstr(argv[0], "nph-") != NULL) {
27 | printf("HTTP/1.0 200 OK\r\nServer: %s\r\n", argv[0]);
28 | }
29 | printf("content-type: text/plain\r\n\r\n");
30 | puts("\nArgs:");
31 | for (i = 0; i < argc; ++i) {
32 | puts(argv[i]);
33 | }
34 |
35 | puts("\nEnvironment:");
36 | for (i = 0; _environ[i] != NULL; ++i) {
37 | printf("%s\n", _environ[i]);
38 | }
39 |
40 | puts("\nContent:");
41 | while ((i = fread(buf, 1, sizeof(buf), stdin)) > 0) {
42 | fwrite(buf, 1, i, stdout);
43 | }
44 | return 0;
45 | }
46 |
47 | /*
48 | * Local Variables:
49 | * mode: c
50 | * c-basic-offset: 4
51 | * fill-column: 78
52 | * indent-tabs-mode: nil
53 | * End:
54 | */
55 |
--------------------------------------------------------------------------------
/win32/test/nsd.tcl:
--------------------------------------------------------------------------------
1 | set home [file dirname [ns_info config]]
2 | set bin [file dirname [info nameofexecutable]]
3 | set server test
4 | set sroot servers/$server
5 | set db test
6 |
7 | foreach d [list log servers $sroot $sroot/modules $sroot/pages] {
8 | if ![file exists $home/$d] {
9 | file mkdir $home/$d
10 | }
11 | }
12 |
13 | ns_section ns/parameters {
14 | ns_param home $home
15 | }
16 | ns_section ns/servers {
17 | ns_param $server $server
18 | }
19 | ns_section ns/server/$server {
20 | ns_param directoryfile index.adp
21 | ns_param threadtimeout 5s
22 | }
23 |
24 | ns_section ns/server/$server/modules
25 | foreach m [list nssock nslog nscp nscgi] {
26 | ns_param $m $bin/$m.dll
27 | }
28 |
29 | ns_section ns/server/$server/adp {
30 | ns_param map /*.adp
31 | }
32 | ns_section ns/server/$server/module/nssock {
33 | ns_param port 8080
34 | }
35 |
36 | ns_section ns/server/$server/module/nscgi
37 | foreach method {GET POST} {
38 | ns_param map "$method /*.bat"
39 | ns_param map "$method /cgi $bin"
40 | }
41 |
42 | ns_section ns/server/$server/module/nscp {
43 | ns_param address 127.0.0.1
44 | ns_param port 9999
45 | }
46 |
47 | ns_section ns/server/$server/module/nscp/users {
48 | # password is "x"
49 | ns_param user nsadmin:t2GqvvaiIUbF2:
50 | }
51 |
52 |
53 | # nsdb section for "test" odbc datasource
54 | ns_section ns/db/drivers {
55 | ns_param odbc $bin/nsodbc.so
56 | }
57 |
58 | ns_section ns/db/pools
59 | ns_param $db $db
60 |
61 | ns_section ns/db/pool/$db {
62 | ns_param driver odbc
63 | ns_param datasource $db
64 | }
65 | ns_section ns/server/$server/db {
66 | ns_param pools *
67 | }
68 |
--------------------------------------------------------------------------------
/win32/test/servers/test/pages/cgitest.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | echo Content-type: text/plain
3 | echo.
4 | set
5 |
6 |
--------------------------------------------------------------------------------
/win32/test/servers/test/pages/index.adp:
--------------------------------------------------------------------------------
1 | Batch CGI test
2 | EXE CGI test
3 | NPH CGI test
4 | <%
5 | set q ""
6 | set g ""
7 | set f [ns_conn form]
8 | if {$f != ""} {
9 | set q [ns_set get $f query]
10 | set g [ns_set get $f go]
11 | }
12 | set infos [list threads locks scheduled callbacks sockcallbacks]
13 | %>
14 |
23 |
24 | <%
25 | set result ""
26 | if {[lsearch $infos $g] >= 0} {
27 | set result [join [lsort [ns_info $g]] \n]
28 | } elseif {$q != ""} {
29 | set err [catch {set result [eval $q]} errMsg]
30 | if $err {
31 | ns_puts "Tcl Error:
"
32 | ns_puts [ns_quotehtml $errMsg]
33 | } else {
34 | ns_puts "Tcl Output:
"
35 | switch $g {
36 | join {
37 | set result [join $result \n]
38 | }
39 | sort {
40 | set result [join [lsort $result] \n]
41 | }
42 | }
43 | }
44 | }
45 | ns_puts [ns_quotehtml $result]
46 | %>
47 |
48 |
--------------------------------------------------------------------------------