From b12070e3498b53063532615e7aae004dbf625f04 Mon Sep 17 00:00:00 2001 From: interp Date: Sun, 9 Mar 2003 19:44:09 +0000 Subject: [PATCH] Add MY-SESSION-ID, MY-CONTINUATION-ID and MY-IDS to surflets, that return the respective IDs out from an request object. There are restrictions on their use. --- scheme/httpd/surflets/packages.scm | 8 +++++++- scheme/httpd/surflets/surflets.scm | 19 +++++++++++++++++++ .../root/surflets/admin-surflets.scm | 6 ++---- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/scheme/httpd/surflets/packages.scm b/scheme/httpd/surflets/packages.scm index 369a354..0e0103a 100644 --- a/scheme/httpd/surflets/packages.scm +++ b/scheme/httpd/surflets/packages.scm @@ -60,6 +60,7 @@ get-continuations delete-continuation! + instance-session-id resume-url? @@ -115,7 +116,11 @@ (case-returned-via :syntax) - make-callback))) + make-callback + + my-session-id + my-continuation-id + my-ids))) ;; THE interface that SUrflets use. (define-interface surflet-interface @@ -257,6 +262,7 @@ (define-structure surflets surflets-interface (open surflet-handler/surflets surflet-handler/responses + surflet-handler/admin httpd-responses ; STATUS-CODE surflet-requests ; HTTP-URL:SEARCH url ; REQUEST:URL diff --git a/scheme/httpd/surflets/surflets.scm b/scheme/httpd/surflets/surflets.scm index 3a5c37d..0a50a80 100644 --- a/scheme/httpd/surflets/surflets.scm +++ b/scheme/httpd/surflets/surflets.scm @@ -692,6 +692,25 @@ ;; values or string values as well. So let us have both names. (define returned-via? returned-via) +(define (surflet-file-name req) + (last (http-url-path (surflet-request-url req)))) + +;; This works for all requests except for the initial one. For the +;; initial one (main's arg) think about using instance-session-id. +(define (my-session-id req) + (resume-url-session-id (surflet-file-name req))) + +;; This works for all requests except for the initial one: we don't +;; have a continuation at this time. +(define (my-continuation-id req) + (resume-url-continuation-id (surflet-file-name req))) + +;; Returns two values: session-id and continuation-id. The +;; restrictions from my-session-id and my-continuation-id apply here +;; as well. +(define (my-ids req) + (resume-url-ids (surflet-file-name req))) + ;; This is from Martin Gasbichler (define-syntax case-returned-via (syntax-rules (else =>) diff --git a/scheme/httpd/surflets/web-server/root/surflets/admin-surflets.scm b/scheme/httpd/surflets/web-server/root/surflets/admin-surflets.scm index 7635c34..a761742 100644 --- a/scheme/httpd/surflets/web-server/root/surflets/admin-surflets.scm +++ b/scheme/httpd/surflets/web-server/root/surflets/admin-surflets.scm @@ -151,8 +151,7 @@ (let* ((update-text (:optional maybe-update-text "")) (current-sessions (sort-list! (get-sessions) session-surflet-name