subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kot...@apache.org
Subject svn commit: r1757539 - /subversion/trunk/subversion/mod_dav_svn/repos.c
Date Wed, 24 Aug 2016 15:03:10 GMT
Author: kotkov
Date: Wed Aug 24 15:03:10 2016
New Revision: 1757539

URL: http://svn.apache.org/viewvc?rev=1757539&view=rev
Log:
In mod_dav_svn, update the code responsible for answering to GET requests
with a specified delta base so that it would use apr_brigade_write() instead
of manually creating a bucket and passing it to the output filter stack.

The apr_brigade_write() buffers the data internally before sending it to the
filters.  Buffering is important in this particular case, because our svndiff
handler can emit a noticeable amount of small writes.  And while some of the
httpd's filters have their own buffering, some of them don't.  For instance,
the chunking filter (which is pretty close to the top of the stack) doesn't
do that — so, this resulted in inefficient small chunks of size 4, 5, etc.,
being sent over the wire.

* subversion/mod_dav_svn/repos.c
  (write_to_filter): Use apr_brigade_write() instead of sending a single
   transient bucket to the output filter stack.

Modified:
    subversion/trunk/subversion/mod_dav_svn/repos.c

Modified: subversion/trunk/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/repos.c?rev=1757539&r1=1757538&r2=1757539&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/repos.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/repos.c Wed Aug 24 15:03:10 2016
@@ -3245,16 +3245,14 @@ static svn_error_t *  __attribute__((war
 write_to_filter(void *baton, const char *buffer, apr_size_t *len)
 {
   diff_ctx_t *dc = baton;
-  apr_bucket *bkt;
   apr_status_t status;
 
   /* take the current data and shove it into the filter */
-  bkt = apr_bucket_transient_create(buffer, *len, dc->output->c->bucket_alloc);
-  APR_BRIGADE_INSERT_TAIL(dc->bb, bkt);
-  if ((status = ap_pass_brigade(dc->output, dc->bb)) != APR_SUCCESS) {
+  status = apr_brigade_write(dc->bb, ap_filter_flush, dc->output,
+                             buffer, *len);
+  if (status != APR_SUCCESS)
     return svn_error_create(status, NULL,
                             "Could not write data to filter");
-  }
 
   return SVN_NO_ERROR;
 }



Mime
View raw message