Still working on best way to serve active selectors.
authorTim Vaughan <tgvaughan@gmail.com>
Mon, 27 May 2019 22:38:52 +0000 (00:38 +0200)
committerTim Vaughan <tgvaughan@gmail.com>
Mon, 27 May 2019 22:38:52 +0000 (00:38 +0200)
burrower.scm

index 36820ea..b7b2754 100644 (file)
 (define (serve-directory-script selector arguments config)
   (let ((filename (make-pathname (config-root-dir config) selector)))
     (if (legal-script-filename? filename config)
-        (let ((sexp (with-input-from-file filename read)))
-          (serve-records (with-selector-dir selector config
-                                            (lambda ()
-                                              (apply (eval sexp) arguments)))
-                         selector config)
+        (let* ((sexp (with-input-from-file filename read))
+               (selector-dir (pathname-directory selector)))
+          (serve-records (with-selector-dir
+                          selector config
+                          (lambda ()
+                            (apply (eval sexp) arguments)))
+                         selector-dir config)
          (print ".\r"))
         (error "No legal index script not found." filename))))
 
                     (config-port-set! config (string->number (caddr args))))
                 (run-server config)))))))
 
-(main)
+;; (main)
 
-;; (define (test)
-;;   (run-server (make-config "gopher-root" "localhost" 70 #t)))
+(define (test)
+  (run-server (make-config "gopher-root" "localhost" 70 #t)))
 
-;; (test)
+(test)