Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 69203 invoked from network); 5 Dec 2004 07:05:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 5 Dec 2004 07:05:26 -0000 Received: (qmail 2749 invoked by uid 500); 5 Dec 2004 07:05:25 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 2698 invoked by uid 500); 5 Dec 2004 07:05:25 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 2675 invoked by uid 99); 5 Dec 2004 07:05:25 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Sat, 04 Dec 2004 23:05:25 -0800 Received: (qmail 69176 invoked by uid 65534); 5 Dec 2004 07:05:23 -0000 Date: 5 Dec 2004 07:05:23 -0000 Message-ID: <20041205070523.69174.qmail@minotaur.apache.org> From: pquerna@apache.org To: cvs@httpd.apache.org Subject: svn commit: r109866 - /httpd/httpd/trunk/modules/loggers/mod_log_config.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: pquerna Date: Sat Dec 4 23:05:23 2004 New Revision: 109866 URL: http://svn.apache.org/viewcvs?view=rev&rev=109866 Log: mod_log_config.c: Use iovecs to write the log line to eliminate a memcpy Modified: httpd/httpd/trunk/modules/loggers/mod_log_config.c Modified: httpd/httpd/trunk/modules/loggers/mod_log_config.c Url: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/loggers/mod_log_config.c?view=diff&rev=109866&p1=httpd/httpd/trunk/modules/loggers/mod_log_config.c&r1=109865&p2=httpd/httpd/trunk/modules/loggers/mod_log_config.c&r2=109866 ============================================================================== --- httpd/httpd/trunk/modules/loggers/mod_log_config.c (original) +++ httpd/httpd/trunk/modules/loggers/mod_log_config.c Sat Dec 4 23:05:23 2004 @@ -1343,19 +1343,18 @@ apr_size_t len) { - char *str; - char *s; int i; apr_status_t rv; + struct iovec *vec; - str = apr_palloc(r->pool, len + 1); + vec = apr_palloc(r->pool, nelts * sizeof(struct iovec)); - for (i = 0, s = str; i < nelts; ++i) { - memcpy(s, strs[i], strl[i]); - s += strl[i]; + for (i = 0; i < nelts; ++i) { + vec[i].iov_base = strs[i]; + vec[i].iov_len = strl[i]; } - rv = apr_file_write((apr_file_t*)handle, str, &len); + rv = apr_file_writev((apr_file_t*)handle, vec, nelts, &i); return rv; }