On Fri, Aug 01, 2008 at 02:21:03PM +0300, Andrei Ivushkin wrote:
> Static file test.svg is passed.

Ah, sorry, I misunderstood the problem.

>> (mime "svg" "image/svg+xml" 1)
> It is really called in svgtest.l

So let me recapitulate. You invoke it as

   p dbg.l lib/http.l lib/xhtml.l lib/form.l -'server 8080 "svgtest.l"

When the browser connects to 8080, the server does

   (mime "svg" "image/svg+xml" 1)
   (html ...)

This means, that the *child* process that handles this request extends
'*Mimes', and sends a HTML page to the server (the function 'html' is
nothing than a fancy 'print' function after all). The new value of
'*Mimes' is not used at that time.

This child process (who redefined its '*Mimes' and printed the page to
the browser) then terminates, because no session was created (i.e. (app)
was not called).

Now, if the user clicks on some '.svg' link in the generated page, the
browser connects to the server *parent* process again, to handle that
new request. The server then forks another child process, which does not
have its '*Mimes' extended.

So what is needed (as I tried to explain in my last mail) is that 'mime'
is called after loading "lib/http.l", but before the top level server
starts. You could do this with

   p dbg.l lib/http.l lib/xhtml.l lib/form.l \
      -'mime "svg" "image/svg+xml" 1' \
      -'server 8080 "svgtest.l"'

(I didn't test this as I have no '.svg' file :-)

- Alex

Reply via email to