Send inn-committers mailing list submissions to inn-committers@lists.isc.org
To subscribe or unsubscribe via the World Wide Web, visit https://lists.isc.org/mailman/listinfo/inn-committers or, via email, send a message with subject or body 'help' to inn-committers-requ...@lists.isc.org You can reach the person managing the list at inn-committers-ow...@lists.isc.org When replying, please edit your Subject line so it is more specific than "Re: Contents of inn-committers digest..." Today's Topics: 1. INN commit: trunk (4 files) (INN Commit) 2. INN commit: trunk (4 files) (INN Commit) 3. INN commit: branches/2.5 (3 files) (INN Commit) 4. INN commit: branches/2.5/frontends (pullnews.in) (INN Commit) 5. INN commit: branches/2.5 (doc/pod/news.pod frontends/pullnews.in) (INN Commit) ---------------------------------------------------------------------- Message: 1 Date: Sat, 30 Aug 2014 04:55:13 -0700 (PDT) From: INN Commit <r...@isc.org> To: inn-committ...@isc.org Subject: INN commit: trunk (4 files) Message-ID: <20140830115513.8c8eb67...@hope.eyrie.org> Date: Saturday, August 30, 2014 @ 04:55:13 Author: iulius Revision: 9660 Do not hide functions from libinn Random internal utility functions are supposed to be exposed. Fix getrra-c-util to remove the visibility stuff when synchronizing from upstream. Modified: trunk/include/portable/getaddrinfo.h trunk/include/portable/getnameinfo.h trunk/include/portable/socket.h trunk/support/getrra-c-util --------------------------------+ include/portable/getaddrinfo.h | 6 ------ include/portable/getnameinfo.h | 6 ------ include/portable/socket.h | 6 ------ support/getrra-c-util | 11 ++++++++++- 4 files changed, 10 insertions(+), 19 deletions(-) Modified: include/portable/getaddrinfo.h =================================================================== --- include/portable/getaddrinfo.h 2014-08-30 08:08:11 UTC (rev 9659) +++ include/portable/getaddrinfo.h 2014-08-30 11:55:13 UTC (rev 9660) @@ -71,18 +71,12 @@ BEGIN_DECLS -/* Default to a hidden visibility for all portability functions. */ -#pragma GCC visibility push(hidden) - /* Function prototypes. */ int getaddrinfo(const char *nodename, const char *servname, const struct addrinfo *hints, struct addrinfo **res); void freeaddrinfo(struct addrinfo *ai); const char *gai_strerror(int ecode); -/* Undo default visibility change. */ -#pragma GCC visibility pop - END_DECLS #endif /* !HAVE_GETADDRINFO */ Modified: include/portable/getnameinfo.h =================================================================== --- include/portable/getnameinfo.h 2014-08-30 08:08:11 UTC (rev 9659) +++ include/portable/getnameinfo.h 2014-08-30 11:55:13 UTC (rev 9660) @@ -56,17 +56,11 @@ BEGIN_DECLS -/* Default to a hidden visibility for all portability functions. */ -#pragma GCC visibility push(hidden) - /* Function prototypes. */ int getnameinfo(const struct sockaddr *sa, socklen_t salen, char *node, socklen_t nodelen, char *service, socklen_t servicelen, int flags); -/* Undo default visibility change. */ -#pragma GCC visibility pop - END_DECLS #endif /* !HAVE_GETNAMEINFO */ Modified: include/portable/socket.h =================================================================== --- include/portable/socket.h 2014-08-30 08:08:11 UTC (rev 9659) +++ include/portable/socket.h 2014-08-30 11:55:13 UTC (rev 9660) @@ -212,9 +212,6 @@ extern const char *inet_ntoa(const struct in_addr); #endif -/* Default to a hidden visibility for all portability functions. */ -#pragma GCC visibility push(hidden) - #if !HAVE_INET_NTOP # ifdef _WIN32 extern const char *inet_ntop(int, const void *, char *, int); @@ -271,9 +268,6 @@ typedef int socket_type; #endif -/* Undo default visibility change. */ -#pragma GCC visibility pop - END_DECLS #endif /* !PORTABLE_SOCKET_H */ Modified: support/getrra-c-util =================================================================== --- support/getrra-c-util 2014-08-30 08:08:11 UTC (rev 9659) +++ support/getrra-c-util 2014-08-30 11:55:13 UTC (rev 9660) @@ -47,7 +47,10 @@ elif [ "$2" = "include/inn" ] || [ "$2" = "include/portable" ] \ || [ "$2" = "lib" ] then - sed -i -e 's/<config\.h>/"config.h"/g' \ + sed -i -e 's/UTIL_/INN_/g' \ + -e '/^\/\* Default to a hidden visibility for all .* functions\. \*\/$/,+2d' \ + -e '/^\/\* Undo default visibility change\. \*\/$/,+2d' \ + -e 's/<config\.h>/"config.h"/g' \ -e 's/<portable\/system\.h>/"clibrary.h"/g' \ -e 's/<portable\/socket\.h>/"portable\/socket.h"/g' \ -e 's/<sys\/time\.h>/"portable\/time.h"/g' \ @@ -93,3 +96,9 @@ download portable/socket.h include/portable socket.h download portable/strlcat.c lib strlcat.c download portable/strlcpy.c lib strlcpy.c + +# Synchronize utility functions from upstream. +download util/buffer.c lib buffer.c +download util/buffer.h include/inn buffer.h +download util/fdflag.c lib fdflag.c +download util/fdflag.h include/inn fdflag.h ------------------------------ Message: 2 Date: Sat, 30 Aug 2014 04:56:12 -0700 (PDT) From: INN Commit <r...@isc.org> To: inn-committ...@isc.org Subject: INN commit: trunk (4 files) Message-ID: <20140830115612.160a767...@hope.eyrie.org> Date: Saturday, August 30, 2014 @ 04:56:11 Author: iulius Revision: 9661 Sync with latest rra-c-util version Essentially wording improvement. Modified: trunk/include/inn/buffer.h trunk/lib/buffer.c trunk/lib/fdflag.c trunk/m4/socket.m4 ----------------------+ include/inn/buffer.h | 6 +++--- lib/buffer.c | 12 ++++++------ lib/fdflag.c | 10 ++++++---- m4/socket.m4 | 4 ++-- 4 files changed, 17 insertions(+), 15 deletions(-) Modified: include/inn/buffer.h =================================================================== --- include/inn/buffer.h 2014-08-30 11:55:13 UTC (rev 9660) +++ include/inn/buffer.h 2014-08-30 11:56:11 UTC (rev 9661) @@ -2,13 +2,13 @@ * * Counted, reusable memory buffer. * - * A buffer is an allocated bit of memory with a known size and a separate + * A buffer is an allocated block of memory with a known size and a separate * data length. It's intended to store strings and can be reused repeatedly * to minimize the number of memory allocations. Buffers increase in * increments of 1K, or double for some operations. * - * A buffer contains a notion of the data that's been used and the data - * that's been left, used when the buffer is an I/O buffer where lots of data + * A buffer contains a record of what data has been used and what data is as + * yet unprocessed, used when the buffer is an I/O buffer where lots of data * is buffered and then slowly processed out of the buffer. The total length * of the data is used + left. If a buffer is just used to store some data, * used can be set to 0 and left stores the length of the data. Modified: lib/buffer.c =================================================================== --- lib/buffer.c 2014-08-30 11:55:13 UTC (rev 9660) +++ lib/buffer.c 2014-08-30 11:56:11 UTC (rev 9661) @@ -2,16 +2,16 @@ * * Counted, reusable memory buffer. * - * A buffer is an allocated bit of memory with a known size and a separate + * A buffer is an allocated block of memory with a known size and a separate * data length. It's intended to store strings and can be reused repeatedly * to minimize the number of memory allocations. Buffers increase in * increments of 1K, or double for some operations. * - * A buffer contains data that's been used and the data that's been left, used - * when the buffer is an I/O buffer where lots of data is buffered and then - * slowly processed out of the buffer. The total length of the data is used + - * left. If a buffer is just used to store some data, used can be set to 0 - * and left stores the length of the data. + * A buffer contains a record of what data has been used and what data is as + * yet unprocessed, used when the buffer is an I/O buffer where lots of data + * is buffered and then slowly processed out of the buffer. The total length + * of the data is used + left. If a buffer is just used to store some data, + * used can be set to 0 and left stores the length of the data. * * The canonical version of this file is maintained in the rra-c-util package, * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>. Modified: lib/fdflag.c =================================================================== --- lib/fdflag.c 2014-08-30 11:55:13 UTC (rev 9660) +++ lib/fdflag.c 2014-08-30 11:56:11 UTC (rev 9661) @@ -35,9 +35,6 @@ #include "clibrary.h" #include <errno.h> -#include "inn/fdflag.h" -#include "inn/libinn.h" - #ifdef _WIN32 # include <winsock2.h> #else @@ -50,6 +47,8 @@ # endif #endif +#include "inn/fdflag.h" +#include "inn/libinn.h" /* * Set a file to close-on-exec (or clear that setting if the flag is false), @@ -60,7 +59,10 @@ * Do it right anyway; it's not that expensive. * * Stub this out on Windows, where it's not supported (at least currently by - * this utility library). + * this utility library). Do not use socket_type for the first parameter, + * since it's meaningful to set file descriptors for regular files to + * close-on-exec (even though this is currently irrelevant since the function + * isn't supported on Windows). */ #ifdef _WIN32 bool Modified: m4/socket.m4 =================================================================== --- m4/socket.m4 2014-08-30 11:55:13 UTC (rev 9660) +++ m4/socket.m4 2014-08-30 11:56:11 UTC (rev 9661) @@ -67,8 +67,8 @@ [AC_DEFINE([HAVE_GETADDRINFO_ADDRCONFIG], 1, [Define if the AI_ADDRCONFIG flag works with getaddrinfo.])])]) -dnl Source used by INN_IN6_EQ_BROKEN. Test borrowed from a bug report by -dnl tmoe...@gmx.net for glibc. +dnl Source used by INN_MACRO_IN6_ARE_ADDR_EQUAL. Test borrowed from a bug +dnl report by tmoe...@gmx.net for glibc. AC_DEFUN([_INN_MACRO_IN6_ARE_ADDR_EQUAL_SOURCE], [[ #include <sys/types.h> #include <sys/socket.h> ------------------------------ Message: 3 Date: Sat, 30 Aug 2014 04:57:30 -0700 (PDT) From: INN Commit <r...@isc.org> To: inn-committ...@isc.org Subject: INN commit: branches/2.5 (3 files) Message-ID: <20140830115730.7267567...@hope.eyrie.org> Date: Saturday, August 30, 2014 @ 04:57:30 Author: iulius Revision: 9662 pullnews: remove headers matching (or not) a given regexp Enable the -m flag to remove headers matching (or not) a given regexp. Thanks to Geraint Edwards for the patch. Modified: branches/2.5/doc/pod/news.pod branches/2.5/doc/pod/pullnews.pod branches/2.5/frontends/pullnews.in -----------------------+ doc/pod/news.pod | 6 ++++++ doc/pod/pullnews.pod | 5 ++++- frontends/pullnews.in | 34 ++++++++++++++++++++++++---------- 3 files changed, 34 insertions(+), 11 deletions(-) Modified: doc/pod/news.pod =================================================================== --- doc/pod/news.pod 2014-08-30 11:56:11 UTC (rev 9661) +++ doc/pod/news.pod 2014-08-30 11:57:30 UTC (rev 9662) @@ -11,6 +11,12 @@ not all processes die within timeout). Thanks to Lauri Tirkkonen for the patch. +=item * + +Several improvements have been contributed to B<pullnews> by Geraint +Edwards: the B<-m> flag now permits to remove headers matching (or not) +a given regexp. + =back =head1 Changes in 2.5.4 Modified: doc/pod/pullnews.pod =================================================================== --- doc/pod/pullnews.pod 2014-08-30 11:56:11 UTC (rev 9661) +++ doc/pod/pullnews.pod 2014-08-30 11:57:30 UTC (rev 9662) @@ -109,10 +109,13 @@ whitespace-separated tuples (each tuple being a colon-separated header and regular expression). For instance: - -m "Hdr1:regexp1 !Hdr2:regexp2" + -m "Hdr1:regexp1 !Hdr2:regexp2 #Hdr3:regexp3 !#Hdr4:regexp4" specifies that the article will be passed only if the C<Hdr1:> header matches C<regexp1> and the C<Hdr2:> header does not match C<regexp2>. +Besides, if the C<Hdr3:> header matches C<regexp3>, that header is +removed; and if the C<Hdr4:> header does not match C<regexp4>, that +header is removed. =item B<-M> I<num> Modified: frontends/pullnews.in =================================================================== --- frontends/pullnews.in 2014-08-30 11:56:11 UTC (rev 9661) +++ frontends/pullnews.in 2014-08-30 11:57:30 UTC (rev 9662) @@ -151,10 +151,13 @@ -l logfile log progress/stats to logfile (default is stdout). - -m 'Hdr1:regexp1 !Hdr2:regexp2 ...' + -m 'Hdr1:regexp1 !Hdr2:regexp2 #Hdr3:regexp3 !#Hdr4:regexp4 ...' feed article only if: - the Hdr1: header matches regexp1 - and the Hdr2: header does not match regexp2. + the Hdr1: header matches regexp1; + and the Hdr2: header does not match regexp2; + also, process the message thus: + if the Hdr3: header matches regexp3, remove that header; + if the Hdr4: header does not match regexp4, remove it. -M num maximum number of articles (per group) to process before bailing out. @@ -721,22 +724,33 @@ my ($hdr_un, $val_un) = split(':', $unfolded_art_hdr, 2); $val_un = '' if not defined $val_un; $val_un =~ s/^\s*//; + my $remove_hdr = 0; for my $tuple_match (@hdr_to_match) { my ($hdr_m, $val_m) = split(':', $tuple_match, 2); my $negate_h = ($hdr_m =~ s/^!//); + my $remove_h = ($hdr_m =~ s/^#//); next if lc($hdr_un) ne lc($hdr_m); - $m_found_hdrs{lc($hdr_m)} = 1; + $m_found_hdrs{lc($hdr_m)} = 1 if not $remove_h; if ($negate_h) { if ($val_un =~ /$val_m/i) { print LOG "\tDEBUGGING $i\t-- $hdr_un [$val_un]\n" if $debug >= 2; - $match_all_hdrs = 0; + if (not $remove_h) { + $match_all_hdrs = 0; + } + } elsif ($remove_h) { + $remove_hdr = 1; } } elsif (not $val_un =~ /$val_m/i) { print LOG "\tDEBUGGING $i\t++ $hdr_un [$val_un]\n" if $debug >= 2; - $match_all_hdrs = 0; + if (not $remove_h) { + $match_all_hdrs = 0; + } + } elsif ($remove_h) { + $remove_hdr = 1; } last if not $match_all_hdrs; } + push @header_nums_to_go, $idx if $remove_hdr; } if (grep { $curr_hdr eq $_ } split(':', $skip_headers)) { @@ -772,12 +786,12 @@ $headers = 0 if $article->[$idx] eq "\n"; } - if (@hdr_to_match and (not $match_all_hdrs or @hdr_to_match != scalar(keys %m_found_hdrs))) { - print LOG "\tDEBUGGING $i\thdr_skip_art $i\n" if $debug >= 2; - $skip_due_to_hdrs = 1; + if (@hdr_to_match and (not $match_all_hdrs + or scalar(grep { ! /^!?#/ } @hdr_to_match) != keys %m_found_hdrs)) { + $skip_due_to_hdrs = 2; } while (@header_nums_to_go) { - my $idx = pop @header_nums_to_go; # Start from last. + my $idx = pop @header_nums_to_go; # Start from last, so numbers are not affected. my $cut = join("\n\t", splice(@{$article}, $idx, 1)); $tx_len -= length($cut); print LOG "\tDEBUGGING $i\tcut1 $cut" if $debug >= 2; ------------------------------ Message: 4 Date: Sat, 30 Aug 2014 04:58:03 -0700 (PDT) From: INN Commit <r...@isc.org> To: inn-committ...@isc.org Subject: INN commit: branches/2.5/frontends (pullnews.in) Message-ID: <20140830115803.b1bd767...@hope.eyrie.org> Date: Saturday, August 30, 2014 @ 04:58:03 Author: iulius Revision: 9663 pullnews: improve wording * When pullnews runs for the first time against a newsgroup, say "never" instead of January, 1st 1970 as the last run date. * Improve spaces, uppercase characters and singular forms when 1 article is retrieved. * Update the config file even when the group is empty. Modified: branches/2.5/frontends/pullnews.in -------------+ pullnews.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) Modified: pullnews.in =================================================================== --- pullnews.in 2014-08-30 11:57:30 UTC (rev 9662) +++ pullnews.in 2014-08-30 11:58:03 UTC (rev 9663) @@ -616,9 +616,10 @@ if (not $quiet) { printf LOG "\n%s:\n", $name; - printf LOG "\tlast checked: %s\n", scalar(localtime($prevDate)); - printf LOG "\t%d articles available. First %d Last %d\n", - $narticles, $first, $last; + printf LOG "\tLast checked: %s\n", + $prevDate ? scalar(localtime($prevDate)) : "never"; + printf LOG "\t%d article%s available (first %d, last %d)\n", + $narticles, $narticles != 1 ? "s" : "", $first, $last; } if (defined $watermark) { printf LOG "\tOur previous highest: %d\n", $prevHigh if not $quiet; @@ -632,6 +633,8 @@ return 0 if ! $name; if ($narticles == 0) { print LOG " (nothing to get)\n" unless $quiet; + # Just update the time; keep the last known high watermark. + $shash->{$group} = [ time, $high ]; return 1; } ------------------------------ Message: 5 Date: Sat, 30 Aug 2014 04:58:35 -0700 (PDT) From: INN Commit <r...@isc.org> To: inn-committ...@isc.org Subject: INN commit: branches/2.5 (doc/pod/news.pod frontends/pullnews.in) Message-ID: <20140830115835.72f5667...@hope.eyrie.org> Date: Saturday, August 30, 2014 @ 04:58:35 Author: iulius Revision: 9664 pullnews: bug fix to rnews when -O; improved rnews reporting Thanks to Geraint Edwards for the patch. Modified: branches/2.5/doc/pod/news.pod branches/2.5/frontends/pullnews.in -----------------------+ doc/pod/news.pod | 2 +- frontends/pullnews.in | 28 +++++++++++++++++++++------- 2 files changed, 22 insertions(+), 8 deletions(-) Modified: doc/pod/news.pod =================================================================== --- doc/pod/news.pod 2014-08-30 11:58:03 UTC (rev 9663) +++ doc/pod/news.pod 2014-08-30 11:58:35 UTC (rev 9664) @@ -15,7 +15,7 @@ Several improvements have been contributed to B<pullnews> by Geraint Edwards: the B<-m> flag now permits to remove headers matching (or not) -a given regexp. +a given regexp, and B<rnews> reporting is improved. =back Modified: frontends/pullnews.in =================================================================== --- frontends/pullnews.in 2014-08-30 11:58:03 UTC (rev 9663) +++ frontends/pullnews.in 2014-08-30 11:58:35 UTC (rev 9664) @@ -9,6 +9,13 @@ # RCSId: $Id$ # # History: +# Full changelog can be found in the Subversion repository of the +# INN project. Major changes are: +# +# January 2010: Geraint A. Edwards +# enable -m to remove headers matching (or not) a given regexp; +# minor bug fix to rnews when -O; improved rnews reporting. +# # December 2008: Matija Nalis added -O (optimized mode, checking # whether the downstream server already has the article to download). # Bug fixes too. @@ -107,9 +114,9 @@ } $usage =~ s!.*/!!; -$usage .= " [ -hnqRx -b fraction -c config -C width -d level +$usage .= " [ -hnOqRx -b fraction -c config -C width -d level -f fraction -F fakehop -g groups -G newsgroups -H headers - -k checkpt -l logfile -m header_pats -M num -N num -O + -k checkpt -l logfile -m header_pats -M num -N num -p port -P hop_limit -Q level -r file -s host[:port] -S num -t retries -T seconds -w num -z num -Z num ] [ upstream_host ... ] @@ -297,6 +304,8 @@ open(RNEWS, ">$rnews") || die "can't open rnews-format output: $rnews: $!\n"; } + $info{'rnews'}->{bytes} = 0; + $info{'rnews'}->{fed} = 0; } open(LOG, $logFile) || die "can't open logfile ($logFile)!: $!\n"; @@ -440,11 +449,11 @@ }} if (!$upstream) { - print LOG "failed.\n" unless $quiet; + print LOG " failed.\n" unless $quiet; warn "can't connect to upstream server $server: $!\n"; next; } else { - print LOG "done.\n" unless $quiet; + print LOG " done.\n" unless $quiet; } if ($username && !$upstream->authinfo($username, $passwd)) { @@ -506,6 +515,9 @@ if ($quiet) { printf LOG localtime() . " [$$] %d article%s to $localServer\n", $sum, ($sum != 1 ? "s" : ""); + } elsif ($rnews) { + printf LOG "\n%d article%s written to $rnews\n", + $sum, ($sum != 1 ? "s were" : " was"); } else { printf LOG "\n%d article%s offered to server on $localServer\n", $sum, ($sum != 1 ? "s were" : " was"); @@ -515,7 +527,7 @@ if ($quiet) { print LOG localtime() . " [$$] $ltotal ok, $reftotal ref, $rejtotal rej\n"; - } else { + } elsif (not $rnews) { printf LOG "%d article%s accepted\n", $ltotal, ($ltotal != 1 ? "s were" : " was") if ($ltotal != 0); @@ -673,7 +685,7 @@ my $org_code = $fromServer->code(); # Continue if the article exists on the upstream server. - if ($org_code == 223) { + if ($org_code == 223 and not $rnews) { my $new_msgid = $toServer->nntpstat($org_msgid); my $new_code = $toServer->code(); print LOG "\tDEBUGGING $i\t$org_msgid ($org_code) => $new_code\n" if $debug >= 3; @@ -830,10 +842,12 @@ printf RNEWS "#! rnews %d\n", $tx_len; map { print RNEWS $_ } @{$article}; print LOG "+" unless $quiet; + $fed{$group}++; + $info{'rnews'}->{fed}++; + $info{fed}++; } else { if ($no_op) { print "Would offer $msgid\n"; - } elsif ($reader and not $toServer->post($article)) { # 240 article posted ok # 340 send article to be posted. End with <CR-LF>.<CR-LF> ------------------------------ _______________________________________________ inn-committers mailing list inn-committers@lists.isc.org https://lists.isc.org/mailman/listinfo/inn-committers End of inn-committers Digest, Vol 66, Issue 8 *********************************************