(serve-selector (if (= (string-length selector) 0)
"/"
selector)
- remote-ip config)))
+ config)))
(print "... served selector '" selector "'. Closing connection."))
(o (exn)
(print-error-message o out-port)
;;; Selector retrieval
-(define (serve-selector raw-selector remote-ip config)
+(define (serve-selector raw-selector config)
(let* ((selector-list (string-split raw-selector "\t"))
(selector (car selector-list))
(arguments (cdr selector-list)))
(case (infer-selector-type selector)
((1) (serve-directory selector config))
((0) (serve-text-file selector config))
- ((7) (serve-query selector arguments remote-ip config))
+ ((7) (serve-query selector arguments config))
(else (serve-binary-file selector config)))))
(define (serve-directory selector config)
(loop (read-byte)))))))
(error "File not found." file-name))))
-(define (serve-query selector arguments remote-ip config)
+(define (serve-query selector arguments config)
(let ((file-name (make-pathname (config-root-dir config) selector)))
(if (and (regular-file? file-name)
(= (length arguments) 1))
(with-selector-dir
selector config
(lambda ()
- (apply (eval (read))
- (list (car arguments) remote-ip)))))))
+ (apply (eval (read)) arguments))))))
(error "Invalid query." selector arguments))))