[tbnl-devel] Fixing binary uploads in SBCL / TBNL / mod_lisp2

Travis Cross travis at crosswirecorp.com
Thu Nov 3 17:13:41 UTC 2005


Running SBCL 0.9.6 with TBNL 0.8.4 and Apache 2.0.54 with mod_lisp2, the
image download examples work as expected, but uploading any binary file
results in a 500 Internal Server Error being throw by Apache.  No error
is reported in Lisp, but the Apache log file error_log shows the
following entry:

[error] (70014)End of file found: error reading from Lisp

Setting apache to log in debug mode doesn't provide any additional
insight, but some testing and modification of the mod_lisp2.c code
showed that the error is starting at line 588 where mod_lisp attempts to
read the first of the headers.  This leads back to read_lisp_line(),
then deeper to fill_input_buffer(), where the failure seems to originate
at the call to:

  RELAY_ERROR
    (((length = (sizeof (buffer->data))),
      (apr_recv (socket, (buffer->data), (&length)))));

With *DEBUG-MODE* set to t, *COMMAND* contains seemingly plausible
headers (shown below).

I am not familiar enough with the internals to have much of an idea of
what is causing the breakdown, though the C code seems to suggest that
lisp is sending a different amount of data than is promised.

I'm happy to dig into either the TBNL, KMRCL, or mod_lisp2.c code and
come up with a patch for this, but it would be tremendously helpful if
someone has a good idea of where to start and what the problem might be.

Cheers,

-- Travis

*COMMAND* after failed file upload:

(("content-stream" . #<SB-SYS:FD-STREAM for "a constant string" {9CEF2D9}>)
 ("server-protocol" . "HTTP/1.1") ("method" . "POST")
 ("url" . "/tbnl/test/upload.html")
 ("content-type"
  . "multipart/form-data;
boundary=---------------------------130786897319483305451172113725")
 ("content-length" . "281039") ("server-ip-addr" . "127.0.0.1")
 ("server-ip-port" . "80") ("remote-ip-addr" . "127.0.0.1")
 ("script-filename" . "/usr/htdocs") ("remote-ip-port" . "48073")
 ("server-id" . "tbnl") ("server-baseversion" . "Apache/2.0.54")
 ("modlisp-version" . "1.2") ("modlisp-major-version" . "2")
 ("Host" . "localhost")
 ("User-Agent"
  . "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050829
Firefox/1.0.6")
 ("Accept"
  .
"text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5")
 ("Accept-Language" . "en-us,en;q=0.5") ("Accept-Encoding" . "gzip,deflate")
 ("Accept-Charset" . "ISO-8859-1,utf-8;q=0.7,*;q=0.7") ("Keep-Alive" .
"300")
 ("Connection" . "keep-alive")
 ("Referer" . "http://localhost/tbnl/test/upload.html")
 ("Cookie" . "pumpkin=barking") ("Authorization" . "Basic bmFub29rOmlnbG9v")
 ("Content-Type"
  . "multipart/form-data;
boundary=---------------------------130786897319483305451172113725")
 ("Content-Length" . "281039"))




More information about the Tbnl-devel mailing list