                                             (assoc m :status :ok)))
                               (recur name ((:update-fn m) state)))
                   (when unknown-fn
-                    (when-let [[state2 res] (unknown-fn state m)]
+                    (when-let [[state2 res] (unknown-fn state-loop state m)]
                       (when (and res (:res-ch m))
                         (aput-close state-loop (:res-ch m) res))
                       (recur name state2))))))

          [server-state (assoc (dissoc m :pswd) :status :mismatch)])
        [server-state (assoc (dissoc m :pswd) :status :invalid)])
      [server-state (assoc (dissoc m :pswd) :status :invalid)])
    nil))

(defn rq-authenticate [actx m]


; --------------------------------------------

(defn lane-handler [actx lane-state m]
  (case (:op m)
    "realms-list"
    (let [server-state-ch (:server-state-ch m)]
      (act fwd-realms-list actx
           (aput fwd-realms-list server-state-ch
                 (assoc m :cred (:cred lane-state))))
      [lane-state nil])
    nil))

(defn rq-handle-lane [actx m] ; Forward to lane-state-ch to handle the request.
