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

Re: [Issue 2297] upgrade to Neon 0.25.0

From: Joe Orton <joe_at_manyfish.co.uk>
Date: 2005-05-20 19:32:22 CEST

On Fri, May 20, 2005 at 09:52:56AM -0500, Karl Fogel wrote:
> If you want to commit after updating those changelog entries, that's
> fine. Or if you'd like to just post them and have me commit, that's
> fine too; I am at your service. I can even try to write the log bits
> myself, if you want, though I'm afraid I might miss some detail in the
> diff-between-the-diffs.

I'd prefer that you commit it since I'm not subscribed to dev@svn at the
moment so might miss any followup. I've attached a "v7" patch with an
updated log message and a few tweaks since v6 - I think this covers
everything. The output of "interdiff" between v4 and v7 is inline
below, for reference:

diff -u subversion/libsvn_ra_dav/ra_dav.h subversion/libsvn_ra_dav/ra_dav.h
--- subversion/libsvn_ra_dav/ra_dav.h (working copy)
+++ subversion/libsvn_ra_dav/ra_dav.h (working copy)
@@ -143,6 +143,9 @@
   /* If <D:error> is returned, here's where the parsed result goes. */
   svn_error_t *err;
 
+ /* The neon request being executed */
+ ne_request *request;
+
   /* A place for allocating fields in this structure. */
   apr_pool_t *pool;
 };
diff -u subversion/libsvn_ra_dav/session.c subversion/libsvn_ra_dav/session.c
--- subversion/libsvn_ra_dav/session.c (working copy)
+++ subversion/libsvn_ra_dav/session.c (working copy)
@@ -917,7 +917,10 @@
   if ((strcmp(method, "LOCK") == 0)
       || (strcmp(method, "UNLOCK") == 0)
       || (strcmp(method, "PROPFIND") == 0))
- lrb->method = apr_pstrdup(lrb->pool, method);
+ {
+ lrb->method = apr_pstrdup(lrb->pool, method);
+ lrb->request = req;
+ }
 }
 
 
@@ -1003,9 +1006,9 @@
   if ((strcmp(lrb->method, "LOCK") == 0)
       || (strcmp(lrb->method, "PROPFIND") == 0))
     {
- char *val;
+ const char *val;
 
- val = (char *)ne_get_response_header(req, SVN_DAV_CREATIONDATE_HEADER);
+ val = ne_get_response_header(req, SVN_DAV_CREATIONDATE_HEADER);
       if (val)
         {
           svn_error_t *err = svn_time_from_cstring(&(lrb->creation_date),
@@ -1020,7 +1023,7 @@
             }
         }
 
- val = (char *)ne_get_response_header(req, SVN_DAV_LOCK_OWNER_HEADER);
+ val = ne_get_response_header(req, SVN_DAV_LOCK_OWNER_HEADER);
       if (val)
         lrb->lock_owner = apr_pstrdup(lrb->pool, val);
     }
@@ -1371,6 +1374,16 @@
 
   if (lock)
     {
+#if SVN_NEON_0_25_0
+ /* The post_send hook has not run at this stage; so grab the
+ * response headers early. */
+ if (post_send_hook(rb->lrb->request, rb->lrb,
+ ne_get_status(rb->lrb->request)))
+ {
+ return;
+ }
+#endif
+
       if (!rb->lrb->lock_owner || !rb->lrb->creation_date)
         {
           rb->err = svn_error_create(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
diff -u subversion/libsvn_ra_dav/commit.c subversion/libsvn_ra_dav/commit.c
--- subversion/libsvn_ra_dav/commit.c (working copy)
+++ subversion/libsvn_ra_dav/commit.c (working copy)
@@ -451,7 +451,11 @@
   char **location = userdata;
 
   if (location)
- *location = (char *)ne_get_response_header(request, "location");
+ {
+ const char *val = ne_get_response_header(request, "location");
+ if (val)
+ *location = strdup(val);
+ }
 
   return SVN_NO_ERROR;
 }
diff -u subversion/libsvn_ra_dav/fetch.c subversion/libsvn_ra_dav/fetch.c
--- subversion/libsvn_ra_dav/fetch.c (working copy)
+++ subversion/libsvn_ra_dav/fetch.c (working copy)
@@ -2862,10 +2862,17 @@
   /* we're done with the file */
   (void) apr_file_close(rb->tmpfile);
 
+ /* rb->err contains the relevant error if the response was aborted
+ * by a callback returning NE_XML_ABORT; always return that error if
+ * present. */
+ if (rb->err != NULL)
+ {
+ if (err)
+ svn_error_clear(err);
+ return rb->err;
+ }
   if (err != NULL)
     return err;
- if (rb->err != NULL)
- return rb->err;
 
   /* We got the whole HTTP response thing done. *Whew*. Our edit
      baton should have been closed by now, so return a failure if it
diff -u subversion/libsvn_ra_dav/util.c subversion/libsvn_ra_dav/util.c
--- subversion/libsvn_ra_dav/util.c (working copy)
+++ subversion/libsvn_ra_dav/util.c (working copy)
@@ -24,6 +24,7 @@
 #include <ne_socket.h>
 #include <ne_uri.h>
 #include <ne_compress.h>
+#include <ne_basic.h>
 
 #include "svn_pools.h"
 #include "svn_path.h"
@@ -306,8 +307,23 @@
                                  ne_request *req,
                                  const ne_status *st)
 {
+#if SVN_NEON_0_25_0
+ ne_content_type ctype;
+
+ /* Only accept non-2xx responses with text/xml content-type */
+ if (st->klass != 2 && ne_get_content_type(req, &ctype) == 0)
+ {
+ int is_xml =
+ (strcmp(ctype.type, "text") == 0 && strcmp(ctype.subtype, "xml") == 0);
+ ne_free(ctype.value);
+ return is_xml;
+ }
+ else
+ return 0;
+#else
   /* Only accept the body-response if the HTTP status code is *not* 2XX. */
   return (st->klass != 2);
+#endif
 }
 
 
only in patch2:
unchanged:
--- subversion/libsvn_ra_dav/file_revs.c (revision 14779)
+++ subversion/libsvn_ra_dav/file_revs.c (working copy)
@@ -358,8 +358,17 @@
   if (http_status == 501)
     return svn_error_create (SVN_ERR_RA_NOT_IMPLEMENTED, err,
                              _("'get-file-revs' REPORT not implemented"));
+
+ /* rb.err contains the relevant error if the response was aborted by
+ * a callback returning NE_XML_ABORT; always return that error if
+ * present. */
+ if (rb.err != NULL)
+ {
+ if (err)
+ svn_error_clear (err);
+ return rb.err;
+ }
   SVN_ERR (err);
- SVN_ERR (rb.err);
 
   /* Caller expects at least one revision. Signal error otherwise. */
   if (!SVN_IS_VALID_REVNUM(rb.revnum))

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

Received on Fri May 20 19:35:10 2005

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