summaryrefslogtreecommitdiff
path: root/src/journal-remote
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-05-27 19:03:03 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-05-31 14:33:41 +0200
commit0ab896b343afeaa70f69881626a50855dc518d68 (patch)
tree20c19f863330a044645a39332042c97c081bfba3 /src/journal-remote
parentc0b6ada7572cd7345a8b87478130b20d35c198a2 (diff)
downloadsystemd-0ab896b343afeaa70f69881626a50855dc518d68.tar.gz
journal-remote: do not send _BOOT_ID twice
Also remove the comma from the comment everywhere, I think the comma unnecessarilly put emphasis on the clause after the comma. Fixes #9090. Reproducer: systemd-journal-remote --split-mode=none -o /tmp/msg6.journal --trust=all --listen-http=8080 systemd-journal-upload -u http://localhost:8080 journalctl --file /tmp/msg6.journal -o verbose -n1
Diffstat (limited to 'src/journal-remote')
-rw-r--r--src/journal-remote/journal-upload-journal.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/journal-remote/journal-upload-journal.c b/src/journal-remote/journal-upload-journal.c
index 909905d1cd..66af9d5dcb 100644
--- a/src/journal-remote/journal-upload-journal.c
+++ b/src/journal-remote/journal-upload-journal.c
@@ -8,12 +8,14 @@
#include <curl/curl.h>
#include <stdbool.h>
+#include "sd-daemon.h"
+
#include "alloc-util.h"
#include "journal-upload.h"
#include "log.h"
+#include "string-util.h"
#include "utf8.h"
#include "util.h"
-#include "sd-daemon.h"
/**
* Write up to size bytes to buf. Return negative on error, and number of
@@ -139,8 +141,12 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
continue;
}
- if (!utf8_is_printable_newline(u->field_data,
- u->field_length, false)) {
+ /* We already printed the boot id from the data in
+ * the header, hence let's suppress it here */
+ if (memory_startswith(u->field_data, u->field_length, "_BOOT_ID="))
+ continue;
+
+ if (!utf8_is_printable_newline(u->field_data, u->field_length, false)) {
u->entry_state = ENTRY_BINARY_FIELD_START;
continue;
}