couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Filipe Manana (JIRA)" <>
Subject [jira] Commented: (COUCHDB-687) Add md5 hash to _attachments properties for documents
Date Mon, 25 Oct 2010 18:50:20 GMT


Filipe Manana commented on COUCHDB-687:

Hi Juuso,

thanks for the patch.


1) Why not use couch:util:to_hex/1?

2) The md5 field of the #att record is not always what you want. This is because for attachments
that were stored in compressed form, the #att.md5 field corresponds to the md5 hash of the
attachment after compression. The identity md5 hash is given by couch_stream:close/1, but
it's not stored in the #att record (nor any other place). It's only used for attachment integrity
(if the upload request has the header "Content-MD5")

> Add md5 hash to _attachments properties for documents
> -----------------------------------------------------
>                 Key: COUCHDB-687
>                 URL:
>             Project: CouchDB
>          Issue Type: Improvement
>         Environment: CouchDB
>            Reporter: mikeal
>            Assignee: Filipe Manana
>         Attachments: md5.patch
> The current attachment information looks like this:
> GET /dbname/docid
> "_attachments": {
>       "jquery-1.4.1.min.js": {
>           "content_type": "text/javascript"
>           "revpos": 138
>           "length": 70844
>           "stub": true
>       }
> }
> If a client wanted to sync local files as attachments with a document it would not currently
be able to do so without keeping a local store of the revpos. If this information included
an md5 hash of the attachment clients could compare it against a hash of the local file to
see if they match.
> -Mikeal

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message