diff options
author | John Christopher Anderson <jchris@apache.org> | 2009-02-14 00:17:45 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2009-02-14 00:17:45 +0000 |
commit | c91f851dc421466402721eb7baa644860f874ce1 (patch) | |
tree | a9681a8439c993a1d38a97b4f3408ed634454a87 /src/couchdb | |
parent | 4b691efb97cbbe3b0150c59c25d97882260a4984 (diff) |
enhance the Mochiweb streaming api based on feedback from Bob Ippolito
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@744309 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb')
-rw-r--r-- | src/couchdb/couch_db.erl | 3 | ||||
-rw-r--r-- | src/couchdb/couch_httpd.erl | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/couchdb/couch_db.erl b/src/couchdb/couch_db.erl index e9612b47..ebc11bed 100644 --- a/src/couchdb/couch_db.erl +++ b/src/couchdb/couch_db.erl @@ -441,8 +441,7 @@ doc_flush_binaries(Doc, Fd) -> {ok, StreamPointer} = couch_stream:write(OutputStream, Bin), {Fd, StreamPointer, size(Bin)}; {StreamFun, undefined} when is_function(StreamFun) -> - % we will throw an error if the client - % sends a chunk larger than this size + % max_attachment_chunk_size control the max we buffer in memory MaxChunkSize = list_to_integer(couch_config:get("couchdb", "max_attachment_chunk_size","4294967296")), WriterFun = make_writer_fun(OutputStream), diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl index 9969177e..5549e40a 100644 --- a/src/couchdb/couch_httpd.erl +++ b/src/couchdb/couch_httpd.erl @@ -264,7 +264,7 @@ recv_chunked(#httpd{mochi_req=MochiReq}, MaxChunkSize, ChunkFun, InitState) -> % Fun is called once with each chunk % Fun({Length, Binary}, State) % called with Length == 0 on the last time. - MochiReq:recv_body(MaxChunkSize, ChunkFun, InitState). + MochiReq:stream_body(MaxChunkSize, ChunkFun, InitState). body(#httpd{mochi_req=MochiReq}) -> % Maximum size of document PUT request body (4GB) |