mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-28 11:55:23 +03:00
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
This commit is contained in:
parent
c0b6ada757
commit
0ab896b343
@ -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;
|
||||
}
|
||||
|
@ -657,10 +657,8 @@ static int output_export(
|
||||
JOURNAL_FOREACH_DATA_RETVAL(j, data, length, r) {
|
||||
const char *c;
|
||||
|
||||
/* We already printed the boot id, from the data in
|
||||
* the header, hence let's suppress it here */
|
||||
if (length >= 9 &&
|
||||
startswith(data, "_BOOT_ID="))
|
||||
/* We already printed the boot id from the data in the header, hence let's suppress it here */
|
||||
if (memory_startswith(data, length, "_BOOT_ID="))
|
||||
continue;
|
||||
|
||||
c = memchr(data, '=', length);
|
||||
@ -873,7 +871,8 @@ static int output_json(
|
||||
size_t m;
|
||||
unsigned u;
|
||||
|
||||
/* We already printed the boot id, from the data in the header, hence let's suppress it here */
|
||||
/* We already printed the boot id from the data in
|
||||
* the header, hence let's suppress it here */
|
||||
if (memory_startswith(data, length, "_BOOT_ID="))
|
||||
continue;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user