Rename misleading {SET,GET}-SURFLET-DATA to {SET,GET}-SESSION-DATA, as the data is specific to a session and not to a surflet.
This commit is contained in:
parent
cacf6aeaa8
commit
3f1542466c
|
@ -73,8 +73,8 @@
|
|||
send/finish ;send and finish
|
||||
send ;just send (no finish, no suspend)
|
||||
send-error ;send error response
|
||||
set-surflet-data!
|
||||
get-surflet-data
|
||||
set-session-data!
|
||||
get-session-data
|
||||
adjust-timeout ;adjusts timeout of current session
|
||||
;Without `!' because PLT
|
||||
;doesn't have it.
|
||||
|
@ -191,8 +191,8 @@
|
|||
(case-returned-via :syntax)
|
||||
make-callback
|
||||
|
||||
set-surflet-data!
|
||||
get-surflet-data))
|
||||
set-session-data!
|
||||
get-session-data))
|
||||
|
||||
(define-structure surflets surflets-interface
|
||||
(open surflet-handler/surflets
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
(make-integer-table) ; continuation table
|
||||
(make-lock) ; continuation table lock
|
||||
(make-thread-safe-counter) ; continuation counter
|
||||
#f)) ; surflet-data
|
||||
#f)) ; session-data
|
||||
(release-lock *session-table-lock*)
|
||||
(register-instance! session-id)
|
||||
|
||||
|
@ -406,21 +406,21 @@
|
|||
(table-set! continuation-table continuation-id #f)))
|
||||
(release-lock continuation-table-lock)))))
|
||||
|
||||
;;; SET-SURFLET-DATA!, GET-SURFLET-DATA
|
||||
;;; SET-SESSION-DATA!, GET-SESSION-DATA
|
||||
;; Access to arbitrary data stored along with current session (no
|
||||
;; locking!).
|
||||
(define (set-surflet-data! new-data)
|
||||
(define (set-session-data! new-data)
|
||||
(let ((session (session-lookup (instance-session-id))))
|
||||
(if session
|
||||
(begin
|
||||
(set-session-surflet-data! session new-data)
|
||||
(set-session-session-data! session new-data)
|
||||
#t)
|
||||
#f)))
|
||||
|
||||
(define (get-surflet-data)
|
||||
(define (get-session-data)
|
||||
(let ((session (session-lookup (instance-session-id))))
|
||||
(if session
|
||||
(session-surflet-data session)
|
||||
(session-session-data session)
|
||||
(error "Instance no longer alive."))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
@ -598,14 +598,14 @@
|
|||
(make-session surflet-name memo
|
||||
continuation-table continuation-table-lock
|
||||
continuation-counter
|
||||
surflet-data)
|
||||
session-data)
|
||||
session?
|
||||
(surflet-name session-surflet-name)
|
||||
(memo session-memo set-session-memo!)
|
||||
(continuation-table session-continuation-table)
|
||||
(continuation-table-lock session-continuation-table-lock)
|
||||
(continuation-counter session-continuation-counter)
|
||||
(surflet-data session-surflet-data set-session-surflet-data!))
|
||||
(session-data session-session-data set-session-session-data!))
|
||||
|
||||
;;; MEMO: Information for session surveiller about session status
|
||||
(define-record-type memo :memo
|
||||
|
|
|
@ -27,11 +27,11 @@
|
|||
(counter state:counter set-state:counter!))
|
||||
|
||||
(define (state-file-name)
|
||||
(state:file-name (get-surflet-data)))
|
||||
(state:file-name (get-session-data)))
|
||||
(define (state-file-names-to-delete)
|
||||
(state:file-names-to-delete (get-surflet-data)))
|
||||
(state:file-names-to-delete (get-session-data)))
|
||||
(define (state-counter)
|
||||
(state:counter (get-surflet-data)))
|
||||
(state:counter (get-session-data)))
|
||||
|
||||
;; Leave this global. Servers are running on a single system.
|
||||
(define gnuplot #f) ;; Set in main.
|
||||
|
@ -151,7 +151,7 @@
|
|||
(file-executable? file-name)))
|
||||
|
||||
(define (new-profile req)
|
||||
(let ((state (get-surflet-data)))
|
||||
(let ((state (get-session-data)))
|
||||
(format #t "profiling...~%")
|
||||
(obtain-lock lock)
|
||||
(profile-space (state:file-name state))
|
||||
|
@ -262,7 +262,7 @@ plot '~a' title 'SUrflet Profiling ~a' with lines"
|
|||
(profile req "Profiling state reseted."))
|
||||
|
||||
(define (add-file-name-to-delete! file-name)
|
||||
(let ((state (get-surflet-data)))
|
||||
(let ((state (get-session-data)))
|
||||
(set-state:file-names-to-delete!
|
||||
state
|
||||
(cons file-name
|
||||
|
@ -274,7 +274,7 @@ plot '~a' title 'SUrflet Profiling ~a' with lines"
|
|||
(for-each delete-filesys-object file-names-to-delete))))
|
||||
|
||||
(define (reset-profiling-state!)
|
||||
(let ((state (get-surflet-data)))
|
||||
(let ((state (get-session-data)))
|
||||
(set-state:counter! state 0)
|
||||
(delete-files state)
|
||||
(set-state:file-name! state
|
||||
|
@ -285,7 +285,7 @@ plot '~a' title 'SUrflet Profiling ~a' with lines"
|
|||
(define (reset-and-return-to-main-page req)
|
||||
;; Overhead included :-|
|
||||
(reset-profiling-state!)
|
||||
(delete-files (get-surflet-data))
|
||||
(delete-files (get-session-data))
|
||||
(return-to-main-page req))
|
||||
|
||||
(define (return-to-main-page req)
|
||||
|
@ -304,10 +304,10 @@ plot '~a' title 'SUrflet Profiling ~a' with lines"
|
|||
(if (string=? convert "")
|
||||
(set! use-convert? #f)
|
||||
(set! use-convert? #t))))
|
||||
(set-surflet-data! (make-state #f #f 0))
|
||||
(set-session-data! (make-state #f #f 0))
|
||||
(reset-profiling-state!)
|
||||
;; Remove state files if user did not do it.
|
||||
(add-finalizer! (get-surflet-data) delete-files)
|
||||
(add-finalizer! (get-session-data) delete-files)
|
||||
(profile req))
|
||||
|
||||
(define (search-executable exec-name)
|
||||
|
|
Loading…
Reference in New Issue