1
0
Fork 0

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

This commit is contained in:
Frank Celler 2014-10-20 10:59:59 +02:00
commit 43abc04656
1 changed files with 9 additions and 12 deletions

View File

@ -610,15 +610,11 @@ int createDocumentOnCoordinator (
}
if (res->status == CL_COMM_ERROR) {
// This could be a broken connection or an Http error:
if (res->result == 0) {
if (res->result == nullptr || ! res->result->isComplete()) {
// there is not result
delete res;
return TRI_ERROR_CLUSTER_CONNECTION_LOST;
}
if (!res->result->isComplete()) {
delete res;
return TRI_ERROR_CLUSTER_CONNECTION_LOST;
}
// In this case a proper HTTP error was reported by the DBserver,
// this can be 400 or 404, we simply forward the result.
// We intentionally fall through here.
@ -710,7 +706,7 @@ int deleteDocumentOnCoordinator (
}
if (res->status == CL_COMM_ERROR) {
// This could be a broken connection or an Http error:
if (!res->result->isComplete()) {
if (res->result == nullptr || ! res->result->isComplete()) {
delete res;
return TRI_ERROR_CLUSTER_CONNECTION_LOST;
}
@ -901,7 +897,7 @@ int getDocumentOnCoordinator (
}
if (res->status == CL_COMM_ERROR) {
// This could be a broken connection or an Http error:
if (!res->result || !res->result->isComplete()) {
if (! res->result || ! res->result->isComplete()) {
delete res;
return TRI_ERROR_CLUSTER_CONNECTION_LOST;
}
@ -1150,7 +1146,7 @@ int modifyDocumentOnCoordinator (
}
if (res->status == CL_COMM_ERROR) {
// This could be a broken connection or an Http error:
if (!res->result->isComplete()) {
if (res->result == nullptr || ! res->result->isComplete()) {
delete res;
return TRI_ERROR_CLUSTER_CONNECTION_LOST;
}
@ -1297,7 +1293,8 @@ int createEdgeOnCoordinator (
}
if (res->status == CL_COMM_ERROR) {
// This could be a broken connection or an Http error:
if (!res->result->isComplete()) {
if (res->result == nullptr || ! res->result->isComplete()) {
// there is not result
delete res;
return TRI_ERROR_CLUSTER_CONNECTION_LOST;
}
@ -1323,13 +1320,13 @@ TRI_vector_pointer_t* getIndexesCoordinator (string const& databaseName,
shared_ptr<CollectionInfo> c = ClusterInfo::instance()->getCollection(databaseName, collectionName);
if ((*c).empty()) {
return 0;
return nullptr;
}
TRI_vector_pointer_t* result = (TRI_vector_pointer_t*) TRI_Allocate(TRI_UNKNOWN_MEM_ZONE, sizeof(TRI_vector_pointer_t), false);
if (result == 0) {
return 0;
if (result == nullptr) {
return nullptr;
}
TRI_InitVectorPointer(result, TRI_UNKNOWN_MEM_ZONE);