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

[PATCH] fix progress callback for ra_svn

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Sat, 02 Aug 2008 09:40:17 +0200

Hi,

Some users reported that TSVN shows unbelievable amounts of bytes
transferred for all operations, but only when used with svn://.

I've tried ra_serf and ra_neon, those work ok. But ra_svn passes the sum
of bytes transferred to the progress callback, while neon and serf pass
only the bytes just transferred to the callback (they don't sum up the
transferred bytes).

I'd like to have all three layers call the progress callback the same
way. Since adjusting ra_neon to do the same as ra_svn does would require
a change in the neon library, I think it's best to change ra_svn (also,
the callback was inspired by the neon progress callback, so I'd say that
it's ra_svn which does it wrong).

the attached patch fixes this.

I like to propose this also for backporting to 1.5.x.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net

[[[
count the bytes transferred the same way as ra_serf and ra_neon:
* subversion/libsvn_ra_svn/marshal.c
  (writebuf_output)
  (readbuf_input): do not sum up the bytes transferred
]]]
Index: subversion/libsvn_ra_svn/marshal.c
===================================================================
--- subversion/libsvn_ra_svn/marshal.c (revision 32354)
+++ subversion/libsvn_ra_svn/marshal.c (working copy)
@@ -175,7 +175,7 @@
       if (session)
         {
           const svn_ra_callbacks2_t *cb = session->callbacks;
- session->bytes_written += count;
+ session->bytes_written = count;
 
           if (cb && cb->progress_func)
             (cb->progress_func)(session->bytes_written + session->bytes_read,
@@ -266,7 +266,7 @@
   if (session)
     {
       const svn_ra_callbacks2_t *cb = session->callbacks;
- session->bytes_read += *len;
+ session->bytes_read = *len;
 
       if (cb && cb->progress_func)
         (cb->progress_func)(session->bytes_read + session->bytes_written,

Received on 2008-08-02 09:40:41 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.