Commit 2e47d63c authored by David Kågedal's avatar David Kågedal
Browse files

* services.el (lyskom-blocking-do-multiple): Använd

lyskom-ok-to-send-new-calls här också.

* startup.el (kom-start-anew): Sätt aldrig lyskom-pers-no till
nil. Sätt lyskom-inhibit-prefetch till t tillfälligt.
parent b1367d83
Sun Jan 4 01:42:08 1998 David Kgedal <davidk@lysator.liu.se>
* services.el (lyskom-blocking-do-multiple): Anvnd
lyskom-ok-to-send-new-calls hr ocks.
* startup.el (kom-start-anew): Stt aldrig lyskom-pers-no till
nil. Stt lyskom-inhibit-prefetch till t tillflligt.
* services.el (lyskom-ok-to-send-new-calls): Ny variabel
(blocking-return,blocking-do): Stt den.
......
......@@ -255,7 +255,7 @@ most lyskom-max-pending-calls are sent to the server at the same time."
(sit-for 0))
(defadvice lyskom-accept-process-output (around stat activate)
(defadvice lyskom-accept-process-output (around stat activate protect)
(fields-replace lyskom-prof-fields 'apo "apo")
(sit-for 0)
ad-do-it
......
......@@ -1160,16 +1160,16 @@ or get-text-stat."
(symbol-name command)))
'blocking 'blocking-return
data)
(while (and (eq lyskom-blocking-return 'not-yet-gotten)
(memq (process-status lyskom-proc) '(open run))
;; The following test should probably be removed
(not lyskom-quit-flag))
(lyskom-accept-process-output))
;; OK to continue with prefetch and stuff again
(setq lyskom-ok-to-send-new-calls t)
(lyskom-check-output-queues)
(unwind-protect
(while (and (eq lyskom-blocking-return 'not-yet-gotten)
(memq (process-status lyskom-proc) '(open run))
;; The following test should probably be removed
(not lyskom-quit-flag))
(lyskom-accept-process-output))
;; OK to continue with prefetch and stuff again
(setq lyskom-ok-to-send-new-calls t)
(lyskom-check-output-queues))
(if (or lyskom-quit-flag quit-flag)
(signal 'quit nil))
......@@ -1208,6 +1208,7 @@ or get-text-stat."
(lyskom-really-serious-bug))
(let ((lyskom-multiple-blocking-return 'not-yet-gotten))
(setq lyskom-ok-to-send-new-calls t)
(lyskom-collect 'blocking)
(while call-list
(apply (intern-soft (concat "initiate-"
......@@ -1216,10 +1217,14 @@ or get-text-stat."
(cdr (car call-list)))
(setq call-list (cdr call-list)))
(lyskom-use 'blocking 'lyskom-blocking-do-multiple-1)
(while (and (eq lyskom-multiple-blocking-return 'not-yet-gotten)
(memq (process-status lyskom-proc) '(open run))
(not lyskom-quit-flag))
(lyskom-accept-process-output))
(unwind-protect
(while (and (eq lyskom-multiple-blocking-return 'not-yet-gotten)
(memq (process-status lyskom-proc) '(open run))
(not lyskom-quit-flag))
(lyskom-accept-process-output))
;; OK to continue with prefetch and stuff again
(setq lyskom-ok-to-send-new-calls t)
(lyskom-check-output-queues))
(if lyskom-quit-flag
(progn
(setq lyskom-quit-flag nil)
......@@ -1228,7 +1233,8 @@ or get-text-stat."
lyskom-multiple-blocking-return)))
(defun lyskom-blocking-do-multiple-1 (&rest data)
(setq lyskom-multiple-blocking-return data))
(setq lyskom-multiple-blocking-return data
lyskom-ok-to-send-new-calls nil))
......
......@@ -357,81 +357,93 @@ CONNECT %s:%d HTTP/1.0\r\n\
(lyskom-start-of-command 'kom-start-anew)
(lyskom-completing-clear-cache)
(let ((old-me lyskom-pers-no)
(new-me nil)
(login-successful nil))
(unwind-protect
(progn
(if lyskom-first-time-around
nil
(lyskom-tell-internat 'kom-tell-login))
(setq lyskom-pers-no nil)
(while (not lyskom-pers-no)
(if (and lyskom-first-time-around
lyskom-default-user-name)
;; This is nil if we can't find a unique match.
(setq lyskom-pers-no
(conf-z-info->conf-no
(lyskom-lookup-conf-by-name lyskom-default-user-name
'(pers)))))
(if lyskom-pers-no
nil
(let ((name (lyskom-read-conf-name
(lyskom-get-string 'what-is-your-name)
'(pers none) t "" t)))
(setq lyskom-pers-no
(or (conf-z-info->conf-no
(lyskom-lookup-conf-by-name name '(pers)))
(lyskom-create-new-person name)))))
;; Now lyskom-pers-no contains a number of a person.
;; Lets log him in.
(if lyskom-pers-no
(let ((conf-stat (blocking-do 'get-conf-stat lyskom-pers-no))
(lyskom-inhibit-minibuffer-messages t))
;; DEBUG
(if (null conf-stat)
(lyskom-insert "You don't exist. Go away.\n"))
(lyskom-insert (concat (conf-stat->name conf-stat) "\n"))
(setq lyskom-first-time-around nil)
(if (blocking-do 'login lyskom-pers-no
(if lyskom-default-password
(prog1
lyskom-default-password
(setq lyskom-default-password nil)
(set-default 'lyskom-default-password
nil))
;; Use password read when creating
;; the person when loggin in new
;; users
(or lyskom-is-new-user
(silent-read
(lyskom-get-string 'password)))))
(progn
(if lyskom-is-new-user
(blocking-do 'add-member
(server-info->conf-pres-conf lyskom-server-info)
lyskom-pers-no 100 1))
(setq login-successful t))
(lyskom-insert-string 'wrong-password)
(setq lyskom-pers-no nil))
(setq lyskom-is-new-user nil))))
;; Now we are logged in.
(lyskom-insert-string 'are-logged-in)
(if (not lyskom-dont-read-user-area)
(lyskom-read-options))
(lyskom-run-hook-with-args 'lyskom-change-conf-hook
lyskom-current-conf
0)
(setq lyskom-current-conf 0)
;; (cache-initiate-who-info-buffer (blocking-do 'who-is-on))
(cache-set-marked-texts (blocking-do 'get-marks))
;; What is this variable? It is never used. It is ust to
;; fill the cache?
(let ((lyskom-who-am-i (blocking-do 'who-am-i)))
(if lyskom-who-am-i (setq lyskom-session-no lyskom-who-am-i)))
;; We can't allow the prefetch to go on after the new user
;; is logged in, but to shut down the prefetch would be too
;; brutal, since the new login might be cancelled. To
;; prevent the blocking-do calls below from allowing
;; prefetch we set lyskom-inhibit-prefetch locally.
(let ((lyskom-inhibit-prefetch t))
(while (not new-me)
(if (and lyskom-first-time-around
lyskom-default-user-name)
;; This is nil if we can't find a unique match.
(setq new-me
(conf-z-info->conf-no
(lyskom-lookup-conf-by-name lyskom-default-user-name
'(pers)))))
(if new-me
nil
(let ((name (lyskom-read-conf-name
(lyskom-get-string 'what-is-your-name)
'(pers none) t "" t)))
(setq new-me
(or (conf-z-info->conf-no
(lyskom-lookup-conf-by-name name '(pers)))
(lyskom-create-new-person name)))))
;; Now new-me contains a number of a person.
;; Lets log him in.
(if new-me
(let ((conf-stat (blocking-do 'get-conf-stat new-me))
(lyskom-inhibit-minibuffer-messages t))
;; Previously this code used lyskom-pers-no
;; directly instead of new-me, but that caused
;; problem with asynchrounous code trying to
;; access it.
(setq lyskom-pers-no new-me)
;; DEBUG
(if (null conf-stat)
(lyskom-insert "You don't exist. Go away.\n"))
(lyskom-insert (concat (conf-stat->name conf-stat) "\n"))
(setq lyskom-first-time-around nil)
(if (blocking-do 'login new-me
(if lyskom-default-password
(prog1
lyskom-default-password
(setq lyskom-default-password nil)
(set-default 'lyskom-default-password
nil))
;; Use password read when creating
;; the person when loggin in new
;; users
(or lyskom-is-new-user
(silent-read
(lyskom-get-string 'password)))))
(progn
(if lyskom-is-new-user
(blocking-do 'add-member
(server-info->conf-pres-conf lyskom-server-info)
new-me 100 1))
(setq login-successful t))
(lyskom-insert-string 'wrong-password)
(setq new-me nil))
(setq lyskom-is-new-user nil))))
;; Now we are logged in.
(lyskom-insert-string 'are-logged-in)
(if (not lyskom-dont-read-user-area)
(lyskom-read-options))
(lyskom-run-hook-with-args 'lyskom-change-conf-hook
lyskom-current-conf
0)
(setq lyskom-current-conf 0)
;; (cache-initiate-who-info-buffer (blocking-do 'who-is-on))
(cache-set-marked-texts (blocking-do 'get-marks))
;; What is this variable? It is never used. It is ust to
;; fill the cache?
(let ((lyskom-who-am-i (blocking-do 'who-am-i)))
(if lyskom-who-am-i (setq lyskom-session-no lyskom-who-am-i))))
;; Start the prefetch
(lyskom-refetch))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment