From 89ac090253571f870a5afd45559d7aa28ba1b152 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Sat, 5 Jul 2003 00:59:49 +0000 Subject: [PATCH] r5235: *** empty log message *** --- debian/rules | 2 +- demo.lisp | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 demo.lisp diff --git a/debian/rules b/debian/rules index bd42b37..14b38fa 100755 --- a/debian/rules +++ b/debian/rules @@ -63,7 +63,7 @@ binary-arch: build install # dh_installman # dh_installinfo # dh_undocumented - dh_installchangelogs Changelog + dh_installchangelogs dh_strip dh_compress dh_fixperms diff --git a/demo.lisp b/demo.lisp new file mode 100644 index 0000000..87c0aac --- /dev/null +++ b/demo.lisp @@ -0,0 +1,67 @@ +;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10; Package: modlisp -*- +;;;; ************************************************************************* +;;;; FILE IDENTIFICATION +;;;; +;;;; Name: demo.lisp +;;;; Purpose: Demonstration command processor +;;;; Programmer: Kevin M. Rosenberg +;;;; Date Started: Dec 2002 +;;;; +;;;; $Id: demo.lisp,v 1.1 2003/07/05 00:59:49 kevin Exp $ +;;;; ************************************************************************* + +(in-package #:modlisp) + + +(defun demo-apache-command-processor (command) + "Sample function to process an apache command" + (let ((url (header-value command "url"))) + (cond + ((equal url "/fixed.lsp") + (output-html-page (fixed-html-string))) + ((equal url "/precompute.lsp") + (with-ml-page (:precompute t) + (write-precomputed-page))) + (t + (with-ml-page (:precompute nil) + (write-debug-table command)))))) + +(defun write-debug-table (command) + (write-string " + + +

mod_lisp debug page

" *apache-socket*) + (write-request-counts *apache-socket*) + (write-string " + +" *apache-socket*) + (loop for (key . value) in command do + (format *apache-socket* "" key value)) + (write-string "
KeyValue
~a~a
" *apache-socket*)) + + +(defun fixed-html-string () + (with-output-to-string (s) + (write-string + " +

mod_lisp fixed page

+

This is a fixed string sent by mod_lisp

" s) + (write-request-counts s) + (write-string "" s))) + +(defun write-precomputed-page () + (write-string + " +

mod_lisp precomputed page

+

This is a precomputed string sent by mod_lisp

" *apache-socket*) + (write-request-counts *apache-socket*) + (write-string "" *apache-socket*)) + +(defun write-request-counts (s) + (format s "

Number of server requests: ~D

" + (get-number-server-requests)) + (format s "

Number of worker requests for this socket: ~D

" + (get-number-worker-requests))) + + + -- 2.34.1