From 911c56e66809529bd6cc3dc29a32223c707e0b81 Mon Sep 17 00:00:00 2001 From: interp Date: Wed, 18 Sep 2002 15:32:41 +0000 Subject: [PATCH] change to srfi-27 for random bits --- scheme/httpd/surflets/packages.scm | 25 ++++++++++++----------- scheme/httpd/surflets/surflet-handler.scm | 17 +++++++-------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/scheme/httpd/surflets/packages.scm b/scheme/httpd/surflets/packages.scm index 1992df6..0c1a21d 100644 --- a/scheme/httpd/surflets/packages.scm +++ b/scheme/httpd/surflets/packages.scm @@ -71,20 +71,20 @@ (plugin-utilities plugin-utilities-interface)) (open httpd-responses httpd-request - uri - tables ;hash-tables - define-record-types + uri ;URI-PATH-LIST->PATH + tables ;HASH-TABLES + define-record-types ;DEFINE-RECORD-TYPE rt-module-language ;get structures dynamically - srfi-13 +; srfi-13 ;string srfi-14 ;CHAR-SET:DIGIT - handle-fatal-error - random ;not quite random - locks - thread-cells - profiling - httpd-logging - shift-reset - scsh + handle-fatal-error ;WITH-FATAL-ERROR-HANDLER* et al. + srfi-27 ;random numbers + locks ;MAKE-LOCK et al. + thread-cells ;THREAD-CELL et al. + profiling ;PROFILE-SPACE + httpd-logging ;HTTP-SYSLOG + shift-reset ;SHIFT and RESET + scsh ;regexp et al. scheme ) (files servlet-handler)) @@ -149,6 +149,7 @@ spatial srfi-13 srfi-1 + locks scsh scheme) (files profile)) \ No newline at end of file diff --git a/scheme/httpd/surflets/surflet-handler.scm b/scheme/httpd/surflets/surflet-handler.scm index d7699db..089e4ea 100644 --- a/scheme/httpd/surflets/surflet-handler.scm +++ b/scheme/httpd/surflets/surflet-handler.scm @@ -2,14 +2,6 @@ ;; Copyright Andreas Bernauer, 2002 -;(define-record-type continuation-table-entry :continuation-table-entry -; (make-continuation-table-entry continuation) -; continuation-table-entry? -; (id continuation-table-entry-id set-continuation-table-entry-id!) -; (continuation continuation-table-entry-continuation -; set-continuation-table-entry-continuation!)) - - ;;; instance-table: entry for every new request on a servlet page (define-record-type instance :instance (make-instance servlet-name continuation-table) @@ -29,8 +21,13 @@ ;; FIXME: Make this thread-safe (define *instance-table* (make-integer-table)) ; instance-id is index -(define random (make-random (modulo (time)268435455))) ; not really random - ; generator +(define random + (let* ((source (make-random-source)) + (random-integer (begin + (random-source-randomize! source) + (random-source-make-integers source)))) + (lambda () + (random-integer 1073741824)))) ; I hope, 1+ billion is enough.... (define (servlet-handler servlet-path) (lambda (path req)