You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/09/21 15:39:32 UTC

svn commit: r999408 - in /subversion/branches/1.6.x: ./ CHANGES STATUS subversion/libsvn_ra_serf/commit.c subversion/libsvn_ra_serf/ra_serf.h subversion/libsvn_ra_serf/util.c subversion/tests/cmdline/merge_tests.py

Author: hwright
Date: Tue Sep 21 13:39:31 2010
New Revision: 999408

URL: http://svn.apache.org/viewvc?rev=999408&view=rev
Log:
Reintegrate the 1.6.x-r879757 branch:

 * r879757, r880320, r943796
   Let ra_serf work with current serf releases.
   Justification:
     Having a dud client is bad. This seems to be the minimal required changes.
   Backport branch:
     ^/subversion/branches/1.6.x-r879757
   Notes:
     r879757 is the main fix.  r880320 is a follow up fix.  r943796 ensures
     connection resets are treated the same.
     This change passes davautocheck as of serf 0.7.0.  (serf 0.4.0-0.6.1
     will not work with 1.6.x without fix introduced in r1401 in serf.)
   Votes:
     +1: jerenkrantz, lgo, rhuijben

Modified:
    subversion/branches/1.6.x/   (props changed)
    subversion/branches/1.6.x/CHANGES   (props changed)
    subversion/branches/1.6.x/STATUS
    subversion/branches/1.6.x/subversion/libsvn_ra_serf/commit.c
    subversion/branches/1.6.x/subversion/libsvn_ra_serf/ra_serf.h
    subversion/branches/1.6.x/subversion/libsvn_ra_serf/util.c
    subversion/branches/1.6.x/subversion/tests/cmdline/merge_tests.py   (props changed)

Propchange: subversion/branches/1.6.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Sep 21 13:39:31 2010
@@ -39,6 +39,7 @@
 /subversion/branches/1.6.x-r39557:879668-879907
 /subversion/branches/1.6.x-r39887:880024-880066
 /subversion/branches/1.6.x-r40452:880530-890996
+/subversion/branches/1.6.x-r879757:987687-999407
 /subversion/branches/1.6.x-r889840:889888-890974
 /subversion/branches/1.6.x-r891672:891676-923748
 /subversion/branches/1.6.x-r892050:923839-923856

Propchange: subversion/branches/1.6.x/CHANGES
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Sep 21 13:39:31 2010
@@ -39,6 +39,7 @@
 /subversion/branches/1.6.x-r39557/CHANGES:879668-879907
 /subversion/branches/1.6.x-r39887/CHANGES:880024-880066
 /subversion/branches/1.6.x-r40452/CHANGES:880530-890996
+/subversion/branches/1.6.x-r879757/CHANGES:987687-999407
 /subversion/branches/1.6.x-r889840/CHANGES:889888-890974
 /subversion/branches/1.6.x-r891672/CHANGES:891676-923748
 /subversion/branches/1.6.x-r892050/CHANGES:923839-923856

Modified: subversion/branches/1.6.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.6.x/STATUS?rev=999408&r1=999407&r2=999408&view=diff
==============================================================================
--- subversion/branches/1.6.x/STATUS (original)
+++ subversion/branches/1.6.x/STATUS Tue Sep 21 13:39:31 2010
@@ -313,17 +313,3 @@ Veto-blocked changes:
 
 Approved changes:
 =================
-
- * r879757, r880320, r943796
-   Let ra_serf work with current serf releases.
-   Justification:
-     Having a dud client is bad. This seems to be the minimal required changes.
-   Backport branch:
-     ^/subversion/branches/1.6.x-r879757
-   Notes:
-     r879757 is the main fix.  r880320 is a follow up fix.  r943796 ensures
-     connection resets are treated the same.
-     This change passes davautocheck as of serf 0.7.0.  (serf 0.4.0-0.6.1
-     will not work with 1.6.x without fix introduced in r1401 in serf.)
-   Votes:
-     +1: jerenkrantz, lgo, rhuijben

