[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nmh-commits] [SCM] The nmh Mail Handling System branch, master, updated
From: |
Ken Hornstein |
Subject: |
[Nmh-commits] [SCM] The nmh Mail Handling System branch, master, updated. 8115c2f00dda36b1ee8db290743536a9b6e406cf |
Date: |
Mon, 05 Mar 2012 18:55:22 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The nmh Mail Handling System".
The branch, master has been updated
via 8115c2f00dda36b1ee8db290743536a9b6e406cf (commit)
via 31fb848410e127fe28ca27fb59726ef108a57c9c (commit)
via 23346694ffc1337359c76ea3b6b158f4dc3e0c6d (commit)
via a1aa5032943899145617de8d28165556fb2ff2ae (commit)
via 4692445bb90e907dfb96ca05364f4a5638192eba (commit)
from 5cc5dbfe040a1c852f95b28da3f1788df9e1e94f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/nmh.git/commit/?id=8115c2f00dda36b1ee8db290743536a9b6e406cf
commit 8115c2f00dda36b1ee8db290743536a9b6e406cf
Author: Ken Hornstein <address@hidden>
Date: Mon Mar 5 13:55:04 2012 -0500
Finally got a reasonable burst test working.
diff --git a/test/burst/test-burst b/test/burst/test-burst
index 872844c..e654535 100755
--- a/test/burst/test-burst
+++ b/test/burst/test-burst
@@ -48,6 +48,100 @@ EOF
burst 11 || exit
-scan 11-last
+run_test 'scan -width 80 11-last' \
+" 11 09/29 Test Burst Messag Test digest<<------- Message one From: Mister
Bu
+ 12+ 09/28 Mister Burster Message one<<This is message one >>
+ 13 09/28 Mister Burster Message two<<This is message two For real. >>"
-exit 0
+#
+# Create another test message that stresses the boundary checker a bit
+#
+
+cat > "${MH_TEST_DIR}/Mail/inbox/14" <<EOF
+From: Test Burst Message <address@hidden>
+To: Test Recipient <address@hidden>
+Date: Friday, 29 Sep 2006 00:00:00
+Subject: Test digest
+
+This is a preamble
+------- Message one
+
+From: Mister Burster <address@hidden>
+To: Nobody 1 <address@hidden>
+Date: Thursday, 28 Sep 2006 00:01:00
+Subject: Message one
+
+- -This is message one
+
+------- Message two
+From: Mister Burster <address@hidden>
+To: Nobody 2 <address@hidden>
+Date: Thursday, 28 Sep 2006 00:02:00
+Subject: Message two
+
+This is message two
+- For real.
+------- Message three
+
+
+
+From: Mister Burster <address@hidden>
+To: Nobody 3 <address@hidden>
+Date: Thursday, 28 Sep 2006 00:03:00
+Subject: Message three
+
+Will this one work?
+
+
+------ Message three
+End of all messages
+EOF
+
+burst 14 || exit
+
+run_test 'scan -width 80 14-last' \
+" 14 09/29 Test Burst Messag Test digest<<This is a preamble -------
Message
+ 15+ 09/28 Mister Burster Message one<<-This is message one >>
+ 16 09/28 Mister Burster Message two<<This is message two For real. >>
+ 17 09/28 Mister Burster Message three<<Will this one work? >>"
+
+#
+# Check to see if each message is what we expect
+#
+
+run_test 'show -noheader -noshow 15' \
+"From: Mister Burster <address@hidden>
+To: Nobody 1 <address@hidden>
+Date: Thursday, 28 Sep 2006 00:01:00
+Subject: Message one
+
+-This is message one"
+
+run_test 'show -noheader -noshow 16' \
+"From: Mister Burster <address@hidden>
+To: Nobody 2 <address@hidden>
+Date: Thursday, 28 Sep 2006 00:02:00
+Subject: Message two
+
+This is message two
+For real."
+
+#
+# Backticks used by run_test can consume blank lines at the end of the
+# command output, so use check for this one.
+#
+
+expected="${MH_TEST_DIR}/$$.expected"
+cat > "${expected}" <<EOF
+From: Mister Burster <address@hidden>
+To: Nobody 3 <address@hidden>
+Date: Thursday, 28 Sep 2006 00:03:00
+Subject: Message three
+
+Will this one work?
+
+EOF
+
+check "${expected}" `mhpath 17`
+
+exit $failed
http://git.savannah.gnu.org/cgit/nmh.git/commit/?id=31fb848410e127fe28ca27fb59726ef108a57c9c
commit 31fb848410e127fe28ca27fb59726ef108a57c9c
Author: Ken Hornstein <address@hidden>
Date: Mon Mar 5 13:24:41 2012 -0500
Update with recent fix.
diff --git a/docs/pending-release-notes b/docs/pending-release-notes
index 8efb7b9..111cb2f 100644
--- a/docs/pending-release-notes
+++ b/docs/pending-release-notes
@@ -40,3 +40,4 @@ Things to add to the release notes for the next full release:
to include appropriate From: headers based on either the -from switch
or the local mailbox.
- burst(1) now supports any valid message delimiter according to RFC 934.
+- A problem with the MD5 digest calculator on 64-bit systems has been fixed.
http://git.savannah.gnu.org/cgit/nmh.git/commit/?id=23346694ffc1337359c76ea3b6b158f4dc3e0c6d
commit 23346694ffc1337359c76ea3b6b158f4dc3e0c6d
Author: Ken Hornstein <address@hidden>
Date: Mon Mar 5 13:21:04 2012 -0500
Change this to use "uint32_t" for a 32-bit type, otherwise we can get
wrong MD5 checksums on 64-bit systems. Score another one for the
test suite!
diff --git a/h/md5.h b/h/md5.h
index e49ef4e..ff52413 100644
--- a/h/md5.h
+++ b/h/md5.h
@@ -14,6 +14,12 @@
#include <h/nmh.h>
/*
+ * We need this for uint32_t
+ */
+
+#include <inttypes.h>
+
+/*
* Use prototypes for nmh/mh
*/
#define PROTOTYPES 1
@@ -35,7 +41,7 @@ typedef unsigned char *POINTER;
typedef unsigned short int UINT2;
/* UINT4 defines a four byte word */
-typedef unsigned long int UINT4;
+typedef uint32_t UINT4;
/* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
http://git.savannah.gnu.org/cgit/nmh.git/commit/?id=a1aa5032943899145617de8d28165556fb2ff2ae
commit a1aa5032943899145617de8d28165556fb2ff2ae
Author: Ken Hornstein <address@hidden>
Date: Mon Mar 5 12:23:15 2012 -0500
Fix burst so it actually complies with RFC 934. This means discarding
any extra stuff leftover at the end of an encapsulated message.
diff --git a/uip/burst.c b/uip/burst.c
index 2c741c7..1f626f3 100644
--- a/uip/burst.c
+++ b/uip/burst.c
@@ -30,8 +30,8 @@ static struct swit switches[] = {
};
struct smsg {
- long s_start;
- long s_stop;
+ off_t s_start;
+ off_t s_stop;
};
/*
@@ -209,9 +209,8 @@ static int
find_delim (int msgnum, struct smsg *smsgs)
{
int wasdlm, msgp;
- long pos;
+ off_t pos;
char c, *msgnam;
- int cc;
char buffer[BUFSIZ];
FILE *in;
@@ -219,25 +218,46 @@ find_delim (int msgnum, struct smsg *smsgs)
adios (msgnam, "unable to read message");
for (msgp = 0, pos = 0L; msgp <= MAXFOLDER;) {
+ /*
+ * We're either at the beginning of the whole message, or
+ * we're just past the delimiter of the last message.
+ * Swallow lines until we get to something that's not a newline
+ */
while (fgets (buffer, sizeof(buffer), in) && buffer[0] == '\n')
pos += (long) strlen (buffer);
if (feof (in))
break;
- fseek (in, pos, SEEK_SET);
+
+ /*
+ * Reset to the beginning of the last non-blank line, and save our
+ * starting position. This is where the encapsulated message
+ * starts.
+ */
+ fseeko (in, pos, SEEK_SET);
smsgs[msgp].s_start = pos;
+ /*
+ * Read in lines until we get to a message delimiter.
+ *
+ * Previously we checked to make sure the preceeding line and
+ * next line was a newline. That actually does not comply with
+ * RFC 934, so make sure we break on a message delimiter even
+ * if the previous character was NOT a newline.
+ */
for (c = 0; fgets (buffer, sizeof(buffer), in); c = buffer[0]) {
- if (CHECKDELIM(buffer)
- && (msgp == 1 || c == '\n')
- && ((cc = peekc (in)) == '\n' || cc == EOF))
+ if ((wasdlm = CHECKDELIM(buffer)))
break;
else
pos += (long) strlen (buffer);
}
- wasdlm = CHECKDELIM(buffer);
- if (smsgs[msgp].s_start != pos)
+ /*
+ * Only count as a new message if we got the message delimiter.
+ * Swallow a blank line if it was right before the message delimiter.
+ */
+ if (smsgs[msgp].s_start != pos && wasdlm)
smsgs[msgp++].s_stop = (c == '\n' && wasdlm) ? pos - 1 : pos;
+
if (feof (in)) {
#if 0
if (wasdlm) {
@@ -251,7 +271,7 @@ find_delim (int msgnum, struct smsg *smsgs)
}
fclose (in);
- return (msgp - 1); /* toss "End of XXX Digest" */
+ return (msgp - 1); /* return the number of messages burst */
}
@@ -358,7 +378,7 @@ burst (struct msgs **mpp, int msgnum, struct smsg *smsgs,
int numburst,
printf ("message %d of digest %d becomes message %d\n", j, msgnum,
i);
chmod (f2, mode);
- fseek (in, smsgs[j].s_start, SEEK_SET);
+ fseeko (in, smsgs[j].s_start, SEEK_SET);
cpybrst (in, out, msgnam, f2,
(int) (smsgs[j].s_stop - smsgs[j].s_start));
fclose (out);
http://git.savannah.gnu.org/cgit/nmh.git/commit/?id=4692445bb90e907dfb96ca05364f4a5638192eba
commit 4692445bb90e907dfb96ca05364f4a5638192eba
Author: Ken Hornstein <address@hidden>
Date: Thu Mar 1 15:17:43 2012 -0500
A test for burst; still needs work.
diff --git a/Makefile.am b/Makefile.am
index faa7485..7d8568f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -40,7 +40,9 @@ TESTS_ENVIRONMENT = address@hidden@ \
##
## Important note: the "cleanup" test should always be last
##
-TESTS = test/bad-input/test-header test/comp/test-comp-format \
+TESTS = test/bad-input/test-header \
+ test/burst/test-burst \
+ test/comp/test-comp-format \
test/folder/test-create \
test/folder/test-total test/format/test-localmbox \
test/format/test-myname test/format/test-myhost \
diff --git a/test/burst/test-burst b/test/burst/test-burst
new file mode 100755
index 0000000..872844c
--- /dev/null
+++ b/test/burst/test-burst
@@ -0,0 +1,53 @@
+#!/bin/sh
+#
+# Tests to see if bursting messages works correctly.
+#
+
+if test -z "${MH_OBJ_DIR}"; then
+ srcdir=`dirname "$0"`/../..
+ MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
+fi
+
+. "${MH_OBJ_DIR}/test/common.sh"
+
+setup_test
+
+#
+# Create a test message that we can burst
+#
+
+cat > "${MH_TEST_DIR}/Mail/inbox/11" <<EOF
+From: Test Burst Message <address@hidden>
+To: Test Recipient <address@hidden>
+Date: Friday, 29 Sep 2006 00:00:00
+Subject: Test digest
+
+------- Message one
+
+From: Mister Burster <address@hidden>
+To: Nobody 1 <address@hidden>
+Date: Thursday, 28 Sep 2006 00:01:00
+Subject: Message one
+
+This is message one
+
+------- Message two
+
+From: Mister Burster <address@hidden>
+To: Nobody 2 <address@hidden>
+Date: Thursday, 28 Sep 2006 00:02:00
+Subject: Message two
+
+This is message two
+For real.
+
+-------
+
+End of all messages
+EOF
+
+burst 11 || exit
+
+scan 11-last
+
+exit 0
-----------------------------------------------------------------------
Summary of changes:
Makefile.am | 4 +-
docs/pending-release-notes | 1 +
h/md5.h | 8 ++-
test/burst/test-burst | 147 ++++++++++++++++++++++++++++++++++++++++++++
uip/burst.c | 44 ++++++++++----
5 files changed, 190 insertions(+), 14 deletions(-)
create mode 100755 test/burst/test-burst
hooks/post-receive
--
The nmh Mail Handling System
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Nmh-commits] [SCM] The nmh Mail Handling System branch, master, updated. 8115c2f00dda36b1ee8db290743536a9b6e406cf,
Ken Hornstein <=