* [PATCH 2/2] nntp: fix for missing articles/bodies/heads
2016-05-29 4:16 5% [PATCH 0/2] nntp fixes Eric Wong
@ 2016-05-29 4:16 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
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 [relevance 7%]
* [PATCH 0/2] nntp fixes
@ 2016-05-29 4:16 5% Eric Wong
2016-05-29 4:16 7% ` [PATCH 2/2] nntp: fix for missing articles/bodies/heads Eric Wong
0 siblings, 1 reply; 2+ results
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 [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-05-29 4:16 5% [PATCH 0/2] nntp fixes Eric Wong
2016-05-29 4:16 7% ` [PATCH 2/2] nntp: fix for missing articles/bodies/heads Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
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).