2 Jul 2010 16:42
PUT large files
Hi, I'm new to both Erlang and Yaws so please be gentle on me if I'm about to ask a stupid question.
I wrote an appmod in Yaws that accepts large CSV files, creates a document in CouchDB, and then adds the CSV as a standalone attachment. The size of the CSV I'm using to test is 163M (3.4M+ rows). Here is the CURL command I run:
curl -v -XPUT -H 'Content-Type: text/csv' '<url here>' --data-binary <at> data/data.csv
This will fail immediately, and with trace on I see an enomem error. However, if I change to chunked transfer encoding via -H 'Transfer-Encoding: chunked' then it works just fine. Looking through the source code it looks like body_method/3 is responsible for pulling the data from the socket. If chunked it eventually does the following:
yaws:setopts(CliSock, [binary, {packet, line}],SSL),
N = yaws:get_chunk_num(CliSock,SSL),
yaws:setopts(CliSock, [binary, {packet, raw}],SSL),
My guess is this has something to do with it working. Although, I don't get why it sets packet to line, and then to raw. Why not just raw?
My question, then, is there a way this can work without requiring the transfer encoding to be set to chunked?
-Ryan
------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________ Erlyaws-list mailing list Erlyaws-list@... https://lists.sourceforge.net/lists/listinfo/erlyaws-list
/klacke
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first --
RSS Feed