You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Matthias Urlichs <sm...@smurf.noris.de> on 2005/08/19 09:22:08 UTC
Perl interface leaks connections: ???
Hi,
this (admittedly very simple) script:
#!/usr/bin/perl
use SVN::Client;
my $ctx = new SVN::Client;
sub log_receiver(@) { }
foreach my $n(1..100) {
$ctx->log("svn://cvs.gnupg.org/gnupg", $n,$n, 1,1, \&log_receiver);
}
__END__
... leaks connections: it opens a new one for every request, without
closing the old one. IMHO that's a bug, not to mention that I get
blocked by the server (understandably).
How do I use one persistent connection instead?
Does anybody have a workaround?
--
Matthias Urlichs | {M:U} IT Design @ m-u-it.de | smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
- -
GLITCH [from the Yiddish "glitshen", to slide] 1. n. A sudden
interruption in electric service, sanity, or program function.
Sometimes recoverable. 2. v. To commit a glitch. See GRITCH.
3. v. (Stanford) To scroll a display screen.
-- From the AI Hackers' Dictionary
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Perl interface: Creating data structures
Posted by Matthias Urlichs <sm...@smurf.noris.de>.
Hi,
I can now successfully open a SVN::Ra connection, get logs, and whatever.
Now I want to call stat().
my $e = SVN::_Core::new_svn_dirent_t();
# **Note: $e is not displayable in the Perl debugger ?! **
$ra->stat($path, $revision, \$e);
=> Type error in argument 4 of svn_ra_stat. Expected _p_p_svn_dirent_t
Now if somebody could explain (and possibly document ;-) how to create (a
pointer to ?) a _p_svn_dirent_t object I can use there, I'd be very happy.
Thanks!
--
Matthias Urlichs | {M:U} IT Design @ m-u-it.de | smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
- -
It usually takes more than three weeks to prepare a good impromptu speech.
-- Mark Twain
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Perl interface leaks connections: ???
Posted by Matthias Urlichs <sm...@smurf.noris.de>.
Hi,
Ben Collins-Sussman:
> >How do I use one persistent connection instead?
>
> Call the network API (svn_ra.h), rather than the high-level client
> API (svn_client.h). In other words, open a single network RA session
> and call svn_ra_get_logs() repeatedly, instead of calling
> svn_client_log() repeatedly.
Thank you, that's helpful. After a bit of experimentation, this code works:
#!/usr/bin/perl
use SVN::Ra;
my $ra = SVN::Ra->new("svn://cvs.gnupg.org/gnupg");
sub show_log {
# ... do whatever ...
}
my $latest = $ra->get_latest_revnum();
my $n = 1;
while($n <= $latest) {
$ra->get_log("/",$n,$n,$n,1,1,\&show_log,undef)
# svn_ra_get_log(session,paths,start,end,limit,discover_changed_paths,strict_node_history,receiver,receiver_baton,pool)
} continue {
$n++;
}
... which still leaves the fact that SVN::Client leaks connections,
but that's a bug for somebody else to fix.
--
Matthias Urlichs | {M:U} IT Design @ m-u-it.de | smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
- -
When I see the Ten Most Wanted List... I always have this thought: If we'd
made them feel wanted earlier, they wouldn't be wanted now.
-- Eddie Cantor
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Perl interface leaks connections: ???
Posted by Ben Collins-Sussman <su...@collab.net>.
On Aug 19, 2005, at 4:22 AM, Matthias Urlichs wrote:
>
> How do I use one persistent connection instead?
> Does anybody have a workaround?
Call the network API (svn_ra.h), rather than the high-level client
API (svn_client.h). In other words, open a single network RA session
and call svn_ra_get_logs() repeatedly, instead of calling
svn_client_log() repeatedly.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org