user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 3/7] nntp: ensure body lines end with CRLF
  2015-09-22 10:09  5% [PATCH 0/7] nntp: another round of updates Eric Wong
@ 2015-09-22 10:09  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2015-09-22 10:09 UTC (permalink / raw)
  To: meta

It's common for mail bodies to end with LF-only, so end them with
CRLF to avoid triggering errors in clients.
---
 lib/PublicInbox/NNTP.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm
index bc8d6ed..71b774d 100644
--- a/lib/PublicInbox/NNTP.pm
+++ b/lib/PublicInbox/NNTP.pm
@@ -393,7 +393,9 @@ sub simple_body_write ($$) {
 	my $body = $s->body;
 	$s->body_set('');
 	$body =~ s/^\./../smg;
+	$body =~ s/(?<!\r)\n/\r\n/sg;
 	do_more($self, $body);
+	do_more($self, "\r\n") unless $body =~ /\r\n\z/s;
 	'.'
 }
 
-- 
EW


^ permalink raw reply related	[relevance 7%]

* [PATCH 0/7] nntp: another round of updates
@ 2015-09-22 10:09  5% Eric Wong
  2015-09-22 10:09  7% ` [PATCH 3/7] nntp: ensure body lines end with CRLF Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2015-09-22 10:09 UTC (permalink / raw)
  To: meta

I guess we'll implement RFC 3977 before we commit to a extending
fields needed for an overview database...

Eric Wong (7):
      t/nntpd.t: fix fcntl test to ensure no failures
      nntp: support YYYYMMDD dates for commands
      nntp: ensure body lines end with CRLF
      nntp: avoid setting Bytes and Lines headers
      nntp: implement OVER from RFC 3977
      nntp: XHDR fixes for Message-ID lookups
      nntp: XHDR lookups by Message-ID may cross groups

 lib/PublicInbox/NNTP.pm | 136 ++++++++++++++++++++++++++++++++----------------
 t/nntp.t                |  29 +++++++++++
 t/nntpd.t               |  30 ++++++++++-
 3 files changed, 147 insertions(+), 48 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 --
2015-09-22 10:09  5% [PATCH 0/7] nntp: another round of updates Eric Wong
2015-09-22 10:09  7% ` [PATCH 3/7] nntp: ensure body lines end with CRLF 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).