Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EDAB411FAD for ; Mon, 14 Jul 2014 11:38:58 +0000 (UTC) Received: (qmail 29993 invoked by uid 500); 14 Jul 2014 11:38:58 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 29924 invoked by uid 500); 14 Jul 2014 11:38:58 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 29911 invoked by uid 99); 14 Jul 2014 11:38:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jul 2014 11:38:58 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jkaluza@redhat.com designates 209.132.183.28 as permitted sender) Received: from [209.132.183.28] (HELO mx1.redhat.com) (209.132.183.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jul 2014 11:38:53 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6EBcUlq008225 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 14 Jul 2014 07:38:31 -0400 Received: from dhcp-24-191.brq.redhat.com (vpn-237-183.phx2.redhat.com [10.3.237.183]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6EBcToK013671 for ; Mon, 14 Jul 2014 07:38:29 -0400 Message-ID: <53C3C134.6010604@redhat.com> Date: Mon, 14 Jul 2014 13:38:28 +0200 From: =?UTF-8?B?SmFuIEthbHXFvmE=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Re: svn commit: r1610339 - in /httpd/httpd/trunk: docs/manual/mod/mod_journald.xml modules/loggers/config.m4 modules/loggers/mod_journald.c References: <20140714055246.22404238890D@eris.apache.org> <53C38C33.1020107@apache.org> In-Reply-To: <53C38C33.1020107@apache.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Virus-Checked: Checked by ClamAV on apache.org On 07/14/2014 09:52 AM, Ruediger Pluem wrote: > > > jkaluza@apache.org wrote: >> Author: jkaluza >> Date: Mon Jul 14 05:52:45 2014 >> New Revision: 1610339 >> >> URL: http://svn.apache.org/r1610339 >> Log: >> mod_journald: New module implementing error_log provider for systemd-journald. >> >> Added: >> httpd/httpd/trunk/docs/manual/mod/mod_journald.xml (with props) >> httpd/httpd/trunk/modules/loggers/mod_journald.c >> Modified: >> httpd/httpd/trunk/modules/loggers/config.m4 >> > >> Added: httpd/httpd/trunk/modules/loggers/mod_journald.c >> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/loggers/mod_journald.c?rev=1610339&view=auto >> ============================================================================== >> --- httpd/httpd/trunk/modules/loggers/mod_journald.c (added) >> +++ httpd/httpd/trunk/modules/loggers/mod_journald.c Mon Jul 14 05:52:45 2014 > >> +static apr_status_t journald_log_writer(request_rec *r, >> + void *handle, >> + const char **strs, >> + int *strl, >> + int nelts, >> + apr_size_t len) >> + >> +{ >> + char *str; >> + char *s; >> + int i; >> + apr_status_t rv = APR_SUCCESS; >> + >> + str = apr_palloc(r->pool, len + 1); > > Why +1? That's taken from ap_default_log_writer(...) and it's also in ap_buffered_log_writer(...). When thinking about it now, it's probably useless, because "len" is sum of strlen() of each string in strs, so it does not include '\0', but my log_writer (and also the ap_default_log_writer/ap_buffered_log_writer) does not actually use/set that last zero byte. I think we can remove that "len + 1" in all three cases then? Jan Kaluza > Regards > > RĂ¼diger >