]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* mod_log_config.c: Revert r109866 which used apr_file_writev instead of an
authorPaul Querna <pquerna@apache.org>
Tue, 7 Dec 2004 03:41:18 +0000 (03:41 +0000)
committerPaul Querna <pquerna@apache.org>
Tue, 7 Dec 2004 03:41:18 +0000 (03:41 +0000)
                    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.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@110069 13f79535-47bb-0310-9956-ffa450edef68

modules/loggers/mod_log_config.c

index 95c79e0e8aaa1d8d323cb4d5a62c0a547ab0b99d..96df3fa4347d0810e43527233694fe8c969081cd 100644 (file)
@@ -1343,18 +1343,19 @@ static apr_status_t ap_default_log_writer( request_rec *r,
                            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;
 }