1
0
Fork 0

Merge branch 'devel' of github.com:triAGENS/ArangoDB into devel

This commit is contained in:
Frank Celler 2012-10-11 16:16:10 +02:00
commit a0b4c4ef00
4 changed files with 25 additions and 65 deletions

View File

@ -1,55 +0,0 @@
# -*- mode: Makefile; -*-
## -----------------------------------------------------------------------------
## --SECTION-- LIBRARY
## -----------------------------------------------------------------------------
################################################################################
### @brief Protobuf
################################################################################
BUILT_SOURCES += @PROTOBUF_LIBS@
CLEANUP += @srcdir@/.protobuf-build-@TRI_BITS@
PROTOBUFDIR = @abs_top_srcdir@/3rdParty/protobuf-2.4.1/BUILD
@PROTOBUF_LIBS@: @srcdir@/.protobuf-build-@TRI_BITS@
@PROTOBUF_PROTOC@: @srcdir@/.protobuf-build-@TRI_BITS@
@srcdir@/.protobuf-build-@TRI_BITS@:
@echo
@echo "--------------------------------------------------------------------------------"
@echo "BUILDING Protocol Buffers"
@echo "--------------------------------------------------------------------------------"
@echo
cd @top_srcdir@/3rdParty/protobuf-2.4.1 \
&& ./configure \
--disable-dependency-tracking \
--disable-shared \
--prefix=$(PROTOBUFDIR) \
--libdir=$(PROTOBUFDIR)/lib@TRI_BITS@
cd @top_srcdir@/3rdParty/protobuf-2.4.1 && $(MAKE) install
touch @srcdir@/.protobuf-build-@TRI_BITS@
@echo
@echo "--------------------------------------------------------------------------------"
@echo "BUILD Protocol Buffers FINISHED"
@echo "--------------------------------------------------------------------------------"
@echo
################################################################################
### @brief additional files to remove
################################################################################
CLEANUP += .protobuf-build-@TRI_BITS@
## -----------------------------------------------------------------------------
## --SECTION-- END-OF-FILE
## -----------------------------------------------------------------------------
## Local Variables:
## mode: outline-minor
## outline-regexp: "^\\(### @brief\\|## --SECTION--\\|# -\\*- \\)"
## End:

View File

@ -1892,7 +1892,7 @@ TRI_document_collection_t* TRI_OpenDocumentCollection (TRI_vocbase_t* vocbase, c
collection = TRI_OpenCollection(vocbase, &sim->base.base, path);
if (collection == NULL) {
LOG_ERROR("cannot open simple collection");
LOG_ERROR("cannot open document collection from path '%s'", path);
TRI_Free(TRI_UNKNOWN_MEM_ZONE, sim);
return NULL;
@ -3097,6 +3097,11 @@ static TRI_index_t* CreateCapConstraintDocumentCollection (TRI_document_collecti
// create a new index
idx = TRI_CreateCapConstraint(&sim->base, size);
if (idx == NULL) {
TRI_set_errno(TRI_ERROR_OUT_OF_MEMORY);
return NULL;
}
if (iid) {
idx->_iid = iid;

View File

@ -346,11 +346,16 @@ static TRI_json_t* JsonCapConstraint (TRI_index_t* idx, TRI_primary_collection_t
}
// create json object and fill it
json = TRI_CreateArrayJson(TRI_CORE_MEM_ZONE);
json = TRI_CreateArrayJson(TRI_UNKNOWN_MEM_ZONE);
if (json == NULL) {
TRI_set_errno(TRI_ERROR_OUT_OF_MEMORY);
TRI_Insert3ArrayJson(TRI_CORE_MEM_ZONE, json, "id", TRI_CreateNumberJson(TRI_CORE_MEM_ZONE, idx->_iid));
TRI_Insert3ArrayJson(TRI_CORE_MEM_ZONE, json, "type", TRI_CreateStringCopyJson(TRI_CORE_MEM_ZONE, "cap"));
TRI_Insert3ArrayJson(TRI_CORE_MEM_ZONE, json, "size", TRI_CreateNumberJson(TRI_CORE_MEM_ZONE, cap->_size));
return NULL;
}
TRI_Insert3ArrayJson(TRI_UNKNOWN_MEM_ZONE, json, "id", TRI_CreateNumberJson(TRI_UNKNOWN_MEM_ZONE, idx->_iid));
TRI_Insert3ArrayJson(TRI_UNKNOWN_MEM_ZONE, json, "type", TRI_CreateStringCopyJson(TRI_UNKNOWN_MEM_ZONE, "cap"));
TRI_Insert3ArrayJson(TRI_UNKNOWN_MEM_ZONE, json, "size", TRI_CreateNumberJson(TRI_UNKNOWN_MEM_ZONE, cap->_size));
return json;
}
@ -424,7 +429,12 @@ TRI_index_t* TRI_CreateCapConstraint (struct TRI_primary_collection_s* collectio
size_t size) {
TRI_cap_constraint_t* cap;
cap = TRI_Allocate(TRI_CORE_MEM_ZONE, sizeof(TRI_cap_constraint_t), false);
cap = TRI_Allocate(TRI_UNKNOWN_MEM_ZONE, sizeof(TRI_cap_constraint_t), false);
if (cap == NULL) {
TRI_set_errno(TRI_ERROR_OUT_OF_MEMORY);
return NULL;
}
cap->base._iid = TRI_NewTickVocBase();
cap->base._type = TRI_IDX_TYPE_CAP_CONSTRAINT;
@ -461,7 +471,7 @@ void TRI_DestroyCapConstraint (TRI_index_t* idx) {
void TRI_FreeCapConstraint (TRI_index_t* idx) {
TRI_DestroyCapConstraint(idx);
TRI_Free(TRI_CORE_MEM_ZONE, idx);
TRI_Free(TRI_UNKNOWN_MEM_ZONE, idx);
}
////////////////////////////////////////////////////////////////////////////////
@ -3171,6 +3181,7 @@ static TRI_json_t* JsonSkiplistIndex (TRI_index_t* idx, TRI_primary_collection_t
path = collection->_shaper->lookupAttributePathByPid(collection->_shaper, shape);
if (path == NULL) {
TRI_Free(TRI_UNKNOWN_MEM_ZONE, fieldList);
return NULL;
}
fieldList[j] = ((const char*) path) + sizeof(TRI_shape_path_t) + path->_aidLength * sizeof(TRI_shape_aid_t);
@ -3181,8 +3192,9 @@ static TRI_json_t* JsonSkiplistIndex (TRI_index_t* idx, TRI_primary_collection_t
// create json object and fill it
// ..........................................................................
json = TRI_CreateArrayJson(TRI_UNKNOWN_MEM_ZONE);
if (!json) {
if (json == NULL) {
TRI_Free(TRI_UNKNOWN_MEM_ZONE, fieldList);
return NULL;
}

View File

@ -155,8 +155,6 @@ namespace triagens {
FileUtils::slurp(name, _response->body());
}
catch (...) {
delete _response;
LOGGER_WARNING << "file '" << name << "' not readable";
_response = createResponse(HttpResponse::NOT_FOUND);