pipe: remove padding for odd-length messages 75/176675/2 accepted/tizen/unified/20180424.082531 submit/tizen/20180423.122745
authorMichal Bloch <m.bloch@samsung.com>
Fri, 20 Apr 2018 14:45:42 +0000 (16:45 +0200)
committerMichal Bloch <m.bloch@samsung.com>
Mon, 23 Apr 2018 11:52:47 +0000 (13:52 +0200)
Since 154c5eaaf1ecf6224de0bcafc872c4952ffdae9b, the padding
is no longer needed as the daemon handles odd lengths correctly.

Change-Id: I722efc2e5e73f26f1896510da857a42bbfebed9c
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
src/shared/logprint.c
src/shared/queued_entry.c

index 0946e13..d6b194c 100644 (file)
@@ -752,10 +752,6 @@ char *log_format_log_line(
        size_t bufferSize;
        const char *pm;
        int message_len = entry->len - sizeof(struct logger_entry) - entry->tag_len - 2 /* tag and msg delimiters */;
-       // odd-length messages get an extra byte of padding, get rid of that
-       if (*(msg + message_len - 1)  == '\0')
-               --message_len;
-
 
        if (prefixSuffixIsHeaderFooter) {
                /* we're just wrapping message with a header/footer */
index 613eb99..7f1bf31 100644 (file)
@@ -67,7 +67,6 @@ void create_pipe_message(void *buf, int prio, char const *tag, char const *msg)
        ple->msg[0] = prio;
        memcpy(ple->msg + 1, tag, tag_l);
        memcpy(ple->msg + 1 + tag_l, msg, msg_l);
-       ple->len += ple->len % 2;
 }
 
 /**