diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2011-04-29 11:03:54 +0200 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2011-04-29 15:07:24 +0200 |
commit | 48b4421173725c8d2eb9c36342a1a70937c16de0 (patch) | |
tree | 9c8d8d9a7412383add5de11c33010820d36cfec4 | |
parent | 2ef157e08bc4f8796223d179868a562648a5dbdd (diff) | |
download | fetchmail-48b4421173725c8d2eb9c36342a1a70937c16de0.tar.gz fetchmail-48b4421173725c8d2eb9c36342a1a70937c16de0.tar.bz2 fetchmail-48b4421173725c8d2eb9c36342a1a70937c16de0.zip |
Remove unused code.
-rw-r--r-- | driver.c | 19 | ||||
-rw-r--r-- | socket.c | 48 | ||||
-rw-r--r-- | socket.h | 6 |
3 files changed, 0 insertions, 73 deletions
@@ -1083,25 +1083,6 @@ static int do_session( strlcpy(errbuf, strerror(err_no), sizeof(errbuf)); report_complete(stderr, ": %s\n", errbuf); -#ifdef __UNUSED__ - /* - * Don't use this. It was an attempt to address Debian bug - * #47143 (Notify user by mail when pop server nonexistent). - * Trouble is, that doesn't work; you trip over the case - * where your SLIP or PPP link is down... - */ - /* warn the system administrator */ - if (open_warning_by_mail(ctl) == 0) - { - stuff_warning(iana_charset, ctl, - GT_("Subject: Fetchmail unreachable-server warning.")); - stuff_warning(NULL, ctl, ""); - stuff_warning(NULL, ctl, GT_("Fetchmail could not reach the mail server %s:"), - ctl->server.pollname); - stuff_warning(NULL, ctl, errbuf, ctl->server.pollname); - close_warning_by_mail(ctl, (struct msgblk *)NULL); - } -#endif } err = PS_SOCKET; set_timeout(0); @@ -200,30 +200,6 @@ static int handle_plugin(const char *host, } #endif /* HAVE_SOCKETPAIR */ -#ifdef __UNUSED__ - -int SockCheckOpen(int fd) -/* poll given socket; is it selectable? */ -{ - fd_set r, w, e; - int rt; - struct timeval tv; - - for (;;) - { - FD_ZERO(&r); FD_ZERO(&w); FD_ZERO(&e); - FD_SET(fd, &e); - - tv.tv_sec = 0; tv.tv_usec = 0; - rt = select(fd+1, &r, &w, &e, &tv); - if (rt == -1 && (errno != EAGAIN && errno != EINTR)) - return 0; - if (rt != -1) - return 1; - } -} -#endif /* __UNUSED__ */ - int UnixOpen(const char *path) { int sock = -1; @@ -1027,30 +1003,6 @@ int SockClose(int sock) } #endif -#ifdef __UNUSED__ - /* - * This hangs in RedHat 6.2 after fetchmail runs for a while a - * FIN_WAIT2 comes up in netstat and fetchmail never returns from - * the recv system call. (Reported from jtnews - * <jtnews@bellatlantic.net>, Wed, 24 May 2000 21:26:02.) - * - * Half-close the connection first so the other end gets notified. - * - * This stops sends but allows receives (effectively, it sends a - * TCP <FIN>). */ - if (shutdown(sock, 1) == 0) { - char ch; - /* If there is any data still waiting in the queue, discard it. - * Call recv() until either it returns 0 (meaning we received a FIN) - * or any error occurs. This makes sure all data sent by the other - * side is acknowledged at the TCP level. - */ - if (fm_peek(sock, &ch, 1) > 0) - while (fm_read(sock, &ch, 1) > 0) - continue; - } -#endif /* __UNUSED__ */ - /* if there's an error closing at this point, not much we can do */ return(fm_close(sock)); /* this is guarded */ } @@ -20,12 +20,6 @@ struct addrinfo; /** Create a new client socket; returns -1 on error */ int SockOpen(const char *host, const char *service, const char *plugin, struct addrinfo **); -/** Returns 1 if socket \a fd is OK, 0 if it isn't select()able - * on - probably because it's been closed. You should - * always check this function before passing stuff to the - * select()-based waiter, as otherwise it may loop. - */ -int SockCheckOpen(int fd); /** Get a string terminated by an '\n' (matches interface of fgets). |