subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject svn commit: r1516453 - in /subversion/trunk/subversion/libsvn_ra_serf: ra_serf.h serf.c
Date Thu, 22 Aug 2013 14:07:17 GMT
Author: ivan
Date: Thu Aug 22 14:07:17 2013
New Revision: 1516453

URL: http://svn.apache.org/r1516453
Log:
Fix progress reporting for ra_serf: serf reports incremental progress while 
svn_ra_progress_notify_func_t() needs total progress of bytes transferred.

* subversion/libsvn_ra_serf/ra_serf.h
  (svn_ra_serf__session_t): Add PROGRESS member to hold number of bytes 
   transferred so far. 

* subversion/libsvn_ra_serf/serf.c
  (svn_ra_serf__progress): Accumulate bytes transferred so far in session 
   and use for progress_func callback.

Modified:
    subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h
    subversion/trunk/subversion/libsvn_ra_serf/serf.c

Modified: subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h?rev=1516453&r1=1516452&r2=1516453&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/ra_serf.h Thu Aug 22 14:07:17 2013
@@ -159,6 +159,9 @@ struct svn_ra_serf__session_t {
   svn_ra_progress_notify_func_t progress_func;
   void *progress_baton;
 
+  /* Total number of transferred so far. */
+  apr_off_t progress;
+
   /* Callback function to handle cancellation */
   svn_cancel_func_t cancel_func;
   void *cancel_baton;

Modified: subversion/trunk/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/serf.c?rev=1516453&r1=1516452&r2=1516453&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/serf.c Thu Aug 22 14:07:17 2013
@@ -407,10 +407,12 @@ load_config(svn_ra_serf__session_t *sess
 static void
 svn_ra_serf__progress(void *progress_baton, apr_off_t read, apr_off_t written)
 {
-  const svn_ra_serf__session_t *serf_sess = progress_baton;
+  svn_ra_serf__session_t *serf_sess = progress_baton;
+  serf_sess->progress += read + written;
+
   if (serf_sess->progress_func)
     {
-      serf_sess->progress_func(read + written, -1,
+      serf_sess->progress_func(serf_sess->progress, -1,
                                serf_sess->progress_baton,
                                serf_sess->pool);
     }



Mime
View raw message