[version 0.15.0 ediware**20071229180010] { hunk ./CHANGELOG 1 +Version 0.15.0 +2007-12-29 +Added support for CLISP (thanks to Anton Vodonosov) + hunk ./doc/index.html 24 + hunk ./doc/index.html 30 -

HUNCHENTOOT - The Common Lisp web server formerly known as TBNL

+

HUNCHENTOOT - The Common Lisp web server +formerly known as TBNL

hunk ./doc/index.html 74 -Lisp. (Note: You can use Hunchentoot with a version of SBCL -without threads, for example on Windows, but this is not recommended -except for development purposes.) Porting to other CL implementations -shouldn't be too hard, see the files port-xxx.lisp +Lisp. (Note: You can use Hunchentoot with CLISP +or with a version of SBCL without threads, for example on Windows, +but this is not recommended except for development purposes.) Porting to other +CL implementations shouldn't be too hard, see the files port-xxx.lisp hunk ./doc/index.html 150 -current version is 0.14.7. There's also a port +current version is 0.15.0. There's also a port hunk ./doc/index.html 320 +
  • Weblocks +by Slava Akhmechet is a "continuations-based web framework" which is +based on Hunchentoot. hunk ./doc/index.html 2619 -$Header: /usr/local/cvsrep/hunchentoot/doc/index.html,v 1.122 2007/11/15 07:29:58 edi Exp $ +$Header: /usr/local/cvsrep/hunchentoot/doc/index.html,v 1.126 2007/12/29 17:35:03 edi Exp $ hunk ./headers.lisp 2 -;;; $Header: /usr/local/cvsrep/hunchentoot/headers.lisp,v 1.24 2007/09/24 13:43:45 edi Exp $ +;;; $Header: /usr/local/cvsrep/hunchentoot/headers.lisp,v 1.25 2007/12/29 17:35:00 edi Exp $ hunk ./headers.lisp 242 + #+:clisp + (unless (stringp content) + (setf (flexi-stream-element-type *hunchentoot-stream*) 'octet)) hunk ./hunchentoot.asd 2 -;;; $Header: /usr/local/cvsrep/hunchentoot/hunchentoot.asd,v 1.52 2007/11/15 07:29:56 edi Exp $ +;;; $Header: /usr/local/cvsrep/hunchentoot/hunchentoot.asd,v 1.53 2007/12/29 17:35:01 edi Exp $ hunk ./hunchentoot.asd 37 -(defvar *hunchentoot-version* "0.14.7" +(defvar *hunchentoot-version* "0.15.0" hunk ./hunchentoot.asd 59 + #+:clisp (:file "port-clisp") hunk ./hunchentoot.asd 76 + #+(and :clisp :unix) (:file "unix-clisp") hunk ./misc.lisp 2 -;;; $Header: /usr/local/cvsrep/hunchentoot/misc.lisp,v 1.12 2007/11/15 07:29:56 edi Exp $ +;;; $Header: /usr/local/cvsrep/hunchentoot/misc.lisp,v 1.13 2007/12/29 17:35:01 edi Exp $ hunk ./misc.lisp 156 - :element-type '(unsigned-byte 8) + :element-type 'octet hunk ./misc.lisp 161 - (loop with buf = (make-array +buffer-length+ :element-type '(unsigned-byte 8)) + #+:clisp + (setf (flexi-stream-element-type *hunchentoot-stream*) 'octet) + (loop with buf = (make-array +buffer-length+ :element-type 'octet) addfile ./port-clisp.lisp hunk ./port-clisp.lisp 1 +;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: HUNCHENTOOT; Base: 10; -*- +;;; $Header: /usr/local/cvsrep/hunchentoot/port-clisp.lisp,v 1.1 2007/12/29 17:35:01 edi Exp $ + +;;; Copyright (c) 2006, Luis Olíveira . +;;; Copyright (c) 2007, Anton Vodonosov . +;;; Copyright (c) 2007, Dr. Edmund Weitz. +;;; All rights reserved. + +;;; Redistribution and use in source and binary forms, with or without +;;; modification, are permitted provided that the following conditions +;;; are met: + +;;; * Redistributions of source code must retain the above copyright +;;; notice, this list of conditions and the following disclaimer. + +;;; * Redistributions in binary form must reproduce the above +;;; copyright notice, this list of conditions and the following +;;; disclaimer in the documentation and/or other materials +;;; provided with the distribution. + +;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED +;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +;;; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +(in-package :hunchentoot) + +(defmacro with-lock ((lock) &body body) + "Executes the BODY. LOCK is ignored because CLISP doesn't support +threads." + (declare (ignore lock)) + `(progn ,@body)) + +(defmacro atomic-incf (place &optional (delta 1)) + "Expands to INCF. No special semantics because CLISP doesn't support threads." + `(incf ,place ,delta)) + +(defmacro with-timeout ((seconds &body timeout-forms) &body body) + "Executes the code BODY and returns the results of the last form. +SECONDS and TIMEOUT-FORMS are ignored since CLISP doesn't support +threads." + (declare (ignore seconds timeout-forms)) + `(progn ,@body)) + +(defun make-lock (lock) + "CLISP doesn't support threads, so the function just returns its +argument LOCK." + lock) + +(defvar *current-process* "*CURRENT-PROCESS*" + "CLISP doesn't support threads, so this value is just a dummy stub.") + +(defun process-run-function (name function &rest args) + "In a multithreaded environment, this would run FUNCTION in a new +thread, but in CLISP we just apply FUNCTION to ARGS." + (declare (ignore name)) + (apply function args)) + +(defun process-allow-scheduling () + "Does nothing because CLISP doesn't support threads." + ) + +(defun process-kill (process) + "Does nothing because CLISP doesn't support threads." + (declare (ignore process)) + ) + +(defun start-up-server (&key service address process-name announce function &allow-other-keys) + "Tries to \(partly) emulate LispWorks' COMM:START-UP-SERVER. See + +for more info." + (declare (ignore process-name)) + (cl:ignore-errors + (let ((socket (socket:socket-server service :interface address :backlog 5))) + (funcall announce socket) + (unwind-protect + (loop (funcall function + (socket:socket-accept socket + :buffered t + :element-type 'octet))) + (cl:ignore-errors + (socket:socket-server-close socket)))))) + +(defun make-socket-stream (socket read-timeout write-timeout) + "Accepts a socket `handle' HANDLE and creates and returns a +corresponding stream, setting its read and write timeout if +applicable. Returns three other values - the address the request +arrived at, and the address and port of the remote host." + (socket:socket-options socket + :SO-RCVTIMEO read-timeout + :SO-SNDTIMEO write-timeout) + (multiple-value-bind (remote-host remote-port) + (socket:socket-stream-peer socket) + (values socket + (nth-value 1 (socket:socket-stream-local socket)) + remote-host + remote-port))) + +;;; the following code is from swank-clisp.lisp (SLIME): + +(defun format-frame (frame) + "Returns a string describing the call stack frame object FRAME." + (string-trim #(#\Newline #\Space #\Tab) + (with-output-to-string (out) + (sys::describe-frame out frame)))) + +(defun function-frame-p (formatted-frame) + "Determines whether the frame described by FORMATTED-FRAME +is a function frame." + (char= #\< (aref formatted-frame 0))) + +(defun get-backtrace (error) + "This is the function that is used internally by Hunchentoot to +show or log backtraces." + (declare (ignore error)) + (with-output-to-string (stream) + (do ((last nil frame) + (frame (sys::the-frame) (sys::frame-up-1 frame 1))) + ((eq frame last)) + (let ((formatted-frame (format-frame frame))) + (when (function-frame-p formatted-frame) + (write-line (subseq formatted-frame (+ (position #\> formatted-frame) 2) + (position #\Newline formatted-frame)) + stream)))))) hunk ./port-cmu.lisp 2 -;;; $Header: /usr/local/cvsrep/hunchentoot/port-cmu.lisp,v 1.9 2007/01/01 23:50:30 edi Exp $ +;;; $Header: /usr/local/cvsrep/hunchentoot/port-cmu.lisp,v 1.10 2007/12/29 17:35:01 edi Exp $ hunk ./port-cmu.lisp 119 - :element-type '(unsigned-byte 8) + :element-type 'octet hunk ./port-lw.lisp 2 -;;; $Header: /usr/local/cvsrep/hunchentoot/port-lw.lisp,v 1.10 2007/11/03 21:46:18 edi Exp $ +;;; $Header: /usr/local/cvsrep/hunchentoot/port-lw.lisp,v 1.12 2007/12/29 17:35:01 edi Exp $ hunk ./port-lw.lisp 114 - #-:lispworks5.0 (declare (ignore write-timeout)) + #-:lispworks5 (declare (ignore write-timeout)) hunk ./port-lw.lisp 122 - #+:lispworks5.0 #+:lispworks5.0 + #+:lispworks5 #+:lispworks5 hunk ./port-lw.lisp 124 - :element-type '(unsigned-byte 8)) + :element-type 'octet) hunk ./port-sbcl.lisp 2 -;;; $Header: /usr/local/cvsrep/hunchentoot/port-sbcl.lisp,v 1.12 2007/09/13 08:35:15 edi Exp $ +;;; $Header: /usr/local/cvsrep/hunchentoot/port-sbcl.lisp,v 1.13 2007/12/29 17:35:01 edi Exp $ hunk ./port-sbcl.lisp 176 - :element-type '(unsigned-byte 8) + :element-type 'octet hunk ./request.lisp 2 -;;; $Header: /usr/local/cvsrep/hunchentoot/request.lisp,v 1.33 2007/09/14 12:12:33 edi Exp $ +;;; $Header: /usr/local/cvsrep/hunchentoot/request.lisp,v 1.34 2007/12/29 17:35:01 edi Exp $ hunk ./request.lisp 123 + #+:clisp (setf (flexi-stream-element-type content-stream) 'octet) hunk ./test/test.lisp 2 -;;; $Header: /usr/local/cvsrep/hunchentoot/test/test.lisp,v 1.20 2007/09/18 14:24:01 edi Exp $ +;;; $Header: /usr/local/cvsrep/hunchentoot/test/test.lisp,v 1.21 2007/12/29 17:35:05 edi Exp $ hunk ./test/test.lisp 98 - :element-type '(unsigned-byte 8)) + :element-type 'flex:octet) hunk ./test/test.lisp 100 - :element-type '(unsigned-byte 8)))) + :element-type 'flex:octet))) hunk ./test/test.lisp 222 - (flexi-streams:make-external-format charset :eol-style :lf)) + (flex:make-external-format charset :eol-style :lf)) hunk ./test/test.lisp 363 - (buffer (make-array 1024 :element-type '(unsigned-byte 8)))) + (buffer (make-array 1024 :element-type 'flex:octet))) + #+:clisp + (setf (flex:flexi-stream-element-type stream) 'flex:octet) hunk ./test/test.lisp 367 - :element-type '(unsigned-byte 8)) + :element-type 'flex:octet) hunk ./test/test.lisp 377 - :element-type '(unsigned-byte 8)) + :element-type 'flex:octet) hunk ./test/test.lisp 387 - :element-type '(unsigned-byte 8)) + :element-type 'flex:octet) addfile ./unix-clisp.lisp hunk ./unix-clisp.lisp 1 +;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: HUNCHENTOOT; Base: 10; -*- +;;; $Header: /usr/local/cvsrep/hunchentoot/unix-clisp.lisp,v 1.1 2007/12/29 17:35:01 edi Exp $ + +;;; Copyright (c) 2006, Luís Oliveira . +;;; Copyright (c) 2007, Anton Vodonosov . +;;; Copyright (c) 2007, Dr. Edmund Weitz. +;;; All rights reserved. + +;;; Redistribution and use in source and binary forms, with or without +;;; modification, are permitted provided that the following conditions +;;; are met: + +;;; * Redistributions of source code must retain the above copyright +;;; notice, this list of conditions and the following disclaimer. + +;;; * Redistributions in binary form must reproduce the above +;;; copyright notice, this list of conditions and the following +;;; disclaimer in the documentation and/or other materials +;;; provided with the distribution. + +;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED +;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +;;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +;;; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +;;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +;;; GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +;;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +(in-package :hunchentoot) + +(defun setuid (uid) + "Sets the effective user ID of the current process to UID - see +setuid\(2)." + (setf (posix:getuid) uid)) + +(defun setgid (gid) + "Sets the effective group ID of the current process to GID - +see setgid\(2)." + (setf (posix:getgid) gid)) + +(defun get-uid-from-name (name) + "Returns the UID for the user named NAME." + (posix:user-info-uid (posix:user-info name))) + +(defun get-gid-from-name (name) + "Returns the GID for the group named NAME." + (posix:user-info-gid (posix:user-info name))) hunk ./util.lisp 2 -;;; $Header: /usr/local/cvsrep/hunchentoot/util.lisp,v 1.32 2007/11/08 20:07:58 edi Exp $ +;;; $Header: /usr/local/cvsrep/hunchentoot/util.lisp,v 1.33 2007/12/29 17:35:02 edi Exp $ hunk ./util.lisp 257 - :element-type '(unsigned-byte 8) + :element-type 'octet }