Re: Error: "http" -- Tag not found

2012-05-19 Thread Alexander Burger
Hi Mansur,

> !? (throw "http")
> "http" -- Tag not found
> ...
> (de http401 ()
>(httpStat 401 "Unauthorized" "WWW-Authenticate: Negotiate")
>(throw "http") )  # <-- error occurs here

The catch/throw tag in the 'http' function is "http", a transient
symbol, which is accessible only in that source file (lib/http.l).

This is to keep the scope locally, to avoid possible conflicts with
application code throwing a tag with the same name during a HTTP
transaction.


The easiest would be to define 'http401' directly in "lib/http.l".


Another solution would be to "steal" partial code from some other
function in "lib/http.l".

Instead of

   (de http401 ()
  (httpStat 401 "Unauthorized" "WWW-Authenticate: Negotiate")
  (throw "http") )

you could write

   (def 'http401
  (cons NIL
 '(httpStat 401 "Unauthorized" "WWW-Authenticate: Negotiate")
 (cddr forbidden) ) )

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Error: "http" -- Tag not found

2012-05-19 Thread Mansur Mamkin
Hi all!

While improving and testing kerberos authentication, 
now I get strange error when I'm going to 
http:/?*ID=$krblogin

!? (throw "http")
"http" -- Tag not found

The code is:
#
(unless (setq *Url (ht:Pack @U))
   (setq *Url (car *Home) @U (cdr *Home)) )
(out S
   (ifn (or (n== *ID 'krblogin) *KrbPrinc) (! http401))  # <-- added code
   (cond
      ((match '("-" @X "." "h" "t" "m" "l") @U)
#  

(de http401 ()
   (httpStat 401 "Unauthorized" "WWW-Authenticate: Negotiate")
   (throw "http") )  # <-- error occurs here

Best regards,
Mansur Mamkin