[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Turn on deflate in the client

From: Sander Striker <striker_at_apache.org>
Date: 2002-02-15 11:46:40 CET

Hi,

The problem we saw previously appeared to be on the server side.
Thanks to Justins patch, this seems to work fine now (I did a
full checkout without problems).

This patch will enable subversion to handle compressed responses
from the server. As Joe pointed out, the util.c patch could be
left out, since that gives compressed OPTIONS responses. I'm
not completely familiar with how it all ties together, but are
the reports fetched in fetch.c or in util.c? If the latter,
I think it makes sense to leave the compression in.

Sander

---
Log:
Thanks to Kevin Pilch-Bisson for pointing to the locations that needed
patching.
* subversion/libsvn_ra_dav/fetch.c:
  
  Add a new include: ne_compress.h.
  (custom_get_request): Enable compression when NEON_ZLIB is defined.
* subversion/libsvn_ra_dav/util.c:
  
  Add a new include: ne_compress.h.
  (svn_ra_dav__parsed_request): Enable compression when NEON_ZLIB is defined.
Index: ./subversion/libsvn_ra_dav/fetch.c
===================================================================
--- ./subversion/libsvn_ra_dav/fetch.c
+++ ./subversion/libsvn_ra_dav/fetch.c	Thu Feb 14 20:09:19 2002
@@ -33,6 +33,7 @@
 #include <ne_props.h>
 #include <ne_xml.h>
 #include <ne_request.h>
+#include <ne_compress.h>
 
 #include "svn_error.h"
 #include "svn_pools.h"
@@ -440,6 +441,9 @@
   ne_request *req;
   int rv;
   int code;
+#if defined(NEON_ZLIB)
+  ne_decompress *decompress;
+#endif /* defined(NEON_ZLIB) */
 
   /* See if we can get a version URL for this resource. This will refer to
      what we already have in the working copy, thus we can get a diff against
@@ -473,13 +477,22 @@
     }
 
   /* add in a reader to capture the body of the response. */
+#if !defined(NEON_ZLIB)
   ne_add_response_body_reader(req, ne_accept_2xx, reader, &cgc);
+#else /* defined(NEON_ZLIB) */
+  decompress = ne_decompress_reader(req, ne_accept_2xx, reader, &cgc);
+#endif /* defined(NEON_ZLIB) */
 
   /* complete initialization of the body reading context */
   cgc.subctx = subctx;
 
   /* do the response now */
   rv = ne_request_dispatch(req);
+
+#if defined(NEON_ZLIB)
+  ne_decompress_destroy(decompress);
+#endif /* defined(NEON_ZLIB) */
+
   code = ne_get_status(req)->code;
   ne_request_destroy(req);
 
Index: ./subversion/libsvn_ra_dav/util.c
===================================================================
--- ./subversion/libsvn_ra_dav/util.c
+++ ./subversion/libsvn_ra_dav/util.c	Thu Feb 14 20:24:41 2002
@@ -20,6 +20,7 @@
 #include <apr_want.h>
 
 #include <ne_uri.h>
+#include <ne_compress.h>
 
 #include "svn_string.h"
 
@@ -96,6 +97,9 @@
   int code;
   const char *msg;
   svn_error_t *err;
+#if defined(NEON_ZLIB)
+  ne_decompress *decompress;
+#endif /* defined(NEON_ZLIB) */
 
   /* create/prep the request */
   req = ne_request_create(ras->sess, method, url);
@@ -112,10 +116,20 @@
   parser = ne_xml_create();
   ne_xml_push_handler(parser, elements,
                        validate_cb, startelm_cb, endelm_cb, baton);
+
+#if !defined(NEON_ZLIB)
   ne_add_response_body_reader(req, ne_accept_2xx, ne_xml_parse_v, parser);
+#else /* defined(NEON_ZLIB) */
+  decompress = ne_decompress_reader(req, ne_accept_2xx, ne_xml_parse_v, parser);
+#endif /* defined(NEON_ZLIB) */
 
   /* run the request and get the resulting status code. */
   rv = ne_request_dispatch(req);
+
+#if defined(NEON_ZLIB)
+  ne_decompress_destroy(decompress);
+#endif /* defined(NEON_ZLIB) */
+
   code = ne_get_status(req)->code;
   ne_request_destroy(req);
 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Sat Oct 21 14:37:08 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.