caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* nethttpd: Describing handlers with netcgi2
@ 2007-03-30 16:34 Joel Reymont
  0 siblings, 0 replies; only message in thread
From: Joel Reymont @ 2007-03-30 16:34 UTC (permalink / raw)
  To: Caml List; +Cc: Gerd Stolpmann

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/






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-03-30 16:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-30 16:34 nethttpd: Describing handlers with netcgi2 Joel Reymont

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).