From: Joel Reymont <joelr1@gmail.com>
To: Caml List <caml-list@inria.fr>
Cc: Gerd Stolpmann <gerd@gerd-stolpmann.de>
Subject: nethttpd: Describing handlers with netcgi2
Date: Fri, 30 Mar 2007 17:34:41 +0100 [thread overview]
Message-ID: <B07A433C-CE3E-4AD4-BC46-851B6366700A@gmail.com> (raw)
I'm trying to compile the netplex example with netcgi2 instead of
netcgi1. I get
make netplex
ocamlfind ocamlc -o netplex -package "netstring,netcgi2,unix,nethttpd-
for-netcgi2,netplex" \
-thread netplex.ml -linkpkg -g
File "netplex.ml", line 178, characters 48-55:
This expression has type Netcgi.cgi_activation -> unit
but is here used with type
(#Netcgi1_compat.Netcgi_types.cgi_activation as 'a) -> unit
The stumbling block is the dyn_handler assignment below.
let adder =
{ Nethttpd_services.dyn_handler = (fun _ -> process);
dyn_activation = Nethttpd_services.std_activation
`Std_activation_buffered;
dyn_uri = None; (* not needed *)
dyn_translator = (fun _ -> ""); (* not needed *)
dyn_accept_all_conditionals = false;
} in
let nethttpd_factory =
Nethttpd_plex.nethttpd_factory
~handlers:[ "adder", adder ]
() in
Looking at the porting guide[1] I gather that this chunk
(* This is [netcgi1] code! *)
let cgi = new Netcgi.std_activation() in
process cgi
should be replaced with this
(* This is [netcgi2] code! *)
Netcgi_cgi.run process
What should I plug in instead of process into dyn_handler, though?
Thanks in advance, Joel
[1] http://ocamlnet.sourceforge.net/manual-2.2/Netcgi_porting.html
--
http://wagerlabs.com/
reply other threads:[~2007-03-30 16:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=B07A433C-CE3E-4AD4-BC46-851B6366700A@gmail.com \
--to=joelr1@gmail.com \
--cc=caml-list@inria.fr \
--cc=gerd@gerd-stolpmann.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox