diff options
author | Filipe David Borba Manana <fdmanana@apache.org> | 2010-11-08 19:22:01 +0000 |
---|---|---|
committer | Filipe David Borba Manana <fdmanana@apache.org> | 2010-11-08 19:22:01 +0000 |
commit | 4c6355483d3e97971a97a9a3935263ecf47f7ca8 (patch) | |
tree | 790432a77d565b4f9d684679e7d4a99019068e9b /src | |
parent | 93eb31323d932e57b73973a12b5ccf42d1b1b8b1 (diff) |
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/trunk@1032673 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/couchdb/couch_db.erl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/couchdb/couch_db.erl b/src/couchdb/couch_db.erl index 36b61a7e..7d8d195f 100644 --- a/src/couchdb/couch_db.erl +++ b/src/couchdb/couch_db.erl @@ -803,11 +803,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) -> |