diff options
Diffstat (limited to 'src/journal-remote')
-rw-r--r-- | src/journal-remote/journal-gatewayd.c | 2 | ||||
-rw-r--r-- | src/journal-remote/journal-remote-parse.c | 2 | ||||
-rw-r--r-- | src/journal-remote/journal-remote-write.c | 1 | ||||
-rw-r--r-- | src/journal-remote/journal-remote.c | 27 | ||||
-rw-r--r-- | src/journal-remote/journal-upload-journal.c | 26 | ||||
-rw-r--r-- | src/journal-remote/journal-upload.c | 3 | ||||
-rw-r--r-- | src/journal-remote/microhttpd-util.c | 1 |
7 files changed, 51 insertions, 11 deletions
diff --git a/src/journal-remote/journal-gatewayd.c b/src/journal-remote/journal-gatewayd.c index 92ef723aff..6b93a758f6 100644 --- a/src/journal-remote/journal-gatewayd.c +++ b/src/journal-remote/journal-gatewayd.c @@ -33,6 +33,7 @@ #include "sd-daemon.h" #include "sd-journal.h" +#include "alloc-util.h" #include "bus-util.h" #include "fd-util.h" #include "fileio.h" @@ -40,6 +41,7 @@ #include "log.h" #include "logs-show.h" #include "microhttpd-util.h" +#include "parse-util.h" #include "sigbus.h" #include "util.h" diff --git a/src/journal-remote/journal-remote-parse.c b/src/journal-remote/journal-remote-parse.c index bb299e378c..3ff40228a0 100644 --- a/src/journal-remote/journal-remote-parse.c +++ b/src/journal-remote/journal-remote-parse.c @@ -19,9 +19,11 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "alloc-util.h" #include "fd-util.h" #include "journal-remote-parse.h" #include "journald-native.h" +#include "parse-util.h" #include "string-util.h" #define LINE_CHUNK 8*1024u diff --git a/src/journal-remote/journal-remote-write.c b/src/journal-remote/journal-remote-write.c index 40f4ff8e58..d8250378b0 100644 --- a/src/journal-remote/journal-remote-write.c +++ b/src/journal-remote/journal-remote-write.c @@ -19,6 +19,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "alloc-util.h" #include "journal-remote.h" int iovw_put(struct iovec_wrapper *iovw, void* data, size_t len) { diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c index de207f8d24..dc69bb8679 100644 --- a/src/journal-remote/journal-remote.c +++ b/src/journal-remote/journal-remote.c @@ -35,6 +35,7 @@ #include "sd-daemon.h" +#include "alloc-util.h" #include "conf-parser.h" #include "escape.h" #include "fd-util.h" @@ -44,8 +45,12 @@ #include "journal-remote.h" #include "journald-native.h" #include "macro.h" +#include "parse-util.h" #include "signal-util.h" #include "socket-util.h" +#include "stat-util.h" +#include "stdio-util.h" +#include "string-table.h" #include "string-util.h" #include "strv.h" @@ -643,11 +648,12 @@ static int setup_microhttpd_server(RemoteServer *s, { MHD_OPTION_NOTIFY_COMPLETED, (intptr_t) request_meta_free}, { MHD_OPTION_EXTERNAL_LOGGER, (intptr_t) microhttpd_logger}, { MHD_OPTION_LISTEN_SOCKET, fd}, + { MHD_OPTION_CONNECTION_MEMORY_LIMIT, DATA_SIZE_MAX}, { MHD_OPTION_END}, { MHD_OPTION_END}, { MHD_OPTION_END}, { MHD_OPTION_END}}; - int opts_pos = 3; + int opts_pos = 4; int flags = MHD_USE_DEBUG | MHD_USE_DUAL_STACK | @@ -1410,18 +1416,21 @@ static int parse_argv(int argc, char *argv[]) { case ARG_GNUTLS_LOG: { #ifdef HAVE_GNUTLS - const char *word, *state; - size_t size; + const char* p = optarg; + for (;;) { + _cleanup_free_ char *word = NULL; - FOREACH_WORD_SEPARATOR(word, size, optarg, ",", state) { - char *cat; + r = extract_first_word(&p, &word, ",", 0); + if (r < 0) + return log_error_errno(r, "Failed to parse --gnutls-log= argument: %m"); - cat = strndup(word, size); - if (!cat) - return log_oom(); + if (r == 0) + break; - if (strv_consume(&arg_gnutls_log, cat) < 0) + if (strv_push(&arg_gnutls_log, word) < 0) return log_oom(); + + word = NULL; } break; #else diff --git a/src/journal-remote/journal-upload-journal.c b/src/journal-remote/journal-upload-journal.c index 6b3ad924a7..3ee6d32bf7 100644 --- a/src/journal-remote/journal-upload-journal.c +++ b/src/journal-remote/journal-upload-journal.c @@ -1,11 +1,33 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 Zbigniew Jędrzejewski-Szmek + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + systemd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with systemd; If not, see <http://www.gnu.org/licenses/>. +***/ + #include <stdbool.h> #include <curl/curl.h> -#include "util.h" +#include "alloc-util.h" +#include "journal-upload.h" #include "log.h" #include "utf8.h" -#include "journal-upload.h" +#include "util.h" /** * Write up to size bytes to buf. Return negative on error, and number of diff --git a/src/journal-remote/journal-upload.c b/src/journal-remote/journal-upload.c index a945a9971a..7d274d2fc9 100644 --- a/src/journal-remote/journal-upload.c +++ b/src/journal-remote/journal-upload.c @@ -27,13 +27,16 @@ #include "sd-daemon.h" +#include "alloc-util.h" #include "conf-parser.h" #include "fd-util.h" #include "fileio.h" #include "formats-util.h" +#include "glob-util.h" #include "journal-upload.h" #include "log.h" #include "mkdir.h" +#include "parse-util.h" #include "sigbus.h" #include "signal-util.h" #include "string-util.h" diff --git a/src/journal-remote/microhttpd-util.c b/src/journal-remote/microhttpd-util.c index df068a089c..b2c398a845 100644 --- a/src/journal-remote/microhttpd-util.c +++ b/src/journal-remote/microhttpd-util.c @@ -29,6 +29,7 @@ #include <gnutls/x509.h> #endif +#include "alloc-util.h" #include "log.h" #include "macro.h" #include "string-util.h" |