summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2010-11-18 10:07:33 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2010-11-18 10:07:33 +0000
commitcde3f3943f0185a8ec98a1a0e6e716202529f239 (patch)
treee6c076da5f2840c3127c7ded519576b802b79bcf /src
parentf79b62cb76b5c04a73d0d98232e457171f0a515c (diff)
Merged revision 1032673 from trunk:
Preserve attachment identity length when doing local to local replications. Closes COUCHDB-930. Patch by Juuso Väänänen. Thanks. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.0.x@1036380 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/couchdb/couch_db.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/couchdb/couch_db.erl b/src/couchdb/couch_db.erl
index 9a02e1ee..fe155abe 100644
--- a/src/couchdb/couch_db.erl
+++ b/src/couchdb/couch_db.erl
@@ -816,11 +816,12 @@ flush_att(Fd, #att{data={Fd0, _}}=Att) when Fd0 == Fd ->
% already written to our file, nothing to write
Att;
-flush_att(Fd, #att{data={OtherFd,StreamPointer}, md5=InMd5}=Att) ->
+flush_att(Fd, #att{data={OtherFd,StreamPointer}, md5=InMd5,
+ disk_len=InDiskLen} = Att) ->
{NewStreamData, Len, _IdentityLen, Md5, IdentityMd5} =
couch_stream:copy_to_new_stream(OtherFd, StreamPointer, Fd),
check_md5(IdentityMd5, InMd5),
- Att#att{data={Fd, NewStreamData}, md5=Md5, att_len=Len, disk_len=Len};
+ Att#att{data={Fd, NewStreamData}, md5=Md5, att_len=Len, disk_len=InDiskLen};
flush_att(Fd, #att{data=Data}=Att) when is_binary(Data) ->
with_stream(Fd, Att, fun(OutputStream) ->