$(srcdir)/rcfile_y.c: $(srcdir)/rcfile_y.y
parser = $(srcdir)/rcfile_l.l $(srcdir)/rcfile_y.y
-headers = $(srcdir)/fetchmail.h $(srcdir)/socket.h $(srcdir)/smtp.h \
+headers = $(srcdir)/fetchmail.h $(srcdir)/smtp.h \
$(srcdir)/mx.h $(srcdir)/md5.h $(srcdir)/md5global.h
extra = $(srcdir)/alloca.c $(srcdir)/getopt.[ch] $(srcdir)/getopt1.c \
$(srcdir)/strcasecmp.c
#include <netinet/in.h> /* must be included before "socket.h".*/
#include <netdb.h>
#endif /* KERBEROS_V4 */
-#include "socket.h"
#include "fetchmail.h"
#include "smtp.h"
return(ctl->smtp_sockfp);
}
+static int strip_gets(buf, len, sockfp)
+/* get a line of input, stripping out \r and \n */
+char *buf;
+int len;
+FILE *sockfp;
+{
+ if (fgets(buf, len, sockfp) == (char *)NULL)
+ return(-1);
+ else
+ {
+ char *sp, *tp;
+
+ for (tp = sp = buf; *sp; sp++)
+ if (*sp != '\r' && *sp != '\n')
+ *tp++ = *sp;
+ *tp++ = '\0';
+
+ return(strlen(buf));
+ }
+}
+
static int gen_readmsg (sockfp, len, delimited, ctl)
/* read message content and ship to SMTP or MDA */
FILE *sockfp; /* to which the server is connected */
oldlen = 0;
while (delimited || len > 0)
{
- if ((n = SockGets(buf,sizeof(buf),sockfp)) < 0)
+ if ((n = strip_gets(buf,sizeof(buf),sockfp)) < 0)
return(PS_SOCKET);
vtalarm(ctl->timeout);
int closemailpipe(int);
int daemonize(const char *, void (*)(int));
+FILE *Socket(char *, int);
+
int prc_parse_file(const char *);
int prc_filecheck(const char *);
#if defined(STDC_HEADERS)
#include <stdlib.h>
#endif
-#include "socket.h"
#include "fetchmail.h"
static int count, seen, recent, unseen;
#if defined(STDC_HEADERS)
#include <stdlib.h>
#endif
-#include "socket.h"
#include "fetchmail.h"
static int pound_arg, equal_arg;
#include <stdlib.h>
#endif
-#include "socket.h"
#include "fetchmail.h"
#define PROTOCOL_ERROR {fputs("fetchmail: protocol error\n", stderr); return(PS_ERROR);}
#include <stdio.h>
#include <unistd.h>
#include <string.h>
-#include "socket.h"
#include "fetchmail.h"
#include "smtp.h"
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
-#if defined(HAVE_STDARG_H)
-#include <stdarg.h>
+
+#ifndef INADDR_NONE
+#ifdef INADDR_BROADCAST
+#define INADDR_NONE INADDR_BROADCAST
#else
-#include <varargs.h>
+#define INADDR_NONE -1
+#endif
#endif
-#include "socket.h"
#define INTERNAL_BUFSIZE 2048
return sockfp;
}
-int SockGets(buf, len, sockfp)
-char *buf;
-int len;
-FILE *sockfp;
-{
- if (fgets(buf, len, sockfp) == (char *)NULL)
- return(-1);
- else
- {
- char *sp, *tp;
-
- for (tp = sp = buf; *sp; sp++)
- if (*sp != '\r' && *sp != '\n')
- *tp++ = *sp;
- *tp++ = '\0';
-
- return(strlen(buf));
- }
-}
-
/* socket.c ends here */