Problem with Allegroserve+Allegrocache

mikel evins <[email protected]> Tue, 5 Sep 2006 11:38:28 -0600
Newsgroups gmane.lisp.allegro
Message-ID <[email protected]>
I have a simple application in progress which uses Allegroserve to  
present a login screen, and uses Allegrocache to maintain a database  
of known users.

Consider the action function:


(defun action-got-login (req ent)
   (let ((username (request-query-value "username" req)))
     (if (and username (> (length username) 0))
         ;; sensible username -- check to see if it's in the database
         (let ((user (db.ac:retrieve-from-index 'dbs::user  
'dbs::username username :db $users)))
           (if user
             "home"
             "login_error"))
         ;; no sensible username
         "login")))

As written, this function does not work; submitting the username from  
the login page causes the browser to display an empty page (that is,  
the source document the browser receives is empty).

The form

(db.ac:retrieve-from-index 'dbs::user 'dbs::username username :db  
$users)

Works fine interactively in the same lisp that is running the webserver:

CL-USER> (db.ac:retrieve-from-index 'dbs::user 'dbs::username  
"mikel" :db $users)
#<DBS::USER oid: 1013, ver 5, trans: 7,  not modified @ #x10b5c172>
CL-USER> (db.ac:retrieve-from-index 'dbs::user 'dbs::username  
"bert" :db $users)
NIL

If I comment out that form and substitute t or nil for the value of  
user, I see the expected behavior in the browser: for T, the "home"  
page, and for nil the "login_error" page.

It is only when the retrieve-from-index form is evaluated that I see  
an empty page in the browser.

Can anyone shed any light on why this is so?

--me