I tried out nmh-master-take-two-amb.patch of 22 Nov 2022.  Sometimes
it works, and sometimes it seems to read outside the buffer, either
aborting or giving me garbage.  It succeeded on a bad message from
UPS, but it failed with my enhanced test-pop test.

There was one aspect of this patch that I didn't like: that popsbr.c's
expanded traverse() duplicates logic from multiline, netsec_readline and
netsec_fillread.  So I tried my hand at writing my own patch.

To not have to duplicate netsec_readline's existing logic, I stuffed
all the new logic into that function.  I see both pros and cons to this
design:

Pro: This approach may have less overall complexity compared to
patching the traverse() function.

Pro: If another part of nmh needs to handle reading long text lines,
it is now easy to do.

Con: It complicates the network code, so if there is a bug, it could
break more than "inc".

Con: Because this change is so deep, I had to re-do the interfaces
several layers up.  pop_readline(), multiline(), and callers of
multiline are all affected.

I'll send my patch in two parts:

1. Enhance test-pop to verify that inc can handle long text lines.
   The test fails at this point, as a new test should.
   This is the third version of my work on test-pop, the first being
   in my bug report.

2. Enhance netsec_readline and callers in popsbr.c and inc.c so that
   "inc" can handle long message lines.  The test-pop test from the
   previous segment of this patch now passes, showing that this patch
   adds the new functionality.

 < Stephen

Reply via email to