[racket] stateless servlets problem

From: Stefan Schmiedl (s at xss.de)
Date: Sun Jan 2 05:20:45 EST 2011

Greetings.

I can't create a stateless servlet in racket 5.0.2 (gentoo amd64).

I _can_ create a stateful servlet with

  (define (default-lru-manager)
    (make-threshold-LRU-manager
                      (lambda (request)
                        `(html (head (title "Page Has Expired."))
                               (body (p "Sorry, this page has expired. Please go back."))))
                      (* 16 1024 1024)))

  (define hello-servlet
    (make-v2.servlet (current-directory)
                     (default-lru-manager)
                     hello-servlet-start))


If I understand the docs correctly, the following code should then create
a stateless servlet

  (define world-servlet
    (make-stateless.servlet (current-directory)
                            default-stuffer
                            (default-lru-manager)
                            world-servlet-start))

as (default-lru-manager) was fulfilling the contract requirements in the
stateful case.

But when I run the buffer (Ctrl-T), I get the following error message:

  <collects>/web-server/managers/manager.rkt:5.15: 
    (file
     /usr/lib64/racket/collects/web-server/servlet/setup.rkt)
   broke the contract 
    (-> manager? (-> (-> void) number?))
   on manager-create-instance; expected a procedure that accepts no mandatory arguments without any keywords, given: #<procedure:drscheme-exit-handler>

I also tried substituting the LRU-manager with (create-none-manager #f),
but this did not change the error message. I don't quite get where the
#<procedure:drscheme-exit-handler> comes from at all.

What am I doing wrong here?

Thanks,
s.


Posted on the users mailing list.