From ndj at hivsa.com Wed Dec 12 11:34:14 2007 From: ndj at hivsa.com (Nico de Jager) Date: Wed, 12 Dec 2007 13:34:14 +0200 Subject: [drakma-devel] CHUNGA:INPUT-CHUNKING-UNEXPECTED-END-OF-FILE Message-ID: <87ir346tah.fsf@davinci.hivsa.com> Hi I have a fingerprint scanning application, that uploads fingerprint images using Drakma to a Hunchentoot server. Everything works great as long as I don't use a secure connection. With https, I get a CHUNGA:INPUT-CHUNKING-UNEXPECTED-END-OF-FILE condition on the server, and "Timeout while writing 8192 bytes to #" on the client. Sometimes the uploads are successful with https, though. The server runs LispWorks 5.0.2 on Debian Etch. The client runs on LispWorks 5.0.2 on Windows XP SP2. Part of the application pulls in the trivial-ldap module which depends on cl+ssl - not sure if this can be an issue as cl+ssl is not needed on LispWorks for Drakma and Hunchentoot. I am sure I am doing something stupid. The handler that does the actual upload on the client (which also uses Hunchentoot) is: (define-easy-handler (upload-fp-image.action :uri "/hunchentoot/patient-study-db/upload-fp-image.action") () (let ((cookie-jar (make-instance 'drakma:cookie-jar :cookies (list (make-instance 'drakma:cookie :name (session-value :hs-name) :value (session-value :hs-id) :path (session-value :hs-path) :domain (session-value :hs-domain)))))) (handler-case (let ((html-result (drakma:http-request (session-value :upload-url) :method :post :parameters (list (cons "finger" (session-value :finger)) (cons "img-file" (pathname *scanned-file*)) (cons "hs-id" (session-value :hs-id))) :user-agent (session-value :user-agent) :cookie-jar cookie-jar))) (delete-file *scanned-file*) (with-html-output-to-string (*standard-output*) (str html-result))) (condition (con) (delete-file *scanned-file*) (show-condition-html con (session-value :back-caption) (session-value :back-url)))))) The Hunchentoot server log spits out: [2007-12-12 11:35:39 [ERROR]] While parsing multipart/form-data parameters: The condition # occurred [2007-12-12 11:35:39] 10.38.1.45 - "POST /hunchentoot/patient-study-db/identify-patient.action HTTP/1.1" 200 1058 "-" "Opera/9.10 (Windows NT 5.1; U; en)" [2007-12-12 11:35:39 [ERROR]] Error while processing connection: Not all chunks from # have been read completely. Backtraces on the server and client are included below. Thanks. Nico Backtrace on server: Error: The condition # occurred 1 (abort) Quit process. Type :b for backtrace, :c