$OpenBSD: patch-src_netcgi2_netcgi_fcgi_ml,v 1.1.1.1 2012/07/16 09:27:31 edd Exp $

Committed upstream:
Netcgi connectors (SCGI, AJP, FCGI): unifying the ~sockaddr
and ~port arguments. ~port now also assumes a loopback binding.
(Suggested by Christopher Zimmermann).
--- src/netcgi2/netcgi_fcgi.ml.orig	Wed May 30 10:46:13 2012
+++ src/netcgi2/netcgi_fcgi.ml	Wed May 30 10:46:32 2012
@@ -790,13 +790,18 @@ let run ?(config=Netcgi.default_config)
     ?(arg_store=(fun _ _ _ -> `Automatic))
     ?(exn_handler=(fun _ f -> f()))
     ?sockaddr
+    ?port
     f =
   (* FIXME: Under M$win, the web server communicates with a FCGI script
      that it launches by means of a named pipe [fd] (contrarily to the
      spec).  The requests are all sent through that pipe.  Thus there is
      a single connection. *)
 
-  let sock = match sockaddr with
+  let sockaddr1 =
+    match port with
+      | None -> None
+      | Some p -> Some(Unix.ADDR_INET(Unix.inet_addr_loopback,p)) in
+  let sock = match sockaddr1 with
     | None ->
 	(* FastCGI launched by the web server *)
 	fcgi_listensock
