subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
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

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
--- 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;

View raw message