You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Erik Huelsmann <eh...@gmail.com> on 2006/11/16 14:49:12 UTC
[PATCH] Implement cancelation callback in ra_serf
Yesterday I wrote a patch to make ra_serf support the cancelation
callback I added to the ra layer in r22294, but then discovered that
serf requires apr 1.x to be built. I still use APR 0.9, so:
Could someone test and commit this patch for me please?
What I do to test if it actually works:
- remove the cancelation callback calls from subversion/svn/log-cmd.c
- don't apply the patch and run svn log against the svn repository
(don't forget to --limit 2000 or some other value depending on
connection speed)
- try to Ctrl-C the application
<Now, this should not stop the log from printing>
- Apply the patch
- Rebuild the client
- run the same log command
- try to Ctrl-C again
=> The application should be (almost instantaniously) interrupted
To that extent I'm wondering if this patch is enough: there should
probably be a callback call somewhere which gets triggered when blocks
of data are being received or sent (which is what ra_dav and ra_svn
do).
Log:
[[[
ra_serf support for the r22294 RA cancelation callback.
* subversion/libsvn_ra_serf/util.c
(svn_ra_serf__run_serf_context): Call the callback before blocking.
]]]
Index: subversion/libsvn_ra_serf/util.c
===================================================================
--- subversion/libsvn_ra_serf/util.c (revision 22313)
+++ subversion/libsvn_ra_serf/util.c (working copy)
@@ -193,6 +193,11 @@
{
int i;
+
+ if (sess->wc_callbacks &&
+ sess->wc_callbacks->cancel_func)
+ SVN_ERR((sess->wc_callbacks->cancel_func)(sess->wc_callback_baton));
+
status = serf_context_run(sess->context, SERF_DURATION_FOREVER, pool);
if (APR_STATUS_IS_TIMEUP(status))
{
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Implement cancelation callback in ra_serf
Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
On 11/16/06, Erik Huelsmann <eh...@gmail.com> wrote:
> > You can always use the autoconf/make based build system instead of serfmake ;-)
>
> That's where I started out! But somehow it didn't work and I ran out of time...
Feel free to post any errors here or (preferably) to
serf-dev@googlegroups.com. But, the autoconf system should work too
as a fallback.
> I'm not actually giving up on building serf yet, but it'd be a shame
> if I could address all ra implementations except serf and that
> addressing it ended up in the long term...
Yah, serfmake works for APR 1.x+ and the autoconf system supports
0.9.x and 1.x. -- justin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Implement cancelation callback in ra_serf
Posted by Erik Huelsmann <eh...@gmail.com>.
On 11/16/06, Garrett Rooney <ro...@electricjellyfish.net> wrote:
> On 11/16/06, Erik Huelsmann <eh...@gmail.com> wrote:
> > On 11/16/06, David Glasser <gl...@mit.edu> wrote:
> > > On 11/16/06, Erik Huelsmann <eh...@gmail.com> wrote:
> > > > Yesterday I wrote a patch to make ra_serf support the cancelation
> > > > callback I added to the ra layer in r22294, but then discovered that
> > > > serf requires apr 1.x to be built. I still use APR 0.9, so:
> > >
> > > I thought Justin made it 0.9-compatible at the summit?
> >
> > Well, the scripts (serfmake?) don't say that (yet?). Maybe I passed it
> > the wrong arguments... I'll have another look tonight.
>
> You can always use the autoconf/make based build system instead of serfmake ;-)
That's where I started out! But somehow it didn't work and I ran out of time...
I'm not actually giving up on building serf yet, but it'd be a shame
if I could address all ra implementations except serf and that
addressing it ended up in the long term...
bye,
Erik.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Implement cancelation callback in ra_serf
Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 11/16/06, Erik Huelsmann <eh...@gmail.com> wrote:
> On 11/16/06, David Glasser <gl...@mit.edu> wrote:
> > On 11/16/06, Erik Huelsmann <eh...@gmail.com> wrote:
> > > Yesterday I wrote a patch to make ra_serf support the cancelation
> > > callback I added to the ra layer in r22294, but then discovered that
> > > serf requires apr 1.x to be built. I still use APR 0.9, so:
> >
> > I thought Justin made it 0.9-compatible at the summit?
>
> Well, the scripts (serfmake?) don't say that (yet?). Maybe I passed it
> the wrong arguments... I'll have another look tonight.
You can always use the autoconf/make based build system instead of serfmake ;-)
-garrett
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Implement cancelation callback in ra_serf
Posted by Erik Huelsmann <eh...@gmail.com>.
On 11/16/06, David Glasser <gl...@mit.edu> wrote:
> On 11/16/06, Erik Huelsmann <eh...@gmail.com> wrote:
> > Yesterday I wrote a patch to make ra_serf support the cancelation
> > callback I added to the ra layer in r22294, but then discovered that
> > serf requires apr 1.x to be built. I still use APR 0.9, so:
>
> I thought Justin made it 0.9-compatible at the summit?
Well, the scripts (serfmake?) don't say that (yet?). Maybe I passed it
the wrong arguments... I'll have another look tonight.
bye,
Erik.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Implement cancelation callback in ra_serf
Posted by David Glasser <gl...@mit.edu>.
On 11/16/06, Erik Huelsmann <eh...@gmail.com> wrote:
> Yesterday I wrote a patch to make ra_serf support the cancelation
> callback I added to the ra layer in r22294, but then discovered that
> serf requires apr 1.x to be built. I still use APR 0.9, so:
I thought Justin made it 0.9-compatible at the summit?
--dave
--
David Glasser | glasser@mit.edu | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Implement cancelation callback in ra_serf
Posted by Erik Huelsmann <eh...@gmail.com>.
On 11/16/06, Justin Erenkrantz <ju...@erenkrantz.com> wrote:
> On 11/16/06, Erik Huelsmann <eh...@gmail.com> wrote:
> > To that extent I'm wondering if this patch is enough: there should
> > probably be a callback call somewhere which gets triggered when blocks
> > of data are being received or sent (which is what ra_dav and ra_svn
> > do).
>
> Nah, this loop is always called whenever there is data to process, so
> this is the right place to check cancellation within ra_serf.
>
> I'll try to look at it this weekend if you don't have luck building it
> yourself before then... -- justin
Well, I got it to build. It was a combination of problems with
self-built apr libraries and libtool.
The callback seems to work, although the serf-context-runner gets
canceled itself too with my testcase (Ctrl-C), so it took me a while
before I got the 'signal caught' error from the callback.
So, I guess that for any interruption not using signals (a UI for
example) should benefit from the callback.
I'll commit it shortly.
bye,
Erik.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Implement cancelation callback in ra_serf
Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
On 11/16/06, Erik Huelsmann <eh...@gmail.com> wrote:
> To that extent I'm wondering if this patch is enough: there should
> probably be a callback call somewhere which gets triggered when blocks
> of data are being received or sent (which is what ra_dav and ra_svn
> do).
Nah, this loop is always called whenever there is data to process, so
this is the right place to check cancellation within ra_serf.
I'll try to look at it this weekend if you don't have luck building it
yourself before then... -- justin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org