|
Posting empty attachments: msg#00097db.couchdb.devel
Heya Damien, the recently added RESTful API for attachments still lacks support for empty attachments. CouchDB will fail in the couch_db:doc_flush_binaries/2 function. The following patch makes my (new) testcase of writing and reading an empty attachment work, but I am sure it is not completely correct. Also, I am not yet entirely sure if that is the right place to fix that. Any pointers appreciated :) Cheers Jan -- Index: /Users/jan/Work/couchdb-all/trunk/src/couchdb/couch_db.erl =================================================================== --- /Users/jan/Work/couchdb-all/trunk/src/couchdb/couch_db.erl (revision 675780) +++ /Users/jan/Work/couchdb-all/trunk/src/couchdb/couch_db.erl (working copy) @@ -348,6 +348,9 @@ fun({Key, {Type, BinValue}}) -> NewBinValue = case BinValue of + <<>> -> + % empty attachment + {0, 0, 0}; {Fd0, StreamPointer, Len} when Fd0 == Fd -> % already written to our file, nothing to write {Fd, StreamPointer, Len}; |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: mochiweb unstable?: 00097, Damien Katz |
|---|---|
| Next by Date: | Re: Custom file driver for OS X and Windows Re: CouchDB 0.9 and 1.0: 00097, Jan Lehnardt |
| Previous by Thread: | [jira] Created: (COUCHDB-96) Call to gen_server:call can time outi: 00097, Randall Leeds (JIRA) |
| Next by Thread: | [jira] Resolved: (COUCHDB-15) Error inserting attachment with empty data: 00097, Jan Lehnardt (JIRA) |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |