[plt-scheme] getting raw port of HTTP POST data in PLT Web Server in PLT 4.2.5?

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Thu Mar 11 11:10:17 EST 2010

Yes, that sounds accurate. I'd recommend a read-request that
recognizes uploads (check out http/request) and stores them on disk,
then returns a normal request that contains a field specifying the
file. Then you can handle that request to the normal web server
dispatching chain and you can preserve as much code as possible.

After you write it, we can figure out how to generalize it and fit in
the existing structure better.

Jay

On Thu, Mar 11, 2010 at 8:54 AM, Neil Van Dyke <neil at neilvandyke.org> wrote:
> OK, thanks, Jay.
>
> I think I will probably have to explore the 2nd and/or 3rd options you
> mention, since this system can have multiple people HTTP-uploading huge
> files at the same time that other people's requests are running statistical
> models, etc.
>
> I'm not sure we want to spec RAM requirements high enough to buffer uploads
> in their entirety, and I suspect that hitting swap will kill our
> performance.  Even if we had enough RAM, I'd have to look into GC
> implications of having a few 1GB file uploads buffered in RAM at once.
>
>
> Jay McCarthy wrote at 03/11/2010 12:20 AM:
>>
>> With the standard requests, you can get the POST bytes with
>> request-post-data/raw. This means that the entire port has been read
>> and is in memory before you get a hold of it. You cannot get the port.
>>
>> You could write a dispatcher that uses the connection object directly.
>> And you could make your own dispatching server with a different
>> read-request function, but that's more complicated.
>>
>> Jay
>>
>> On Wed, Mar 10, 2010 at 9:01 PM, Neil Van Dyke <neil at neilvandyke.org>
>> wrote:
>>
>>>
>>> In 4.2.5, from a servlet, will I be able to get a raw port of the HTTP
>>> POST
>>> data, such that I can do my own MIME multipart decoding and streaming to
>>> disk?
>>>
>>> I would really-really like to have this.
>>>
>>> (I think I saw something on the email list recently that hinted I might
>>> be
>>> able to do this, but I can't find it at the moment.)
>>>
>>> Thanks.
>>>
>>>
>
>



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://teammccarthy.org/jay

"The glory of God is Intelligence" - D&C 93


Posted on the users mailing list.