by jgrahamc · 15y ago · 0 comments
(= dead-msg* "\nUnknown or expired link.")
(defop-raw x (str req)
(w/stdout str
(aif (fns* (sym (arg req "fnid")))
(it req)
(pr dead-msg*))))
If the fnid (function ID) isn't in the fns* list then you get the dead message. (def flink (f)
(string fnurl* "?fnid=" (fnid (fn (req) (prn) (f req)))))
In many places in the code closures are used to handle requests (see the flink code there). If the fns* list is cleared (say news.arc is restarted or harvest-fnids kills them) then you'll get the message.The use of closures in this manner means that the code needed to handle say a form submission is really compact and set up when the form itself is generated.
I would be interested to know if this is even possible to determine from a macro which variables are bound in the closure.
In particular, harvest-fnids has as maximum number of allowed fnids. If there are too many, it purges any fnids that are older than their expiration time, and the oldest 10%.
Thus, the more fnids created (i.e. the more users), the sooner fnids will get harvested and you'll get the expired error.