Revision: 4438
Author: hans
URL: http://bknr.net/trac/changeset/4438
Patch by Peter Seibel, his words:
I think the actual problem I had was some code that did essentially:
(with-foo-output ((send-headers))
(expand-template-file))
where expand-template-file calls code that uses post-parameters to get
at, well, post parameters. It's not clear how to easily turn that code
inside out so all the parameters are gathered in advance of calling
send-headers.
U trunk/thirdparty/hunchentoot/request.lisp
Modified: trunk/thirdparty/hunchentoot/request.lisp
===================================================================
--- trunk/thirdparty/hunchentoot/request.lisp 2009-07-11 22:16:55 UTC (rev 4437)
+++ trunk/thirdparty/hunchentoot/request.lisp 2009-07-22 16:29:00 UTC (rev 4438)
@@ -352,7 +352,12 @@
(get-parameters request))
(defmethod post-parameters :before ((request request))
- (maybe-read-post-parameters :request request))
+ ;; Force here because if someone calls POST-PARAMETERS they actually
+ ;; want them, regardless of why the RAW-POST-DATA has been filled
+ ;; in. (For instance, if SEND-HEADERS has been called, filling in
+ ;; RAW-POST-DATA, and then subsequent code calls POST-PARAMETERS,
+ ;; without the :FORCE flag POST-PARAMETERS would return NIL.)
+ (maybe-read-post-parameters :request request :force t))
(defun post-parameters* (&optional (request *request*))
"Returns an alist of the POST parameters associated with the REQUEST
Revision: 4435
Author: hans
URL: http://bknr.net/trac/changeset/4435
Remote debugging.
U trunk/thirdparty/hunchentoot/taskmaster.lisp
Modified: trunk/thirdparty/hunchentoot/taskmaster.lisp
===================================================================
--- trunk/thirdparty/hunchentoot/taskmaster.lisp 2009-07-06 11:26:02 UTC (rev 4434)
+++ trunk/thirdparty/hunchentoot/taskmaster.lisp 2009-07-06 12:02:30 UTC (rev 4435)
@@ -132,14 +132,14 @@
;; worker thread. One such problem exists in
;; GET-PEER-ADDRESS-AND-PORT which can signal socket conditions on
;; some platforms in certain situations.
- ;; Need to bind *ACCEPTOR* so that LOG-MESSAGE can do its work.
- (let ((*acceptor* (taskmaster-acceptor taskmaster)))
- (handler-case
- (bt:make-thread (lambda ()
- (process-connection *acceptor* socket))
- :name (format nil "Hunchentoot worker \(client: ~A)" (client-as-string socket)))
+ (handler-case
+ (bt:make-thread (lambda ()
+ (process-connection (taskmaster-acceptor taskmaster) socket))
+ :name (format nil "Hunchentoot worker \(client: ~A)" (client-as-string socket)))
- (error (cond)
+ (error (cond)
+ ;; Need to bind *ACCEPTOR* so that LOG-MESSAGE can do its work.
+ (let ((*acceptor* (taskmaster-acceptor taskmaster)))
(log-message *lisp-errors-log-level*
"Error while creating worker thread for new incoming connection: ~A" cond)))))
Revision: 4431
Author: hans
URL: http://bknr.net/trac/changeset/4431
Add directory for the Planet Lisp autotwitter application.
A trunk/projects/planetwit/
Revision: 4430
Author: hans
URL: http://bknr.net/trac/changeset/4430
Move the HANDLER-CASE to the right place in the code, ugh.
U trunk/thirdparty/hunchentoot/taskmaster.lisp
Modified: trunk/thirdparty/hunchentoot/taskmaster.lisp
===================================================================
--- trunk/thirdparty/hunchentoot/taskmaster.lisp 2009-07-06 08:47:23 UTC (rev 4429)
+++ trunk/thirdparty/hunchentoot/taskmaster.lisp 2009-07-06 09:17:00 UTC (rev 4430)
@@ -127,9 +127,19 @@
#-:lispworks
(defmethod handle-incoming-connection ((taskmaster one-thread-per-connection-taskmaster) socket)
- (bt:make-thread (lambda ()
- (process-connection (taskmaster-acceptor taskmaster) socket))
- :name (format nil "Hunchentoot worker \(client: ~A)" (client-as-string socket))))
+ ;; We are handling all conditions here as we want to make sure that
+ ;; the acceptor process never crashes while trying to create a
+ ;; worker thread. One such problem exists in
+ ;; GET-PEER-ADDRESS-AND-PORT which can signal socket conditions on
+ ;; some platforms in certain situations.
+ (handler-case
+ (bt:make-thread (lambda ()
+ (process-connection (taskmaster-acceptor taskmaster) socket))
+ :name (format nil "Hunchentoot worker \(client: ~A)" (client-as-string socket)))
+
+ (error (cond)
+ (log-message *lisp-errors-log-level*
+ "Error while creating worker thread for new incoming connection: ~A" cond))))
;; LispWorks implementation
@@ -153,17 +163,8 @@
(zerop (mod *worker-counter* *cleanup-interval*)))
(when *cleanup-function*
(funcall *cleanup-function*)))
- ;; We are handling all conditions here as we want to make sure that
- ;; the acceptor process never crashes while trying to create a
- ;; worker thread. One such problem exists in
- ;; GET-PEER-ADDRESS-AND-PORT which can signal socket conditions on
- ;; some platforms in certain situations.
- (handler-case
- (mp:process-run-function (format nil "Hunchentoot worker \(client: ~{~A:~A~})"
- (multiple-value-list
- (get-peer-address-and-port handle)))
- nil #'process-connection
- (taskmaster-acceptor taskmaster) handle)
- (error (cond)
- (log-message *lisp-errors-log-level*
- "Error while creating worker thread for new incoming connection: ~A" cond))))
+ (mp:process-run-function (format nil "Hunchentoot worker \(client: ~{~A:~A~})"
+ (multiple-value-list
+ (get-peer-address-and-port handle)))
+ nil #'process-connection
+ (taskmaster-acceptor taskmaster) handle))
Revision: 4429
Author: hans
URL: http://bknr.net/trac/changeset/4429
Add a comment to the HANDLER-CASE form previously added.
U trunk/thirdparty/hunchentoot/taskmaster.lisp
Modified: trunk/thirdparty/hunchentoot/taskmaster.lisp
===================================================================
--- trunk/thirdparty/hunchentoot/taskmaster.lisp 2009-07-06 08:30:39 UTC (rev 4428)
+++ trunk/thirdparty/hunchentoot/taskmaster.lisp 2009-07-06 08:47:23 UTC (rev 4429)
@@ -153,6 +153,11 @@
(zerop (mod *worker-counter* *cleanup-interval*)))
(when *cleanup-function*
(funcall *cleanup-function*)))
+ ;; We are handling all conditions here as we want to make sure that
+ ;; the acceptor process never crashes while trying to create a
+ ;; worker thread. One such problem exists in
+ ;; GET-PEER-ADDRESS-AND-PORT which can signal socket conditions on
+ ;; some platforms in certain situations.
(handler-case
(mp:process-run-function (format nil "Hunchentoot worker \(client: ~{~A:~A~})"
(multiple-value-list