From 4c6355483d3e97971a97a9a3935263ecf47f7ca8 Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Mon, 8 Nov 2010 19:22:01 +0000 Subject: =?UTF-8?q?Preserve=20attachment=20identity=20length=20when=20doin?= =?UTF-8?q?g=20local=20to=20local=20replications.=20Closes=20COUCHDB-930.?= =?UTF-8?q?=20Patch=20by=20Juuso=20V=C3=A4=C3=A4n=C3=A4nen.=20Thanks.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1032673 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_db.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/couchdb') 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) -> -- cgit v1.2.3