Dear All,
Recently, I have encountered with two troubles.
1)))
Because of some reason it quite difficult to configure Apache Rivet to
use UTF-8 properly.
It responded a web pages in ISO8859-1 instead of UTF-8.
The following Apache configuration DO NOT (surprisingly to me) make
rivet to respond a proper UTF-8 pages
(because of headers configuration browser detects it as UTF-8, but text
itself is
encoded in ISO8859-1):
/AddDefaultCharset UTF-8/
/AddType application/x-httpd-rivet .rvt
AddType application/x-rivet-tcl .tcl
AddType 'application/x-httpd-rivet;charset=utf-8' rvt
AddType 'application/x-rivet-tcl;charset=utf-8' tcl/
HTML files contain the metatag:
/<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>/
JSON files contain the header:
/::rivet::headers type "application/json; charset=UTF-8"/
The problem is solved by adding the following
lines of Tcl code info initscript of Rivet:
/encoding system utf-8
fconfigure stdin -encoding utf-8
fconfigure stdout -encoding utf-8/
Thus by default stdin and stdout are configured to use ISO8859-1.
I use latest (last update was about month ago) dev version of Rivet and
apache from debian jessie repository. Probably there is no such issue for
the latest version of apache or for others OS-s (e.g.,I heard that in CentOS
Apache is configured to use UTF-8 by default in contrast to debian).
2)))
I have a question.
How is it possible to set a timeout for a .tcl Rivet page???
I have an api, I would
like to reject requests taking more than 3 seconds for processing
(SQL for some requests sometimes need quite long time, I am trying to
just reject such
requests during the execution)
I've tried standard Apache's Timeout and KeepAliveTimeout directives -
no effect - for a .tcl scripts.
Additionally I tried to utilize Tcl's after command in the following way:
/ after 3000 {puts rejected;::rivet::exit}/
Any ideas?
Thanks a lot in advance,
Regards,
Alexey