Thread View: news.software.nntp
3 messages
3 total messages
Started by Andy Burgess
Tue, 10 Dec 1996 00:00
INN 1.5 VS 1.5b2, perl filtering trouble
Author: Andy Burgess
Date: Tue, 10 Dec 1996 00:00
Date: Tue, 10 Dec 1996 00:00
66 lines
2624 bytes
2624 bytes
I have been attempting to upgrade from INN 1.5b2 to 1.5. Both versions
use almost the same config.data, exactly the same perl (5.003) and
filter_innd.pl (config diff at the end of this post). I switch between
versions by running make update in the appropriate directories).
Even the following filter_innd.pl fails (for me) on 1.5:
sub filter_art {
my($rval)="";
$rval;
}
A log excerpt follows. It looks like random garbage is returned
by the filter_art function.
Running: bin/rc.news -du
...
innd: SERVER perl filtering enabled
innd: SERVER starting
innd: news.scruz.net connected 33 streaming allowed
innd: news.scruz.net connected 34 streaming allowed
innd: news.scruz.net connected 35 streaming allowed
innd: news.scruz.net connected 36 streaming allowed
innd: rejecting[perl] <01bbe4a5$0ec8d480$11dcacce@b1eokd65.sympatico.ca> 43II
Dec 9 18:14:14.668 - news.scruz.net <01bbe4a5$0ec8d480$11dcacce@b1eokd65.sympatico.ca> 43Dec 9 18:14:15.116 + news.scruz.net <32ad6826.7482268@news.u-net.com> (comp/arch/embedded/14193) 1582 watcher OVERVIEW! he
Dec 9 18:14:15.793 + news.scruz.net <58iabr$bu3@is05.micron.net> (ba/jobs/offered/937502) 1456 watcher OVERVIEW!
innd: rejecting[perl] <961209210445_708138071@emout19.mail.aol.com> 437 xH
Dec 9 18:14:16.377 - news.scruz.net <961209210445_708138071@emout19.mail.aol.com> 437 xH
...
If I go to the 1.5b2 source directory and run make update then everything
works as it should.
I realise that this probably works fine for everyone else and I would
appreciate any hint as to what I am doing wrong.
This is Linux 2.0.24 on a 32Mb 486.
Thanks for any help.
----------------------------------------------------------------
config diffs:
1.5b2 is <
1.5 is >
< NEWSMASTER usenet
> NEWSMASTER news
< DEFAULT_TIMEOUT 300
> DEFAULT_TIMEOUT 60
< NNRP_LOADLIMIT 16
> NNRP_LOADLIMIT -1
< PAUSE_RETRY_TIME (5 * 60)
> PAUSE_RETRY_TIME (1 * 60)
< NNTPLINK_LOG DONT
> NNTPLINK_LOG DO
< IPADDR_LOG DO
> IPADDR_LOG DONT
< WANT_PGPVERIFY DONT
> WANT_PGPVERIFY DO
> _PATH_SORT /usr/bin/sort
> MSYNC_3_ARG DO
Re: INN 1.5 VS 1.5b2, perl filtering trouble
Author: Ollivier Robert
Date: Wed, 11 Dec 1996 00:00
Date: Wed, 11 Dec 1996 00:00
24 lines
1267 bytes
1267 bytes
[courtesy cc of this posting sent to cited author via email]
In article <58k1l2$vs4$1@loach.cichlid.com>,
Andy Burgess <aab@cichlid.com> wrote:
> Even the following filter_innd.pl fails (for me) on 1.5:
>
> sub filter_art {
> my($rval)="";
> $rval;
> }
I don't know if it will correct your problem but it should be
my $rval = "";
because the () makes Perl interpret the line in an array context where you
want scalar context. It will be corrected in the 1.5.1 examples.
--
Ollivier ROBERT -=- Eurocontrol EEC/TS -=- Ollivier.Robert@eurocontrol.fr
Usenet Canal Historique
FIX: Re: INN 1.5 VS 1.5b2, perl filtering trouble
Author: Andy Burgess
Date: Wed, 11 Dec 1996 00:00
Date: Wed, 11 Dec 1996 00:00
111 lines
3564 bytes
3564 bytes
In <58k1l2$vs4$1@loach.cichlid.com> aab@cichlid.com (Andy Burgess) writes:
>I have been attempting to upgrade from INN 1.5b2 to 1.5. Both versions
>use almost the same config.data, exactly the same perl (5.003) and
>filter_innd.pl (config diff at the end of this post). I switch between
>versions by running make update in the appropriate directories).
This was caused by the perl memory leak fixes in 1.5.
The perl lib macro FREETMPS frees the return value from the perl
function filter_art. The value was returned from HandleArticle() in
perl.c, a classic using memory after freeing it bug. The following
patch fixes this.
This was causing intermittant garbage returns from filter_art and thus
garbage reasons for rejection in the log file, eg:
innd: rejecting[perl] <961209210445_708138071@emout19.mail.aol.com> 437 xH
Dec 9 18:14:16.377 - news.scruz.net <961209210445_708138071@emout19.mail.aol.co
m> 437 xH
There is another bug which I haven't fixed yet whereby optional article
headers are not cleared from the perl hdr array. Thus when you get a
header with a Control line, the hdr array has the same control line
value for all subsequent articles in the perl program that do not have
Control header lines. This can be worked around in the perl code by
including the following line in filter_art after you are finished with
the hdr array:
$hdr{"Control"} = "";
I don't know how to fix this in perl.c without leaking memory but its
just a perl manpage read away.
Thanks to everyone who ever worked on inn :-)
========================================================================
*** perl.c.orig Wed Dec 11 12:49:04 1996
--- perl.c Wed Dec 11 13:14:56 1996
***************
*** 39,45 ****
ARTHEADER *hp;
HV *hdr;
int rc;
! char *p;
if (!PerlFilterActive || perl_filter_cv == NULL)
return NULL;
--- 39,46 ----
ARTHEADER *hp;
HV *hdr;
int rc;
! char *p = NULL; /* may not get set below */
! static char buf[200];
if (!PerlFilterActive || perl_filter_cv == NULL)
return NULL;
***************
*** 46,51 ****
--- 47,55 ----
/* Create the Perl Hash */
hdr = perl_get_hv("hdr", TRUE);
+
+ /* fix the Control header not being reset bug */
+ /* hv_store(hdr, "Control", sizeof("Control"), ... */
for (hp = ARTheaders; hp < ARTheadersENDOF; hp++)
{
if (hp->Found && hp->Value)
***************
*** 70,82 ****
{
p = POPp;
}
PUTBACK;
FREETMPS;
LEAVE;
! if (p != NULL && *p != '\0')
! return p;
return NULL;
}
--- 74,93 ----
{
p = POPp;
}
+ if(p != NULL && *p != '\0')
+ {
+ strncpy(buf, p, sizeof(buf)-1);
+ buf[sizeof(buf)-1] = '\0';
+ }
+ else
+ *buf = '\0';
PUTBACK;
FREETMPS;
LEAVE;
! if (*buf != '\0')
! return buf;
return NULL;
}
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads