Large Uploads Through mod_lisp Sometimes Failing
Hi Marc,
Hi All,
I have been using mod_lisp for several years and I am very happy with
it.
Thanks Marc, for writing, publishing and maintaining it - I known
from experience that doing this takes a lot of effort!
My KPAX Common Lisp Web Application Framework works with three front-
ends:
either mod_lisp, portableaserve and my own s-http-server.
This week we were adding some functionality to one of our web
applications that required uploading files using a multipart form
encoded data POST request. We did this before in several situations
and also this time things worked as expected.
However, there seems to be a problem when uploading large (multi-
megabyte files): this fails almost consistently.
The culprit seems to be that read-sequence, trying to read the body
string from the mod_lisp connection in one go, fails to read
everything at once (returning less than the buffer length). Normally,
one would then loop and try again with an offset (:start), although I
never had to do this in the past (so I assume that the read-sequence
implementation handles some if not most of the buffering/networking
issues). Now, even after retrying multiple times, no more data comes
from the mod_lisp connection socket.
I think it has to be something in mod_lisp/apache, because the same
example test code works consistently with large files when using my
own, very simple, s-http-server. In this case, read-sequence is used
in exactly the same way, reading the whole posted body in one go,
without retrying. The only difference is that the socket connection
being read from comes directly from the browser instead of from
mod_lisp/apache.
In the C code I see that mod_lisp is using ap_send_fb_length to send
the body - but that doesn't help me.
Has anybody else ever encountered similar problems ?
I am using Apache/1.3.33 (Darwin) mod_lisp/2.43 with LispWorks Pro
4.4.6 on Mac OS X 10.4.3
Thx,
Sven
--
Sven Van Caekenberghe - http://homepage.mac.com/svc
Beta Nine - software engineering - http://www.beta9.be
"Lisp isn't a language, it's a building material." - Alan Kay