* [PATCH 0/2] nntp fixes
@ 2016-05-29 4:16 Eric Wong
2016-05-29 4:16 ` [PATCH 1/2] inbox: drop references ASAP for search and msgmap Eric Wong
2016-05-29 4:16 ` [PATCH 2/2] nntp: fix for missing articles/bodies/heads Eric Wong
0 siblings, 2 replies; 3+ messages in thread
From: Eric Wong @ 2016-05-29 4:16 UTC (permalink / raw)
To: meta
These are fixes for fallout from the NewsGroup class removal
commit 528230a0411897 ("remove redundant NewsGroup class")
Eric Wong (2):
inbox: drop references ASAP for search and msgmap
nntp: fix for missing articles/bodies/heads
lib/PublicInbox/Inbox.pm | 2 +-
lib/PublicInbox/NNTP.pm | 2 +-
t/nntpd.t | 8 ++++++++
3 files changed, 10 insertions(+), 2 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] inbox: drop references ASAP for search and msgmap
2016-05-29 4:16 [PATCH 0/2] nntp fixes Eric Wong
@ 2016-05-29 4:16 ` Eric Wong
2016-05-29 4:16 ` [PATCH 2/2] nntp: fix for missing articles/bodies/heads Eric Wong
1 sibling, 0 replies; 3+ messages in thread
From: Eric Wong @ 2016-05-29 4:16 UTC (permalink / raw)
To: meta
We can't leave them lingering in the parent process at
all due to the risk of corruption with multiple processes.
---
lib/PublicInbox/Inbox.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm
index d050dc8..27218de 100644
--- a/lib/PublicInbox/Inbox.pm
+++ b/lib/PublicInbox/Inbox.pm
@@ -86,7 +86,7 @@ sub base_url {
sub nntp_usable {
my ($self) = @_;
my $ret = $self->mm && $self->search;
- weaken_all();
+ $self->{mm} = $self->{search} = undef;
$ret;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] nntp: fix for missing articles/bodies/heads
2016-05-29 4:16 [PATCH 0/2] nntp fixes Eric Wong
2016-05-29 4:16 ` [PATCH 1/2] inbox: drop references ASAP for search and msgmap Eric Wong
@ 2016-05-29 4:16 ` Eric Wong
1 sibling, 0 replies; 3+ messages in thread
From: Eric Wong @ 2016-05-29 4:16 UTC (permalink / raw)
To: meta
Oops, we totally forgot to automate testing for this :x
---
lib/PublicInbox/NNTP.pm | 2 +-
t/nntpd.t | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm
index 58b86a8..232237c 100644
--- a/lib/PublicInbox/NNTP.pm
+++ b/lib/PublicInbox/NNTP.pm
@@ -485,7 +485,7 @@ find_mid:
found:
my $o = 'HEAD:' . mid2path($mid);
my $bytes;
- my $s = eval { Email::Simple->new($ng->gcf->cat_file($o, \$bytes)) };
+ my $s = eval { Email::Simple->new($ng->git->cat_file($o, \$bytes)) };
return $err unless $s;
my $lines;
if ($set_headers) {
diff --git a/t/nntpd.t b/t/nntpd.t
index c5bc0b5..5f4ba57 100644
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -173,6 +173,14 @@ EOF
$len,
'1' ] }, "XOVER by article works");
+ is_deeply($n->head(1), $n->head('<nntp@example.com>'), 'HEAD OK');
+ is_deeply($n->body(1), $n->body('<nntp@example.com>'), 'BODY OK');
+ my $art = $n->article(1);
+ is(ref($art), 'ARRAY', 'got array for ARTICLE');
+ is_deeply($art, $n->article('<nntp@example.com>'), 'ARTICLE OK');
+ is($n->article(999), undef, 'non-existent num');
+ is($n->article('<non-existent@example>'), undef, 'non-existent mid');
+
{
syswrite($s, "OVER $mid\r\n");
$buf = read_til_dot($s);
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-05-29 4:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-29 4:16 [PATCH 0/2] nntp fixes Eric Wong
2016-05-29 4:16 ` [PATCH 1/2] inbox: drop references ASAP for search and msgmap Eric Wong
2016-05-29 4:16 ` [PATCH 2/2] nntp: fix for missing articles/bodies/heads Eric Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).