aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/lukemftp/src/ftp.c
diff options
context:
space:
mode:
authorMike Heffner <mikeh@FreeBSD.org>2004-04-27 00:31:36 +0000
committerMike Heffner <mikeh@FreeBSD.org>2004-04-27 00:31:36 +0000
commit7e475d60f53f104292ac3b1c0015eeb52678c424 (patch)
tree80713a30b46e815ba6ac317d444160c8eea2f79e /contrib/lukemftp/src/ftp.c
parent0e54ef8be7e8aae6d1a1919f34d62ef4a6222e67 (diff)
downloadsrc-7e475d60f53f104292ac3b1c0015eeb52678c424.tar.gz
src-7e475d60f53f104292ac3b1c0015eeb52678c424.zip
Import the latest (4/26/04) CVS lukemftp. This adds the ability to
have a prefix string on the progressbar and brings in a patch by mux@ to fix the condition when connect() returns EINTR. Requested by: mux
Notes
Notes: svn path=/vendor/lukemftp/dist/; revision=128671
Diffstat (limited to 'contrib/lukemftp/src/ftp.c')
-rw-r--r--contrib/lukemftp/src/ftp.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/contrib/lukemftp/src/ftp.c b/contrib/lukemftp/src/ftp.c
index ad3aa47c0b86..0c3b3d4c85f8 100644
--- a/contrib/lukemftp/src/ftp.c
+++ b/contrib/lukemftp/src/ftp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ftp.c,v 1.122 2003/08/07 11:13:55 agc Exp $ */
+/* $NetBSD: ftp.c,v 1.125 2004/04/10 12:21:39 lukem Exp $ */
/*-
* Copyright (c) 1996-2002 The NetBSD Foundation, Inc.
@@ -99,7 +99,7 @@
#if 0
static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94";
#else
-__RCSID("$NetBSD: ftp.c,v 1.122 2003/08/07 11:13:55 agc Exp $");
+__RCSID("$NetBSD: ftp.c,v 1.125 2004/04/10 12:21:39 lukem Exp $");
#endif
#endif /* not lint */
@@ -230,10 +230,7 @@ hookup(char *host, char *port)
cause = "socket";
continue;
}
- while ((error = xconnect(s, res->ai_addr, res->ai_addrlen)) < 0
- && errno == EINTR) {
- ;
- }
+ error = xconnect(s, res->ai_addr, res->ai_addrlen);
if (error) {
/* this "if" clause is to prevent print warning twice */
if (res->ai_next) {
@@ -276,7 +273,8 @@ hookup(char *host, char *port)
int tos = IPTOS_LOWDELAY;
if (setsockopt(s, IPPROTO_IP, IP_TOS, (char *)&tos,
sizeof(int)) < 0)
- warn("setsockopt TOS (ignored)");
+ if (debug)
+ warn("setsockopt TOS (ignored)");
}
#endif
cin = fdopen(s, "r");
@@ -573,13 +571,13 @@ empty(FILE *cin, FILE *din, int sec)
struct pollfd pfd[2];
if (cin) {
- pfd[nfd].fd = fileno(cin);
- pfd[nfd++].events = POLLIN;
+ pfd[nfd].fd = fileno(cin);
+ pfd[nfd++].events = POLLIN;
}
if (din) {
- pfd[nfd].fd = fileno(din);
- pfd[nfd++].events = POLLIN;
+ pfd[nfd].fd = fileno(din);
+ pfd[nfd++].events = POLLIN;
}
if ((nr = poll(pfd, nfd, sec * 1000)) <= 0)
@@ -1325,7 +1323,8 @@ initconn(void)
if ((options & SO_DEBUG) &&
setsockopt(data, SOL_SOCKET, SO_DEBUG, (char *)&on,
sizeof(on)) < 0)
- warn("setsockopt (ignored)");
+ if (debug)
+ warn("setsockopt (ignored)");
result = COMPLETE + 1;
switch (data_addr.su_family) {
case AF_INET:
@@ -1544,8 +1543,6 @@ initconn(void)
while (xconnect(data, (struct sockaddr *)&data_addr.si_su,
data_addr.su_len) < 0) {
- if (errno == EINTR)
- continue;
if (activefallback) {
(void)close(data);
data = -1;
@@ -1563,7 +1560,8 @@ initconn(void)
on = IPTOS_THROUGHPUT;
if (setsockopt(data, IPPROTO_IP, IP_TOS, (char *)&on,
sizeof(int)) < 0)
- warn("setsockopt TOS (ignored)");
+ if (debug)
+ warn("setsockopt TOS (ignored)");
}
#endif
return (0);
@@ -1596,7 +1594,8 @@ initconn(void)
if (options & SO_DEBUG &&
setsockopt(data, SOL_SOCKET, SO_DEBUG, (char *)&on,
sizeof(on)) < 0)
- warn("setsockopt (ignored)");
+ if (debug)
+ warn("setsockopt (ignored)");
len = sizeof(data_addr.si_su);
memset((char *)&data_addr, 0, sizeof (data_addr));
if (getsockname(data, (struct sockaddr *)&data_addr.si_su, &len) < 0) {
@@ -1696,7 +1695,8 @@ initconn(void)
on = IPTOS_THROUGHPUT;
if (setsockopt(data, IPPROTO_IP, IP_TOS, (char *)&on,
sizeof(int)) < 0)
- warn("setsockopt TOS (ignored)");
+ if (debug)
+ warn("setsockopt TOS (ignored)");
}
#endif
return (0);
@@ -1729,7 +1729,8 @@ dataconn(const char *lmode)
int tos = IPTOS_THROUGHPUT;
if (setsockopt(s, IPPROTO_IP, IP_TOS, (char *)&tos,
sizeof(int)) < 0) {
- warn("setsockopt TOS (ignored)");
+ if (debug)
+ warn("setsockopt TOS (ignored)");
}
}
#endif