[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-14 20:43:53 CET

Hi,

This patch gave me the following error on a server with mod_deflate enabled:

A trunk/subversion/tests/libsvn_fs/fs-test.c

subversion/libsvn_ra_dav/fetch.c:1044
svn_error: #21082 : <RA layer request failed>
could not checkout a file

subversion/libsvn_ra_dav/util.c:77
svn_error: #21082 : <RA layer request failed>
fetching a file: Could not read response body: connection was closed by server.

Maybe someone can look into this? I'm not seeing the problem just yet.
Joe, did I put the neon calls in the right places (esp. the destroy)?

Sander

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