From 909ed39ce2fde9d91c9c8b33d8fc06ca8310f68c Mon Sep 17 00:00:00 2001 From: interp Date: Mon, 10 Mar 2003 12:57:44 +0000 Subject: [PATCH] Add optional arguments to ADJUST-TIMEOUT! and SESSION-ADJUST-TIMEOUT! This argument defaults to OPTIONS-SESSION-LIFETIME and represents the life-time in seconds for the session. --- scheme/httpd/surflets/packages.scm | 1 + scheme/httpd/surflets/surflet-handler.scm | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/scheme/httpd/surflets/packages.scm b/scheme/httpd/surflets/packages.scm index 30a43bb..750f064 100644 --- a/scheme/httpd/surflets/packages.scm +++ b/scheme/httpd/surflets/packages.scm @@ -244,6 +244,7 @@ httpd-logging ;HTTP-SYSLOG httpd-requests ;requests from httpd httpd-responses ;replies for httpd + let-opt ;:OPTIONAL locks ;MAKE-LOCK et al. profiling ;PROFILE-SPACE rt-module-language ;get structures dynamically diff --git a/scheme/httpd/surflets/surflet-handler.scm b/scheme/httpd/surflets/surflet-handler.scm index 84fd47a..021c08c 100644 --- a/scheme/httpd/surflets/surflet-handler.scm +++ b/scheme/httpd/surflets/surflet-handler.scm @@ -323,7 +323,12 @@ ;;; SESSION-ADJUST-TIMEOUT! ;; Resets time-to-die of session indicated by its SESSION-ID number. -(define (session-adjust-timeout! session-id) +(define (session-adjust-timeout! session-id . maybe-time-to-live) + (really-session-adjust-timeout! + session-id + (:optional maybe-time-to-live (options-session-lifetime)))) + +(define (really-session-adjust-timeout! session-id time-to-live) (obtain-lock *session-table-lock*) (let* ((session (table-ref *session-table* session-id)) (memo (session-memo session)) @@ -339,9 +344,13 @@ (release-lock *session-table-lock*)) ;;; ADJUST-TIMEOUT! -;; Resets time-to-die of current session. -(define (adjust-timeout!) - (session-adjust-timeout! (instance-session-id))) +;; Resets time-to-die of current session. The argument must be +;; optional as PLT does not have it. +(define (adjust-timeout! . maybe-time-to-live) + (really-session-adjust-timeout! + (instance-session-id) + (:optional maybe-time-to-live + (options-session-lifetime)))) ;;; RESET-SESSION-TABLE! ;; Clears the *SESSION-TABLE* (locking)