aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1996-12-25 10:37:09 +0000
committerEric S. Raymond <esr@thyrsus.com>1996-12-25 10:37:09 +0000
commit481f2fe7871aca3171165913d603fc9ce8d12739 (patch)
tree113e6e1442a19763e655729d3160f27df8f575e0
parentf098021f7c4b021fde38bc91884e467ac9cde676 (diff)
downloadfetchmail-481f2fe7871aca3171165913d603fc9ce8d12739.tar.gz
fetchmail-481f2fe7871aca3171165913d603fc9ce8d12739.tar.bz2
fetchmail-481f2fe7871aca3171165913d603fc9ce8d12739.zip
Include test code.
svn path=/trunk/; revision=690
-rw-r--r--Makefile.in12
-rw-r--r--NEWS11
-rw-r--r--socket.c34
3 files changed, 42 insertions, 15 deletions
diff --git a/Makefile.in b/Makefile.in
index 81b0d76c..d90d907d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -3,7 +3,7 @@
# If you're running QNX, we can't assume a working autoconf.
# So just uncomment all the lines marked QNX.
-VERS=2.5
+VERS=2.6
PL=0
# Ultrix 2.2 make doesn't expand the value of VPATH.
@@ -153,7 +153,9 @@ fetchmail.spec: $(srcdir)/Makefile.in $(srcdir)/specgen.sh
.PHONY: clean realclean distclean mostlyclean
clean:
-rm -f fetchmail *.o core fetchmail.dvi \
- rcfile_l.c rcfile_y.h rcfile_y.c fetchmail.tar fetchmail.tar.gz
+ rcfile_l.c rcfile_y.h rcfile_y.c \
+ fetchmail.tar fetchmail.tar.gz \
+ linetext[12]
distclean: clean
-rm -f Makefile config.h
@@ -218,6 +220,12 @@ fetchmail-$(VERS).tar: $(all)
fetchmail-$(VERS).tar.gz: fetchmail-$(VERS).tar
gzip -f fetchmail-$(VERS).tar
+# Test for stdio line-buffering lossage on sockets
+linetest1: socket.c
+ $(CC) -g -I. -DMAIN socket.c -o linetest1 # Use setlinebuf
+linetest2: socket.c
+ $(CC) -g -I. -DMAIN -DUSE_STDIO socket.c -o linetest2 # Use setvnbuf
+
# The automatically generated dependencies below may omit config.h
# because it is included with ``#include <config.h>'' rather than
# ``#include "config.h"''. So we add the explicit dependency to make sure.
diff --git a/NEWS b/NEWS
index dc28942a..57b088e1 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,17 @@
------------------------------------------------------------------------------
fetchmail-2.6 ()
+features --
+
+
+bugs --
+
+* Fixed length-computation bug (apparently introduced in 2.3) that messed
+ up IMAP deletes.
+
+* Dropped back to separate SockGets/SockWrite code with no attempt at
+ stdio buffering -- we hope this will fix the Solaris peoples' problems.
+
There are 166 people on the fetchmail-friends list.
------------------------------------------------------------------------------
diff --git a/socket.c b/socket.c
index 0a0de3d7..7768c05f 100644
--- a/socket.c
+++ b/socket.c
@@ -34,6 +34,12 @@
#endif
#endif
+/*
+ * There are, in effect, two different implementations here. One
+ * uses read(2) and write(2) directly with no buffering, the other
+ * uses stdio with line buffering (for better throughput). Both
+ * are known to work under Linux.
+ */
/* #define USE_STDIO */
#ifdef USE_STDIO
@@ -116,19 +122,6 @@ va_dcl {
}
#ifndef USE_STDIO
-/*
- * FIXME: This needs to be recoded to use stdio, if that's possible.
- *
- * If you think these functions are too slow and inefficient, you're
- * absolutely right. I wish I could figure out what to do about it.
- * The ancestral popclient used static buffering here to cut down on the
- * number of read(2) calls, but we can't do that because we can have
- * two or more sockets open at a time.
- *
- * The right thing to do would be to use stdio for internal per-socket
- * buffering here (which is why SockOpen() returns a file pointer) but
- * this causes mysterious lossage.
- */
int SockWrite(char *buf, int size, int len, FILE *sockfp)
{
@@ -164,6 +157,7 @@ char *SockGets(char *buf, int len, FILE *sockfp)
*cp = 0;
return buf;
}
+
#else
int SockWrite(char *buf, int size, int len, FILE *sockfp)
@@ -178,4 +172,18 @@ char *SockGets(char *buf, int len, FILE *sockfp)
#endif
+#ifdef MAIN
+/*
+ * Use the chargen service to test buffering directly.
+ */
+main()
+{
+ FILE *fp = SockOpen("localhost", 19);
+ char buf[80];
+
+ while (SockGets(buf, sizeof(buf)-1, fp))
+ SockWrite(buf, 1, strlen(buf), stdout);
+}
+#endif /* MAIN */
+
/* socket.c ends here */