Modified: subversion/branches/1.6.x/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.6.x/subversion/libsvn_ra_serf/commit.c?rev=999408&r1=999407&r2=999408&view=diff
==============================================================================
--- subversion/branches/1.6.x/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/1.6.x/subversion/libsvn_ra_serf/commit.c Tue Sep 21 13:39:31 2010
@@ -1169,6 +1169,12 @@ delete_entry(const char *path,
     {
       svn_error_clear(err);
 
+#if SERF_VERSION_AT_LEAST(0, 4, 0)
+      /* An error has been registered on the connection. Reset the thing
+         so that we can use it again.  */
+      serf_connection_reset(handler->conn->conn);
+#endif
+
       handler->body_delegate = create_delete_body;
       handler->body_delegate_baton = delete_ctx;
       handler->body_type = "text/xml";
@@ -1873,6 +1879,12 @@ abort_edit(void *edit_baton,
   if (! ctx->activity_url)
     return SVN_NO_ERROR;
 
+#if SERF_VERSION_AT_LEAST(0, 4, 0)
+  /* An error occurred on conns[0]. serf 0.4.0 remembers that the connection
+     had a problem. We need to reset it, in order to use it again.  */
+  serf_connection_reset(ctx->session->conns[0]->conn);
+#endif
+
   /* DELETE our aborted activity */
   handler = apr_pcalloc(pool, sizeof(*handler));
   handler->method = "DELETE";

Modified: subversion/branches/1.6.x/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.6.x/subversion/libsvn_ra_serf/ra_serf.h?rev=999408&r1=999407&r2=999408&view=diff
==============================================================================
--- subversion/branches/1.6.x/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/1.6.x/subversion/libsvn_ra_serf/ra_serf.h Tue Sep 21 13:39:31 2010
@@ -303,10 +303,19 @@ static const svn_ra_serf__dav_props_t hr
 
 /** Serf utility functions **/
 
+#if SERF_VERSION_AT_LEAST(0, 4, 0)
+apr_status_t
+svn_ra_serf__conn_setup(apr_socket_t *sock,
+                        serf_bucket_t **read_bkt,
+                        serf_bucket_t **write_bkt,
+                        void *baton,
+                        apr_pool_t *pool);
+#else
 serf_bucket_t *
 svn_ra_serf__conn_setup(apr_socket_t *sock,
                         void *baton,
                         apr_pool_t *pool);
+#endif
 
 serf_bucket_t*
 svn_ra_serf__accept_response(serf_request_t *request,

Modified: subversion/branches/1.6.x/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.6.x/subversion/libsvn_ra_serf/util.c?rev=999408&r1=999407&r2=999408&view=diff
==============================================================================
--- subversion/branches/1.6.x/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/1.6.x/subversion/libsvn_ra_serf/util.c Tue Sep 21 13:39:31 2010
@@ -222,35 +222,56 @@ load_authorities(svn_ra_serf__connection
   return SVN_NO_ERROR;
 }
 
+
+#if SERF_VERSION_AT_LEAST(0, 4, 0)
+/* This ugly ifdef construction can be cleaned up as soon as serf >= 0.4
+   gets the minimum supported serf version! */
+
+/* svn_ra_serf__conn_setup is a callback for serf. This function 
+   creates a read bucket and will wrap the write bucket if SSL
+   is needed. */
+apr_status_t
+svn_ra_serf__conn_setup(apr_socket_t *sock,
+                        serf_bucket_t **read_bkt,
+                        serf_bucket_t **write_bkt,
+                        void *baton,
+                        apr_pool_t *pool)
+{
+  serf_bucket_t *wb = NULL;
+#else
+/* This is the old API, for compatibility with serf
+   versions <= 0.3. */
 serf_bucket_t *
 svn_ra_serf__conn_setup(apr_socket_t *sock,
                         void *baton,
                         apr_pool_t *pool)
 {
-  serf_bucket_t *bucket;
+#endif
+  serf_bucket_t *rb = NULL;
   svn_ra_serf__connection_t *conn = baton;
-
-  bucket = serf_context_bucket_socket_create(conn->session->context,
-                                             sock, conn->bkt_alloc);
-
+  
+  rb = serf_context_bucket_socket_create(conn->session->context,
+                                         sock, conn->bkt_alloc);
+  
   if (conn->using_ssl)
     {
-      bucket = serf_bucket_ssl_decrypt_create(bucket, conn->ssl_context,
-                                              conn->bkt_alloc);
+      /* input stream */
+      rb = serf_bucket_ssl_decrypt_create(rb, conn->ssl_context,
+                                          conn->bkt_alloc);
       if (!conn->ssl_context)
         {
-          conn->ssl_context = serf_bucket_ssl_decrypt_context_get(bucket);
-
+          conn->ssl_context = serf_bucket_ssl_encrypt_context_get(rb);
+  
           serf_ssl_client_cert_provider_set(conn->ssl_context,
                                             svn_ra_serf__handle_client_cert,
                                             conn, conn->session->pool);
           serf_ssl_client_cert_password_set(conn->ssl_context,
                                             svn_ra_serf__handle_client_cert_pw,
                                             conn, conn->session->pool);
-
           serf_ssl_server_cert_callback_set(conn->ssl_context,
                                             ssl_server_cert,
                                             conn);
+
           /* See if the user wants us to trust "default" openssl CAs. */
           if (conn->session->trust_default_ca)
             {
@@ -270,10 +291,22 @@ svn_ra_serf__conn_setup(apr_socket_t *so
                 }
             }
         }
+#if SERF_VERSION_AT_LEAST(0, 4, 0)
+        /* output stream */
+        *write_bkt = serf_bucket_ssl_encrypt_create(*write_bkt, conn->ssl_context,
+                                                  conn->bkt_alloc);
+#endif
     }
 
-  return bucket;
+#if SERF_VERSION_AT_LEAST(0, 4, 0)
+  *read_bkt = rb;
+
+  return APR_SUCCESS;
+}
+#else  
+  return rb;
 }
+#endif
 
 serf_bucket_t*
 svn_ra_serf__accept_response(serf_request_t *request,
@@ -481,6 +514,7 @@ svn_ra_serf__setup_serf_req(serf_request
   if (conn->session->proxy_auth_protocol)
     conn->session->proxy_auth_protocol->setup_request_func(conn, hdrs_bkt);
 
+#if ! SERF_VERSION_AT_LEAST(0, 4, 0)
   /* Set up SSL if we need to */
   if (conn->using_ssl)
     {
@@ -498,6 +532,7 @@ svn_ra_serf__setup_serf_req(serf_request
                                             conn, conn->session->pool);
         }
     }
+#endif
 
   /* Set up Proxy settings */
   if (conn->session->using_proxy)

Propchange: subversion/branches/1.6.x/subversion/tests/cmdline/merge_tests.py
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Sep 21 13:39:31 2010
@@ -37,6 +37,7 @@
 /subversion/branches/1.6.x-r39557/subversion/tests/cmdline/merge_tests.py:879668-879907
 /subversion/branches/1.6.x-r39887/subversion/tests/cmdline/merge_tests.py:880024-880066
 /subversion/branches/1.6.x-r40452/subversion/tests/cmdline/merge_tests.py:880530-890996
+/subversion/branches/1.6.x-r879757/subversion/tests/cmdline/merge_tests.py:987687-999407
 /subversion/branches/1.6.x-r889840/subversion/tests/cmdline/merge_tests.py:889888-890974
 /subversion/branches/1.6.x-r891672/subversion/tests/cmdline/merge_tests.py:891676-923748
 /subversion/branches/1.6.x-r892050/subversion/tests/cmdline/merge_tests.py:923839-923856