File: filemanager_fcgi.ml

package info (click to toggle)
ocamlnet 2.2.9-8
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 17,724 kB
  • ctags: 10,053
  • sloc: ml: 63,928; ansic: 1,973; makefile: 800; sh: 651
file content (16 lines) | stat: -rw-r--r-- 560 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(* $Id: filemanager_fcgi.ml,v 1.2 2005/09/04 21:10:05 chris_77 Exp $ *)


let () =
  try
    Filemanager.script (fun ~config ~arg_store ~output_type f ->
			  Netcgi_fcgi.run ~config ~arg_store ~output_type f)

  with Unix.Unix_error(Unix.ENOTSOCK, "accept", _) ->
    let port = 8888 in
    Printf.printf "External server listening on port %i.\n" port;
    flush stdout;
    let run ~config ~arg_store ~output_type f =
      Netcgi_fcgi.run ~config ~arg_store ~output_type f
	~sockaddr:(Unix.ADDR_INET(Unix.inet_addr_any, port)) in
    Filemanager.script run