[plt-scheme] File upload problems
[ This kind of follows on from the thread: "web-server with a single
servlet" ]
Dear all,
I'm having problems uploading files over HTTP to the PLT web-server:
- files seem to take a very long time to upload (although this may be
a networking issue)
- sometimes file uploads fail altogether with an error message like
"connection reset by peer"
Looking through the logs for my software, I've found a number of
exception traces like:
bytes=?: expects type <byte string> as 1st argument, given: #<eof>;
other arguments were:
#"-----------------------------11479027812035015474368800899"
=== context ===
/usr/local/plt/collects/web-server/private/request.ss:231:11: read-
mime-part-body
/usr/local/plt/collects/web-server/private/request.ss:247:17
/usr/local/plt/collects/web-server/private/request.ss:247:17
/usr/local/plt/collects/web-server/private/request.ss:247:17
/usr/local/plt/collects/web-server/private/request.ss:247:17
/usr/local/plt/collects/web-server/private/request.ss:247:17
/usr/local/plt/collects/web-server/private/request.ss:137:2: read-
bindings
/usr/local/plt/collects/web-server/private/request.ss:20:5
/usr/local/plt/collects/web-server/private/request.ss:17:2: read-request
provide/contract-contract-id-read-request
/usr/local/plt/collects/web-server/dispatch-server-unit.ss:73:10:
connection-loop
/usr/local/plt/collects/mzlib/thread.ss:93:45
which I assume are related to the above problems. It looks to me like
the connection is timing out and the request data is getting cut off
in mid-stream (hence the exception).
I eliminated the mod_proxy factor mentioned in my previous email by
sending the file upload form directly to the web-server on its own
port: it's all Scheme code handling the data.
Has anybody else seen something like this? Does anyone have any ideas
of how to stop it?
Many Thanks,
-- Dave
PS - I am using PLT 352.5 with the LRU continuation manager. The
whole thing is installed on Debian Sarge with the stable package tree.
PPS - I am in the process of collecting more data from users (browser/
OS types, file sizes, precise symptoms, and so on) to see what
patterns I can spot.
> The web-server does not support this out of the box. In the olden
> days, the `/servlets' URL was quite stamped into the system and I've
> been slowly working to get it out.
>
> What went wrong with the mod_proxy? I do a similar thing and don't
> know what the problem with large files is (you can have Apache serve
> them). Also, you can look at the dispatcher API and write your on
> web-config unit and make a URL rewriter for the web-server. If you
> want to go on this route, I can guide you a bit more.
>
> Jay
>
> On 9/7/06, Dave Gurnell <d.j.gurnell at gmail.com> wrote:
>> Dear all,
>>
>> A question about configuring web-server (WS):
>>
>> I would like to use WS in a slightly non-standard configuration: I
>> want a single servlet to respond to *all* requests to a particular
>> port on a machine. For example, if I'm running my server on localhost
>> port 8080, I want all requests to:
>>
>> http://localhost:8080
>> http://localhost:8080/abc
>> http://localhost:8080/def
>> http://localhost:8080/ghi/jkl
>>
>> and so on to go to the same servlet. I only have one servlet, and I'm
>> quite happy to serve static content by getting it to pipe files back
>> to the user.
>>
>> After looking at the docs and source, I don't think WS can be
>> configured to behave in this way: from what I understand, the name of
>> the servlet file has to occur somewhere in the URL:
>>
>> http://localhost:8080/servlets/abc.ss
>>
>> I don't want to do this because I want super-user-friendly URLs as
>> entry points. I've tried using Apache and mod_proxy to translate URLs
>> and forward requests to WS, but for various reasons (including
>> problems with large file uploads) this has turned out to be
>> problematic.
>>
>> Can anyone suggest a way of configuring WS in this way? Failing that,
>> I may be looking at creating a hacked version of WS for this project:
>> I'd appreciate any advice you can offer.
>>
>> Many thanks,
>>
>> -- Dave
>>
>> _________________________________________________
>> For list-related administrative tasks:
>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>
>
>
> --
> Jay McCarthy <jay at cs.brown.edu>
> http://jay.makeoutcity.com/