summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--document/src/vespa/document/fieldset/fieldsets.h1
-rw-r--r--document/src/vespa/document/fieldvalue/document.h2
-rw-r--r--document/src/vespa/document/serialization/vespadocumentserializer.cpp1
-rw-r--r--documentapi/src/tests/messages/messages50test.cpp4
-rw-r--r--documentapi/test/crosslanguagefiles/5-cpp-MultiOperationMessage.datbin90 -> 96 bytes
-rw-r--r--documentapi/test/crosslanguagefiles/5.1-cpp-MultiOperationMessage.datbin90 -> 96 bytes
-rw-r--r--vdslib/src/vespa/vdslib/container/mutabledocumentlist.cpp19
-rw-r--r--vdslib/src/vespa/vdslib/container/mutabledocumentlist.h4
8 files changed, 21 insertions, 10 deletions
diff --git a/document/src/vespa/document/fieldset/fieldsets.h b/document/src/vespa/document/fieldset/fieldsets.h
index 000268dad99..1212b10d0b1 100644
--- a/document/src/vespa/document/fieldset/fieldsets.h
+++ b/document/src/vespa/document/fieldset/fieldsets.h
@@ -1,7 +1,6 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
-#include <map>
#include <vespa/document/base/field.h>
namespace document {
diff --git a/document/src/vespa/document/fieldvalue/document.h b/document/src/vespa/document/fieldvalue/document.h
index 9c4ac0ba267..e25f3b1dc2f 100644
--- a/document/src/vespa/document/fieldvalue/document.h
+++ b/document/src/vespa/document/fieldvalue/document.h
@@ -15,10 +15,10 @@
*/
#pragma once
+#include "structfieldvalue.h"
#include <vespa/document/base/documentid.h>
#include <vespa/document/base/field.h>
#include <vespa/document/datatype/documenttype.h>
-#include <vespa/document/fieldvalue/structfieldvalue.h>
namespace document {
diff --git a/document/src/vespa/document/serialization/vespadocumentserializer.cpp b/document/src/vespa/document/serialization/vespadocumentserializer.cpp
index 2fcec61fe60..11317f2ff0a 100644
--- a/document/src/vespa/document/serialization/vespadocumentserializer.cpp
+++ b/document/src/vespa/document/serialization/vespadocumentserializer.cpp
@@ -26,7 +26,6 @@
#include <vespa/vespalib/objects/nbostream.h>
#include <vespa/eval/tensor/serialization/typed_binary_format.h>
-
using std::make_pair;
using std::pair;
using std::vector;
diff --git a/documentapi/src/tests/messages/messages50test.cpp b/documentapi/src/tests/messages/messages50test.cpp
index 1e0069d50b9..44aea1cb169 100644
--- a/documentapi/src/tests/messages/messages50test.cpp
+++ b/documentapi/src/tests/messages/messages50test.cpp
@@ -1,12 +1,8 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP(".test");
#include "messages50test.h"
#include <vespa/document/datatype/datatype.h>
#include <vespa/document/fieldvalue/document.h>
-#include <vespa/document/repo/documenttyperepo.h>
#include <vespa/document/update/fieldpathupdates.h>
#include <vespa/documentapi/documentapi.h>
#include <vespa/vdslib/container/writabledocumentlist.h>
diff --git a/documentapi/test/crosslanguagefiles/5-cpp-MultiOperationMessage.dat b/documentapi/test/crosslanguagefiles/5-cpp-MultiOperationMessage.dat
index 6efc54a6d09..718159e765e 100644
--- a/documentapi/test/crosslanguagefiles/5-cpp-MultiOperationMessage.dat
+++ b/documentapi/test/crosslanguagefiles/5-cpp-MultiOperationMessage.dat
Binary files differ
diff --git a/documentapi/test/crosslanguagefiles/5.1-cpp-MultiOperationMessage.dat b/documentapi/test/crosslanguagefiles/5.1-cpp-MultiOperationMessage.dat
index 6efc54a6d09..718159e765e 100644
--- a/documentapi/test/crosslanguagefiles/5.1-cpp-MultiOperationMessage.dat
+++ b/documentapi/test/crosslanguagefiles/5.1-cpp-MultiOperationMessage.dat
Binary files differ
diff --git a/vdslib/src/vespa/vdslib/container/mutabledocumentlist.cpp b/vdslib/src/vespa/vdslib/container/mutabledocumentlist.cpp
index 1c80e3ba8ee..6ceffa9cff7 100644
--- a/vdslib/src/vespa/vdslib/container/mutabledocumentlist.cpp
+++ b/vdslib/src/vespa/vdslib/container/mutabledocumentlist.cpp
@@ -6,6 +6,23 @@
using vespalib::nbostream;
+namespace {
+
+bool hasBodyField(const document::Document & value) {
+ for (document::StructuredFieldValue::const_iterator it(value.getFields().begin()), mt(value.getFields().end());
+ it != mt;
+ ++it)
+ {
+ if ( ! it.field().isHeaderField() ) {
+ return true;
+ }
+ }
+ return false;
+}
+
+}
+
+
namespace vdslib {
MutableDocumentList::MutableDocumentList(const document::DocumentTypeRepo::SP & repo, char* buffer, uint32_t bufferSize, bool keepexisting)
: DocumentList(repo, buffer, bufferSize, keepexisting)
@@ -49,7 +66,7 @@ MutableDocumentList::addPut(const document::Document& doc, Timestamp ts,
doc.serializeHeader(stream);
uint32_t headerSize = stream.size();
- if (addBody) {
+ if (addBody && hasBodyField(doc)) {
doc.serializeBody(stream);
}
diff --git a/vdslib/src/vespa/vdslib/container/mutabledocumentlist.h b/vdslib/src/vespa/vdslib/container/mutabledocumentlist.h
index 99d29565d42..a61032a652d 100644
--- a/vdslib/src/vespa/vdslib/container/mutabledocumentlist.h
+++ b/vdslib/src/vespa/vdslib/container/mutabledocumentlist.h
@@ -14,8 +14,8 @@
#pragma once
-#include <vespa/vdslib/container/documentlist.h>
-#include <vespa/vdslib/container/operationlist.h>
+#include "documentlist.h"
+#include "operationlist.h"
namespace vdslib {