diff options
author | Adam Kocoloski <kocolosk@apache.org> | 2009-08-11 01:51:06 +0000 |
---|---|---|
committer | Adam Kocoloski <kocolosk@apache.org> | 2009-08-11 01:51:06 +0000 |
commit | f5c4dcd4366ace98378f26b3c67164befdb0d1d5 (patch) | |
tree | c96fabcd64bc3b8296a4c1024c47c06f371063df /src/couchdb/couch_rep_httpc.erl | |
parent | 5dcbc2290ac780f1a625b5c9435cfb35eac4e1ef (diff) |
stream _bulk_docs JSON body during replication
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@802974 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_rep_httpc.erl')
-rw-r--r-- | src/couchdb/couch_rep_httpc.erl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/couchdb/couch_rep_httpc.erl b/src/couchdb/couch_rep_httpc.erl index 8cc3cae6..3e3b5f05 100644 --- a/src/couchdb/couch_rep_httpc.erl +++ b/src/couchdb/couch_rep_httpc.erl @@ -39,7 +39,14 @@ do_request(Req) -> {OAuthProps} -> [oauth_header(Url, Method, OAuthProps) | Headers0] end, - Body = if B =:= nil -> []; true -> iolist_to_binary(?JSON_ENCODE(B)) end, + Body = case B of + {Fun, InitialState} when is_function(Fun) -> + {Fun, InitialState}; + nil -> + []; + _Else -> + iolist_to_binary(?JSON_ENCODE(B)) + end, Resp = case Conn of nil -> ibrowse:send_req(Url, Headers, Method, Body, Opts, infinity); |