From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 34E54BC48 for ; Tue, 19 Apr 2005 13:34:03 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j3JBY2dt017963 for ; Tue, 19 Apr 2005 13:34:02 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA10075 for ; Tue, 19 Apr 2005 13:34:02 +0200 (MET DST) Received: from hedwig1.umh.ac.be (hedwig2.umh.ac.be [193.190.193.73]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j3JBY17k002095 for ; Tue, 19 Apr 2005 13:34:02 +0200 Received: from poincare (mathwifi.swapping.umh.ac.be [10.102.100.18]) by hedwig1.umh.ac.be (8.13.1/8.13.1) with ESMTP id j3JBYEbg761862; Tue, 19 Apr 2005 13:34:15 +0200 Received: from localhost ([127.0.0.1] ident=trch) by poincare with esmtp (Exim 4.50) id 1DNqyl-0002Zw-NH; Tue, 19 Apr 2005 13:33:20 +0200 Date: Tue, 19 Apr 2005 13:33:04 +0200 (CEST) Message-Id: <20050419.133304.40952590.debian00@tiscali.be> To: Mike Hamburg Cc: caml-list@inria.fr Subject: Re: [Caml-list] CamlGI question From: Christophe TROESTLER In-Reply-To: <810e04dc0f6bb601fb828db8d18def6c@fas.harvard.edu> References: <810e04dc0f6bb601fb828db8d18def6c@fas.harvard.edu> Organization: Universite de Mons-Hainaut (http://math.umh.ac.be/an/) X-Spook: Elvis CDC Echelon SAFE BRLO condor industrial intelligence eavesdropping csystems STARLAN X-Blessing: Om Ah Hum Vajra Guru Pema Siddhi Hum X-Operating-System: GNU/Linux (http://www.linux.org/) X-Mailer-URL: http://www.mew.org/ X-Mailer: Mew version 4.2 on Emacs 21.4 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.1 (www dot roaringpenguin dot com slash mimedefang) X-Miltered: at concorde with ID 4264ECAA.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 4264ECAA.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 christophe:01 troestler:01 mli:01 submodules:01 indexing:01 lib:01 buffered:01 buffered:01 ...:98 wrote:01 terminates:01 modules:01 hangs:02 thread:02 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.5 required=5.0 tests=FROM_ENDS_IN_NUMS autolearn=disabled version=3.0.2 X-Spam-Level: On Mon, 18 Apr 2005, Mike Hamburg wrote: > > Is CamlGI still actively maintained? I'm writing a CGI/FastCGI > program using it, and have been having some trouble with the library. It is -- I just do not have much time to care about it. > http://capricorn.dnsalias.org/mike/index/ I downloaded your files. For a start, all the modules are -pack'ed into camlGI.cm[x]a, so you only need to link with that file. Also, the interface of the library is in camlGI.mli with complete documentation. In particular, you should not use hidden submodules: e.g. in "path.ml", say [open CamlGI] and then [Cgi.HttpError] instead of [Cgi_types.HttpError]. Same in "index.ml": you should say [open CamlGI.Cgi], not [open Cgi]. [Request.metavar rq.rq "SERVER_NAME"] can simply be replaced with [Request.server_name rq.rq] [cgi#header_was_emitted ()]: such method does not exist in the public interface. I do not see why you set [rq=request] as the request can be gotten from the cgi object [cgi#request]. > When used as a FastCGI, the indexing script hangs, [...] It is quite > clear that the script has finished by the time the hang occurs Do the examples provided with the lib work as they should? Are you sure your [main] function actually terminates? Indeed, the output is buffered (at least by CamlGI) and may not be fully outputted until the script finishes. Also, if you wish to launch a new process/thread per request, be sure to use the [fork] optional parameter to [handle_requests ?fork f conn] -- otherwise [f] will return immediately and the output "channel" will be closed early. CamlGI follows closely the spec -- even the multiplexing part which is not implemented by many. > The plain CGI version works just fine CGI output is not buffered. > the features of the script only work in the FastCGI version, such as > thumbnailing. Why is that? Do you need persistence for that? Hope it helps. If it does not, send me an example (if possible minimal but definitely self-contained) that exhibits the undesired behavior and I'll have a look. ChriS