Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

CouchStore DocInfo.size renamed physical_size

Change-Id: I2bd433d28f634deaabe074a230eb3319b4fda9a7
Reviewed-on: http://review.couchbase.org/17283
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
  • Loading branch information...
commit caad1fd59cd8714a1b6a747c6860705946f54ab5 1 parent cdadb20
@snej snej authored trondn committed
Showing with 17 additions and 22 deletions.
  1. +17 −22 src/document.c
View
39 src/document.c
@@ -198,7 +198,7 @@ cbio_error_t cbio_document_set_value(libcbio_document_t doc,
}
doc->doc->data.buf = ptr;
- doc->info->size = doc->doc->data.size = nvalue;
+ doc->doc->data.size = nvalue;
return CBIO_SUCCESS;
}
@@ -286,33 +286,28 @@ cbio_error_t cbio_document_get_value(libcbio_document_t doc,
return CBIO_ERROR_EINVAL;
}
- if (value != NULL) {
- if (doc->doc == NULL && (doc->info == NULL || doc->scratch)) {
- return CBIO_ERROR_EINVAL;
- }
+ if (doc->doc == NULL && (doc->info == NULL || doc->scratch)) {
+ return CBIO_ERROR_EINVAL;
+ }
- if (doc->info->deleted) {
- return CBIO_ERROR_ENOENT;
- }
+ if (doc->info->deleted) {
+ return CBIO_ERROR_ENOENT;
+ }
- if (doc->doc == NULL) {
- couchstore_error_t err;
- err = couchstore_open_doc_with_docinfo(doc->handle->couchstore_handle,
- doc->info,
- &doc->doc, 0);
- if (err != COUCHSTORE_SUCCESS) {
- return cbio_remap_error(err);
- }
+ if (doc->doc == NULL) {
+ couchstore_error_t err;
+ err = couchstore_open_doc_with_docinfo(doc->handle->couchstore_handle,
+ doc->info,
+ &doc->doc, 0);
+ if (err != COUCHSTORE_SUCCESS) {
+ return cbio_remap_error(err);
}
+ }
+ if (value) {
*value = doc->doc->data.buf;
- *nvalue = doc->doc->data.size;
- } else {
- if (doc->info == NULL) {
- return CBIO_ERROR_EINVAL;
- }
- *nvalue = doc->info->size;
}
+ *nvalue = doc->doc->data.size;
return CBIO_SUCCESS;
}
Please sign in to comment.
Something went wrong with that request. Please try again.