Commit 189c4799 authored by gerd's avatar gerd

ported to netcgi2. ajp support is broken.


git-svn-id: https://godirepo.camlcity.org/svn/app-wtimer/trunk@20 f6fe576d-e0d0-0310-b8e7-f4ac0f1a5269
parent 736c7a82
......@@ -37,7 +37,7 @@ get_path () {
set_defaults () {
with_cgi=1
with_ajp=1
with_ajp=0
version="1.1.1"
exec_suffix=""
requires="netstring,unix,pxp-engine,pxp-lex-iso88591,wdialog"
......@@ -62,7 +62,7 @@ set_defaults () {
# Option parsing
help_cgi="Create/omit the CGI binary"
help_ajp="Create/omit the AJP (mod_jserv/mod_jk) binary"
help_ajp="Create/omit the AJP (mod_jserv/mod_jk) binary (broken)"
options="cgi ajp"
print_options () {
......
......@@ -295,14 +295,29 @@ let extended_error_page (universe : universe_type) ch error =
log_error (Printexc.to_string error);
(* Instantiate the template "fatal-error" of the startpage manually. *)
(* Step 1: Create our own faked cgi_activation object *)
let cgi_env = new Netcgi_env.custom_environment () in
(* let cgi_env = new Netcgi_env.custom_environment () in *)
let dummy = new Netchannels.output_null () in
let cgi_env =
new Netcgi_common.cgi_environment
~config:Netcgi.default_config
~properties:[ "GATEWAY_INTERFACE", "FAKE CGI";
"REQUEST_METHOD", "GET" ]
~input_header:[]
dummy in
(*
cgi_env # set_output_ch dummy;
cgi_env # set_cgi ~gateway_interface:"FAKE CGI" ~request_method:"GET" ();
cgi_env # set_input_state `Received_header;
cgi_env # set_output_state `Start;
let cgi =
new Netcgi.std_activation ~env:(cgi_env :> Netcgi_env.cgi_environment) () in
*)
let cgi =
new Netcgi_common.cgi
(cgi_env :> Netcgi.cgi_environment)
(`Direct "")
`GET
[] in
(* Step 2: Get the startpage object *)
let environment = Wd_cycle.make_environment cgi in
let startpage = universe # create environment "startpage" in
......
......@@ -29,7 +29,7 @@
open Wd_dialog
open Wd_run_cgi
open Wd_types
open Netcgi_types
open Netcgi
open Db.Types
......@@ -51,10 +51,10 @@ object (self)
(* Check whether there is a cookie containing the browser capabilities: *)
let cgi = (self # environment).cgi in
let cgienv = cgi # environment in
let cookies = cgienv # cookies in
let grid =
try
List.assoc "wtimer-browser-cap" cookies
Netcgi.Cookie.value (cgienv # cookie "wtimer-browser-cap")
(* List.assoc "wtimer-browser-cap" cookies *)
with
Not_found ->
(* No cookie: Browser sniffing as fallback method *)
......@@ -103,7 +103,7 @@ object (self)
let year = 86400.0 *. 365.0 in
let cgi = (self # environment).cgi in
let rh = (self # environment).response_header in
rh.rh_set_cookie <- [ { cookie_name = "wtimer-browser-cap";
rh.rh_set_cookie <- [ { Nethttp.cookie_name = "wtimer-browser-cap";
cookie_value = String.concat "" grid;
cookie_expires = Some (Unix.time() +. year);
cookie_domain = None;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment