aboutsummaryrefslogtreecommitdiffstats
path: root/socket.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-01-16 03:29:34 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-01-16 03:29:34 +0000
commit2dd66a8c50f85adcd210b1d482ed1d5ef6e06142 (patch)
tree9aa0abbe1b7f3cc3e60e90f9c10fbba2dbeaed0f /socket.c
parente89983bc0f308b578d025cc84ef85d00ac9b97fb (diff)
downloadfetchmail-2dd66a8c50f85adcd210b1d482ed1d5ef6e06142.tar.gz
fetchmail-2dd66a8c50f85adcd210b1d482ed1d5ef6e06142.tar.bz2
fetchmail-2dd66a8c50f85adcd210b1d482ed1d5ef6e06142.zip
One step towards proper continuation handling.
svn path=/trunk/; revision=774
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/socket.c b/socket.c
index 734321fc..6b2076e7 100644
--- a/socket.c
+++ b/socket.c
@@ -136,6 +136,18 @@ char *SockGets(char *buf, int len, FILE *sockfp)
return buf;
}
+int SockPeek(FILE *sockfp)
+/* peek at the next socket character without actually reading it */
+{
+ int n;
+ char ch;
+
+ if ((n = recv(fileno(sockfp), &ch, 1, MSG_PEEK)) == -1)
+ return -1;
+ else
+ return(ch);
+}
+
#ifdef MAIN
/*
* Use the chargen service to test input beuffering directly.