subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1563836 - in /subversion/trunk/subversion: bindings/javahl/native/OperationContext.cpp bindings/javahl/native/OperationContext.h include/svn_ra.h libsvn_ra_svn/client.c tests/libsvn_ra/ra-test.c
Date Mon, 03 Feb 2014 11:19:35 GMT
Author: rhuijben
Date: Mon Feb  3 11:19:35 2014
New Revision: 1563836

URL: http://svn.apache.org/r1563836
Log:
Extend the ra_svn tunnel setup api with a cancel function to allow
implementations to provide (GUI) clients with timely cancellation on
timeouts. These clients can't depend on the signal handling breaking
blocking IO operations.

* subversion/bindings/javahl/native/OperationContext.cpp
* subversion/bindings/javahl/native/OperationContext.h
  (OperationContext::openTunnel): Add cancel callback and baton arguments.

* subversion/include/svn_ra.h
  (svn_ra_open_tunnel_func_t): Add cancel callback and baton arguments.

* subversion/libsvn_ra_svn/client.c
  (open_session): Update caller.
     [Reviewers: Yes, all the common callbacks share a baton value here.]

* subversion/tests/libsvn_ra/ra-test.c
  (open_tunnel): Add cancel callback and baton arguments.

Modified:
    subversion/trunk/subversion/bindings/javahl/native/OperationContext.cpp
    subversion/trunk/subversion/bindings/javahl/native/OperationContext.h
    subversion/trunk/subversion/include/svn_ra.h
    subversion/trunk/subversion/libsvn_ra_svn/client.c
    subversion/trunk/subversion/tests/libsvn_ra/ra-test.c

Modified: subversion/trunk/subversion/bindings/javahl/native/OperationContext.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/OperationContext.cpp?rev=1563836&r1=1563835&r2=1563836&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/OperationContext.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/OperationContext.cpp Mon Feb  3 11:19:35
2014
@@ -580,6 +580,7 @@ OperationContext::openTunnel(svn_stream_
                              void *tunnel_baton,
                              const char *tunnel_name, const char *user,
                              const char *hostname, int port,
+                             svn_cancel_func_t cancel_func, void *cancel_baton,
                              apr_pool_t *pool)
 {
   TunnelContext *tc = new TunnelContext(pool);

Modified: subversion/trunk/subversion/bindings/javahl/native/OperationContext.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/OperationContext.h?rev=1563836&r1=1563835&r2=1563836&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/OperationContext.h (original)
+++ subversion/trunk/subversion/bindings/javahl/native/OperationContext.h Mon Feb  3 11:19:35
2014
@@ -74,6 +74,7 @@ class OperationContext
       void *tunnel_baton,
       const char *tunnel_name, const char *user,
       const char *hostname, int port,
+      svn_cancel_func_t cancel_func, void *cancel_baton,
       apr_pool_t *pool);
 
   static void closeTunnel(

Modified: subversion/trunk/subversion/include/svn_ra.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_ra.h?rev=1563836&r1=1563835&r2=1563836&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_ra.h (original)
+++ subversion/trunk/subversion/include/svn_ra.h Mon Feb  3 11:19:35 2014
@@ -312,6 +312,9 @@ typedef void (*svn_ra_close_tunnel_func_
  * If @a *close_func is set it will be called with @a close_baton when
  * the tunnel is closed.
  *
+ * The optional @a cancel_func callback can be invoked as usual to allow
+ * the user to preempt potentially lengthy operations.
+ *
  * @a tunnel_baton is the baton as set in the callbacks.
  *
  * @since New in 1.9.
@@ -322,6 +325,7 @@ typedef svn_error_t *(*svn_ra_open_tunne
     void *tunnel_baton,
     const char *tunnel_name, const char *user,
     const char *hostname, int port,
+    svn_cancel_func_t cancel_func, void *cancel_baton,
     apr_pool_t *pool);
 
 

Modified: subversion/trunk/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_svn/client.c?rev=1563836&r1=1563835&r2=1563836&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/trunk/subversion/libsvn_ra_svn/client.c Mon Feb  3 11:19:35 2014
@@ -652,6 +652,7 @@ static svn_error_t *open_session(svn_ra_
                       &td->close_tunnel, &td->tunnel_context,
                       callbacks->tunnel_baton, tunnel_name,
                       uri->user, uri->hostname, uri->port,
+                      callbacks->cancel_func, callbacks_baton,
                       pool));
 
           apr_pool_cleanup_register(pool, td, close_tunnel_cleanup,

Modified: subversion/trunk/subversion/tests/libsvn_ra/ra-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_ra/ra-test.c?rev=1563836&r1=1563835&r2=1563836&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_ra/ra-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_ra/ra-test.c Mon Feb  3 11:19:35 2014
@@ -117,6 +117,7 @@ open_tunnel(svn_stream_t **request, svn_
             void *tunnel_baton,
             const char *tunnel_name, const char *user,
             const char *hostname, int port,
+            svn_cancel_func_t cancel_func, void *cancel_baton,
             apr_pool_t *pool)
 {
   svn_node_kind_t kind;



Mime
View raw message