caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Michael Alexander Hamburg <hamburg@fas.harvard.edu>
To: Christophe TROESTLER <debian00@tiscali.be>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] CamlGI question
Date: Tue, 19 Apr 2005 16:13:04 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0504191606180.21350@ls04.fas.harvard.edu> (raw)
In-Reply-To: <20050419.133304.40952590.debian00@tiscali.be>



On Tue, 19 Apr 2005, Christophe TROESTLER wrote:

> On Mon, 18 Apr 2005, Mike Hamburg <hamburg@fas.harvard.edu> wrote:
> >
> > 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.

It doesn't exist at all.  I added it because I was getting mysterious
type errors from OCaml when trying to compile directly.  It was on my
"things to clean up" list.

> I do not see why you set [rq=request] as the request can be gotten
> from the cgi object [cgi#request].

You're right, I missed that.

> > 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?

I'll check that too (I'm not at home right now).

> 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.

My main function does actually terminate.  I put a logging message at the
end of the function.  And it's not just buffering output, as killing the
CGI script with signal 9 causes no truncation.  I'll set it to create a
new thread to handle the request, although that doesn't particularly
matter (the threading is necessary to keep the thumbnail cache running,
not for load issues).

> 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?

I can do it without persistence, but synchronization is much more
difficult in that case, eg, preventing to processes from trying to
thumbnail the same files at the asme time.

> 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.

I'll work on it soon and figure out whether this helps or not.  Hopefully
it will.

> ChriS
>

Thanks a lot for your help,
Mike


      parent reply	other threads:[~2005-04-19 20:13 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-18  6:15 Mike Hamburg
2005-04-18  7:29 ` [Caml-list] " Robert Roessler
2005-04-18 13:49   ` Alex Baretta
2005-04-18 14:31     ` Gerd Stolpmann
2005-04-18 16:04       ` Michael Alexander Hamburg
2005-04-18 16:28         ` Alex Baretta
2005-04-19  3:23           ` Mike Hamburg
2005-04-19  3:26             ` [Caml-list] CamlGI question [doh] Mike Hamburg
2005-04-19  9:18               ` Gerd Stolpmann
2005-04-19 15:28                 ` Mike Hamburg
     [not found]                   ` <1113933973.6248.76.camel@localhost.localdomain>
2005-04-19 18:44                     ` Eric Stokes
2005-04-19 19:18                       ` Christophe TROESTLER
2005-04-19 21:11                     ` Eric Stokes
2005-04-19  9:31               ` Alex Baretta
2005-04-19 11:33 ` [Caml-list] CamlGI question Christophe TROESTLER
2005-04-19 12:51   ` Christopher Alexander Stein
2005-04-19 19:03     ` Common CGI interface (was: [Caml-list] CamlGI question) Christophe TROESTLER
2005-04-19 19:54       ` Gerd Stolpmann
2005-04-20  6:55         ` Jean-Christophe Filliatre
2005-04-20  7:22         ` Common XML interface (was: Common CGI interface) Alain Frisch
2005-04-20 11:15           ` [Caml-list] " Gerd Stolpmann
2005-04-20 11:38             ` Nicolas Cannasse
2005-04-20 13:23           ` Stefano Zacchiroli
2005-04-21  6:59             ` [Caml-list] Common XML interface Alain Frisch
2005-04-21 11:34               ` Gerd Stolpmann
2005-04-20 20:00         ` Common CGI interface Christophe TROESTLER
2005-04-20 21:06           ` [Caml-list] " Gerd Stolpmann
2005-04-21  7:36             ` [Ocamlnet-devel] " Florian Hars
2005-04-21 10:41               ` Gerd Stolpmann
2005-04-25 10:38             ` Christophe TROESTLER
2005-04-26 11:08               ` Gerd Stolpmann
2005-05-06 20:14                 ` Christophe TROESTLER
2005-05-10  0:07                   ` [Caml-list] " Christophe TROESTLER
2005-05-10  0:10                   ` Christophe TROESTLER
2005-04-26 16:24               ` [Caml-list] " Eric Stokes
2005-05-06 20:14                 ` Christophe TROESTLER
2005-04-19 20:13   ` Michael Alexander Hamburg [this message]

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=Pine.LNX.4.58.0504191606180.21350@ls04.fas.harvard.edu \
    --to=hamburg@fas.harvard.edu \
    --cc=caml-list@inria.fr \
    --cc=debian00@tiscali.be \
    /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;
as well as URLs for NNTP newsgroup(s).