Re: [Arsperl-devel] ARSperl enhancements
Brought to you by:
jeffmurphy
|
From: Thilo S. <thi...@ap...> - 2007-07-25 11:41:48
|
Hi Michiel,
here are my opinions about your points:
** The 2.x/3.x relics should indeed be removed.
** I agree absolutely that the OO stuff is broken. OTOH we shouldn't
force people to rewrite existing scripts. I'd recommend that the OO
modules should be moved to a subdirectory "ARS/OO_old" or something like
that, and be clearly labeled as deprecated. Most importantly, all
example scripts that use the OO modules should be rewritten.
While we're at it, the ARS*-h.pm files should be moved to the ARS/
subdirectory, so that all installation files except "ARS.pm" are
contained under a single directory tree.
** The Alert functions should be kept, but of course exported in ARS.pm.
As I see it, those are mostly working well (but are rather poorly
documented). The ars_GetAlertCount function should, of course, be fixed.
I'll take a look into this.
Here's a sample code snippet for inclusion into the documentation of
ars_RegisterForAlert:
my $sock = IO::Socket::INET->new( Listen => 20, Proto => 'tcp',
LocalAddr => $LOCAL_ADDR, LocalPort => $PORT );
die "Cannot open Socket\n" unless $sock;
ARS::ars_RegisterForAlerts( $ctrl, $PORT, 0 );
die "ars_RegisterForAlerts( $PORT ): $ars_errstr\n" if $ars_errstr;
my( $client, $text );
while( $client = $sock->accept ){
my( $port, $iaddr ) = unpack_sockaddr_in($client->peername);
my $clientAddr = inet_ntoa($iaddr);
print "Connection from $clientAddr $port\n";
print $client 'ack';
my $size = read($client,$text,$MAX_LENGTH);
print $client 'ack';
close $client;
my $alert = ARS::ars_DecodeAlertMessage( $ctrl, $text, $size );
print Data::Dumper->Dump( [$alert], ['alert'] );
}
** The point about ars_APIVersion sounds sensible to me. I guess that
the reason for the prevalent use of AR_EXPORT_VERSION is that
AR_CURRENT_API_VERSION wasn't available in earlier versions. However,
changing all #ifdef conditions depending on AR_EXPORT_VERSION would, in
my opinion, not be worth the effort (and likely cause some bugs).
Best regards,
Thilo
Michiel Beijen wrote:
> Hi All,
>
> I was looking into improving the documentation available for ARSperl
> and had the following I would like to discuss.
> ** There are lots of 2.x and 3.x api calls in the current package and
> current documentation, this is confusing and the current version is
> only meant to compile against the >= 5.0 API . If people would still
> need those calls, they can of course just download ARSperl 1.old if
> they want to... My proposal is to remove the old calls from the
> package and the documentation.
>
> ** The OO stuff that is in the package seems to be broken; my proposal
> is to remove that as well.
>
> ** Some stuff like ars_GetAlertCount and ars_RegisterForAlerts is not
> exported in ARS.pm, although it is in the docs and in ARS.xs. If I add
> it and recompile; a sample script that just uses ars_GetAlertCount
> gives
> "Attempt to free unreferenced scalar: SV 0x187e224, Perl interpreter: 0x223e5c."
> It looks like these calls were not completely implemented? My proposal
> is to either remove or fix.
>
> ** Also; I altered ars_APIVersion: it now uses AR_CURRENT_API_VERSION
> rather than AR_EXPORT_VERSION so the version level that comes back is
> more useful.
> It now matches the Minimum-Api-Version setting in ar.conf. This seemed
> better to me; however I might be off here; especially since I noticed
> AR_EXPORT_VERSION being used in ARS.xs all over the place. Please
> comment.
>
> Please note that I do not want to delete hard work of people, but I
> think that ARSperl is really useful and that it would be nice to have
> a clean and all-working version; that would improve the quality of the
> product in my opinion.
>
> Kind regards,
>
> Michiel
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Arsperl-devel mailing list
> Ars...@ar...
> https://lists.sourceforge.net/lists/listinfo/arsperl-devel
>
|