Commit graph

10 commits

Author SHA1 Message Date
Thomas Hindoe Paaboel Andersen 71d35b6b55 tree-wide: sort includes in *.h
This is a continuation of the previous include sort patch, which
only sorted for .c files.
2015-11-18 23:09:02 +01:00
Zbigniew Jędrzejewski-Szmek be7e1319ea journal-remote: make process_data static 2015-03-13 23:42:17 -04:00
Zbigniew Jędrzejewski-Szmek 043945b938 journal-remote: process events without delay
journal-remote buffers input, and then parses it handling one journal entry at a time.
It was possible for useful data to be left in the buffer after some entries were
processesed. But all data would be already read from the fd, so there would be
no reason for the event loop to call the handler again. After some new data came in,
the handler would be called again, and would then process the "old" data in the buffer.

Fix this by enabling a handler wherever we process input data and do not exhaust data
from the input buffer (i.e. when EAGAIN was not encountered). The handler runs until
we encounter EAGAIN.

Looping over the input data is done in this roundabout way to allow the event loop
to dispatch other events in the meanwhile. If the loop was inside the handler, a
source which produced data fast enough could completely monopolize the process.

https://bugs.freedesktop.org/show_bug.cgi?id=89516
2015-03-13 00:26:02 -04:00
Zbigniew Jędrzejewski-Szmek 09d801a82a journal-remote: fix saving of binary fields
Binary fields were not processed properly, and resulting journal files
were non-conforming, resulting in an error ("Invalid field.") when reading.

https://bugs.freedesktop.org/show_bug.cgi?id=89391
2015-03-02 10:40:01 -05:00
Zbigniew Jędrzejewski-Szmek 92b10cbccd journal-remote: avoid copying input data
Instead of copying fields into new memory allocations, simply keep pointers
into the receive buffer. Data in this buffer is only copied when there is not
enough space for new data and a large chunk of the buffer contains old data.
2014-07-15 22:34:42 -04:00
Zbigniew Jędrzejewski-Szmek 9ff48d0982 journal-remote: rework fd and writer reference handling 2014-07-15 22:34:41 -04:00
Zbigniew Jędrzejewski-Szmek 4a0a6ac038 Fix problem with allocating large buffers and log leftovers 2014-07-15 22:34:40 -04:00
Zbigniew Jędrzejewski-Szmek 8201af08fa journal-remote: allow splitting incoming logs by source host
Previously existing scheme where the file name would be based on
the source was just too ugly and unpredicatable. Now there are
only two options:
  1. just one file (until rotation),
  2. one file per source host, using the hostname as filename part.
For the cases where the source is specified by the user, only
option one is allowed, and the full of the file must be specified.
2014-07-15 22:31:41 -04:00
Zbigniew Jędrzejewski-Szmek 851d4e2a67 journal-remote: reject fields above maximum size
Also fix an infinite loop on E2BIG.

Remember what range we already scanned for '\n', to avoid
quadratic behaviour on long "text" fields.
2014-07-15 22:23:47 -04:00
Zbigniew Jędrzejewski-Szmek 1e4e7b71e1 Move network-related journal programs to src/journal-remote/
Directory src/journal has become one of the largest directories,
and since systemd-journal-gatewayd, systemd-journal-remote, and
forthcoming systemd-journal-upload are all closely related, create
a separate directory for them.
2014-07-15 22:23:47 -04:00
Renamed from src/journal/journal-remote-parse.h (Browse further)