]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Config.pm
config: do not slurp lines into memory
[public-inbox.git] / lib / PublicInbox / Config.pm
index 3e3d79ad4e888a9c9594ce320b969a049f9a2db0..f6275cdd24663d2f5b3f8235d7e188a04863b923 100644 (file)
@@ -95,12 +95,6 @@ sub limiter {
        };
 }
 
-sub get {
-       my ($self, $inbox, $key) = @_;
-
-       $self->{"publicinbox.$inbox.$key"};
-}
-
 sub config_dir { $ENV{PI_DIR} || "$ENV{HOME}/.public-inbox" }
 
 sub default_file {
@@ -117,7 +111,7 @@ sub git_config_dump {
        my $fh = popen_rd(\@cmd) or die "popen_rd failed for $file: $!\n";
        my %rv;
        local $/ = "\n";
-       foreach my $line (<$fh>) {
+       while (defined(my $line = <$fh>)) {
                chomp $line;
                my ($k, $v) = split(/=/, $line, 2);
                my $cur = $rv{$k};
@@ -142,7 +136,7 @@ sub _fill {
 
        foreach my $k (qw(mainrepo address filter url newsgroup
                        infourl watch watchheader httpbackendmax
-                       feedmax)) {
+                       feedmax nntpserver)) {
                my $v = $self->{"$pfx.$k"};
                $rv->{$k} = $v if defined $v;
        }