diff options
author | Robert Newson <rnewson@apache.org> | 2023-05-06 14:40:22 +0100 |
---|---|---|
committer | Robert Newson <rnewson@apache.org> | 2023-05-06 14:40:22 +0100 |
commit | 4aef4ebaf080a4f5f9a8dd64751a63c9d6e5300d (patch) | |
tree | 3f44f43a05fea2e7b8ba6f8a6c6b1544b0cf2fc5 /src/couch/src/couch_db.erl | |
parent | 90ca838cd3f3e2f03b2ee4d433d700a1459b0a84 (diff) | |
parent | 141eb3d19cca2552fff7dc453a65fefebc00b8ce (diff) | |
download | couchdb-remove-md5-more.tar.gz |
Merge remote-tracking branch 'origin/remove-content-md5-header' into remove-md5-entirelyremove-md5-more
Diffstat (limited to 'src/couch/src/couch_db.erl')
-rw-r--r-- | src/couch/src/couch_db.erl | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/src/couch/src/couch_db.erl b/src/couch/src/couch_db.erl index d89d3e3f3..66e9a6db0 100644 --- a/src/couch/src/couch_db.erl +++ b/src/couch/src/couch_db.erl @@ -1599,16 +1599,6 @@ compressible_att_type(MimeType) -> [T || T <- TypeExpList, T /= []] ). -% From RFC 2616 3.6.1 - Chunked Transfer Coding -% -% In other words, the origin server is willing to accept -% the possibility that the trailer fields might be silently -% discarded along the path to the client. -% -% I take this to mean that if "Trailers: Content-MD5\r\n" -% is present in the request, but there is no Content-MD5 -% trailer, we're free to ignore this inconsistency and -% pretend that no Content-MD5 exists. with_stream(Db, Att, Fun) -> [InMd5, Type, Enc] = couch_att:fetch([md5, type, encoding], Att), BufferSize = config:get_integer( @@ -1631,19 +1621,10 @@ with_stream(Db, Att, Fun) -> [{buffer_size, BufferSize}] end, {ok, OutputStream} = open_write_stream(Db, Options), - ReqMd5 = - case Fun(OutputStream) of - {md5, FooterMd5} -> - case InMd5 of - md5_in_footer -> FooterMd5; - _ -> InMd5 - end; - _ -> - InMd5 - end, + Fun(OutputStream), {StreamEngine, Len, IdentityLen, Md5, IdentityMd5} = couch_stream:close(OutputStream), - couch_util:check_md5(IdentityMd5, ReqMd5), + couch_util:check_md5(IdentityMd5, InMd5), {AttLen, DiskLen, NewEnc} = case Enc of identity -> |