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

Re: [PATCH] notification callbacks for network data transfers (V2)

From: Branko Čibej <brane_at_xbc.nu>
Date: 2005-08-26 23:29:52 CEST

Stefan Küng wrote:

> New patch which uses Branko's comments to fix what was broken.

Sorry this took so long... The patch looks good, I've a few minor comments

I think we could commit this with some minor changes, even if we only
get progress info fo ra_dav for now. Could you update the patch to
trunk? Thaks.

I wish we could have some tests for this, but I see no easy way to add
them...

>[[[
>Implement a reduced version of issue #901 for DAV connections.
>
>* subversion/include/svn_progress.h
> (new file): typedefs for the notification callback function.
>* subversion/include/svn_client.h
> (svn_client_ctx_t): extend the client context structure with the
> callback function and baton.
>* subversion/include/svn_ra.h
> (svn_ra_callbacks_t): deprecate the structure
> (svn_ra_callbacks2_t): same as svn_ra_callbacks_t, but with new
> progress notification callback and baton.
>* subversion/libsvn_ra/ra_loader.c
> (svn_ra_open): deprecate function, calls svn_ra_open2()
> (svn_ra_open2): new function which takes an svn_ra_callbacks2_t
> instead of an svn_ra_callback_t.
>* subversion/libsvn_client/ra.c
> (svn_client__open_ra_session_internal): set the progress notification
> callback and baton.
>* subversion/libsvn_ra_dav/session.c
> (svn_ra_dav__neonprogress): new function. The callback function neon
> calls during network data transfers.
> (svn_ra_dav__open): set the neon callback function for the session.
>* subversion/libsvn_client/copy.c
> (repos_to_repos_copy): correct comment
>]]]
>
>
Just a comment for the future: please use whole sentences in the log
message; for example,

* subversion/libsvn_client/copy.c
  (repos_to_repos_copy): Correct comment.

You also put lots of tabs in the code where there weren't any before.

>Index: subversion/include/svn_client.h
>===================================================================
>--- subversion/include/svn_client.h (Revision 15819)
>+++ subversion/include/svn_client.h (Arbeitskopie)
>@@ -40,6 +40,7 @@
> #include "svn_error.h"
> #include "svn_opt.h"
> #include "svn_version.h"
>+#include "svn_progress.h"
>
>
> #ifdef __cplusplus
>@@ -451,6 +452,11 @@
> /** notification baton for notify_func2().
> * @since New in 1.2. */
> void *notify_baton2;
>+
>+ /** notification callback and baton for network progress information.
>+ * @since New in 1.3. */
>+ svn_progress_notify_func_t progress_func;
>+ void *progress_baton;
> } svn_client_ctx_t;
>
>
The progress_baton field needs a docstring, too. Same in
svn_ra_callbacks2_t.

>Index: subversion/libsvn_ra_dav/session.c
>===================================================================
>--- subversion/libsvn_ra_dav/session.c (Revision 15819)
>+++ subversion/libsvn_ra_dav/session.c (Arbeitskopie)
>@@ -561,8 +561,16 @@
> #endif /* if/else SVN_NEON_0_25_0 */
> }
>
>+static void
>+svn_ra_dav__neonprogress(void * baton, off_t progress, off_t total)
>+{
>+ const svn_ra_callbacks_t * callbacks = (svn_ra_callbacks_t *)baton;
>+ if (callbacks->progress_func)
>+ {
>+ callbacks->progress_func(progress, total, callbacks->progress_baton);
>+ }
>+}
>
>
This function's name shouldn't actually have a svn_ra_dav__ prefix --
it's a static function, not library-private.

-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Aug 26 23:32:46 2005

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.