Author: hwright
Date: Sun Oct 21 02:28:44 2012
New Revision: 1400558

URL: http://svn.apache.org/viewvc?rev=1400558&view=rev
Log:
Use the session-specific cancellation function/baton for when constructing
Ev2 wrappers in the RA layer, rather than requiring the caller to provide an
additional set.

* subversion/libsvn_ra/ra_loader.c
  (svn_ra_open4): Set the cancel callback and baton in the session.
  (svn_ra__get_commit_ev2): Remove cancel params and use the session-cached
    ones.

* subversion/libsvn_ra/ra_loader.h
  (svn_ra_session_t): Add cancel func and baton members.
 
* subversion/include/private/svn_ra_private.h
  (svn_ra__get_commit_ev2): Remove params.

Modified:
    subversion/trunk/subversion/include/private/svn_ra_private.h
    subversion/trunk/subversion/libsvn_ra/ra_loader.c
    subversion/trunk/subversion/libsvn_ra/ra_loader.h

Modified: subversion/trunk/subversion/include/private/svn_ra_private.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_ra_private.h?rev=1400558&r1=1400557&r2=1400558&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_ra_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_ra_private.h Sun Oct 21 
02:28:44 2012
@@ -208,8 +208,8 @@ typedef svn_error_t *(*svn_ra__get_copys
 
    CB_BATON is the baton used/shared by the above three callbacks.
 
-   CANCEL_FUNC/BATON is a standard cancellation function, and is used for
-   the returned Ev2 editor, and possibly other RA-specific operations.
+   Cancellation is handled through the callbacks provided when SESSION
+   is initially opened.
 
    *EDITOR will be allocated in RESULT_POOL, and all temporary allocations
    will be performed in SCRATCH_POOL.
@@ -226,8 +226,6 @@ svn_ra__get_commit_ev2(svn_editor_t **ed
                        svn_ra__provide_props_cb_t provide_props_cb,
                        svn_ra__get_copysrc_kind_cb_t get_copysrc_kind_cb,
                        void *cb_baton,
-                       svn_cancel_func_t cancel_func,
-                       void *cancel_baton,
                        apr_pool_t *result_pool,
                        apr_pool_t *scratch_pool);
 

Modified: subversion/trunk/subversion/libsvn_ra/ra_loader.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra/ra_loader.c?rev=1400558&r1=1400557&r2=1400558&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/trunk/subversion/libsvn_ra/ra_loader.c Sun Oct 21 02:28:44 2012
@@ -469,6 +469,8 @@ svn_error_t *svn_ra_open4(svn_ra_session
 
   /* Create the session object. */
   session = apr_pcalloc(sesspool, sizeof(*session));
+  session->cancel_func = callbacks->cancel_func;
+  session->cancel_baton = callback_baton;
   session->vtable = vtable;
   session->pool = sesspool;
 
@@ -1306,8 +1308,6 @@ svn_ra__get_commit_ev2(svn_editor_t **ed
                        svn_ra__provide_props_cb_t provide_props_cb,
                        svn_ra__get_copysrc_kind_cb_t get_copysrc_kind_cb,
                        void *cb_baton,
-                       svn_cancel_func_t cancel_func,
-                       void *cancel_baton,
                        apr_pool_t *result_pool,
                        apr_pool_t *scratch_pool)
 {
@@ -1332,7 +1332,7 @@ svn_ra__get_commit_ev2(svn_editor_t **ed
                                provide_props_cb,
                                get_copysrc_kind_cb,
                                cb_baton,
-                               cancel_func, cancel_baton,
+                               session->cancel_func, session->cancel_baton,
                                result_pool, scratch_pool));
     }
 
@@ -1350,7 +1350,7 @@ svn_ra__get_commit_ev2(svn_editor_t **ed
                            provide_props_cb,
                            get_copysrc_kind_cb,
                            cb_baton,
-                           cancel_func, cancel_baton,
+                           session->cancel_func, session->cancel_baton,
                            result_pool, scratch_pool));
 }
 

Modified: subversion/trunk/subversion/libsvn_ra/ra_loader.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra/ra_loader.h?rev=1400558&r1=1400557&r2=1400558&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra/ra_loader.h (original)
+++ subversion/trunk/subversion/libsvn_ra/ra_loader.h Sun Oct 21 02:28:44 2012
@@ -330,6 +330,10 @@ typedef struct svn_ra__vtable_t {
 struct svn_ra_session_t {
   const svn_ra__vtable_t *vtable;
 
+  /* Cancellation handlers consumers may want to use. */
+  svn_cancel_func_t cancel_func;
+  void *cancel_baton;
+
   /* Pool used to manage this session. */
   apr_pool_t *pool;
 


Reply via email to