Commit c4d14626 authored by Paul Querna's avatar Paul Querna
Browse files

* 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@110069 13f79535-47bb-0310-9956-ffa450edef68
parent 70efcee7
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -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;
}