httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r110069 - /httpd/httpd/trunk/modules/loggers/mod_log_config.c
Date Tue, 07 Dec 2004 03:41:19 GMT
Author: pquerna
Date: Mon Dec  6 19:41:18 2004
New Revision: 110069

URL: http://svn.apache.org/viewcvs?view=rev&rev=110069
Log:
* mod_log_config.c: Revert r109866 which used apr_file_writev instead of an 
                    apr_file_write w/ a memcpy. Roy Fielding provided a -1 veto
                    on the commit, based on concerns that writev is not 
                    guaranteed to be atomic like a write.

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=110069&p1=httpd/httpd/trunk/modules/loggers/mod_log_config.c&r1=110068&p2=httpd/httpd/trunk/modules/loggers/mod_log_config.c&r2=110069
==============================================================================
--- httpd/httpd/trunk/modules/loggers/mod_log_config.c	(original)
+++ httpd/httpd/trunk/modules/loggers/mod_log_config.c	Mon Dec  6 19:41:18 2004
@@ -1343,18 +1343,19 @@
                            apr_size_t len)
 
 {
+    char *str;
+    char *s;
     int i;
     apr_status_t rv;
-    struct iovec *vec;
 
-    vec = apr_palloc(r->pool, nelts * sizeof(struct iovec));
+    str = apr_palloc(r->pool, len + 1);
 
-    for (i = 0; i < nelts; ++i) {
-        vec[i].iov_base = strs[i];
-        vec[i].iov_len = strl[i];
+    for (i = 0, s = str; i < nelts; ++i) {
+        memcpy(s, strs[i], strl[i]);
+        s += strl[i];
     }
 
-    rv = apr_file_writev((apr_file_t*)handle, vec, nelts, &i);
+    rv = apr_file_write((apr_file_t*)handle, str, &len);
 
     return rv;
 }

Mime
View raw message