static int ftpDebug = 0;
static int ftpTimeoutSecs = TIMEOUT_SECS;
+#ifdef DYING
static int ftpCheckResponse(urlinfo *u, char ** str);
static int ftpCommand(urlinfo *u, char * command, ...);
static int copyData(FD_t sfd, FD_t tfd);
static int getHostAddress(const char * host, struct in_addr * address);
+#endif
static int ftpCheckResponse(urlinfo *u, char ** str) {
static char buf[BUFFER_SIZE + 1];
return 0;
}
-int ftpCommand(urlinfo *u, char * command, ...) {
+static int ftpCommand(urlinfo *u, char * command, ...) {
va_list ap;
int len;
char * s;
return u->ftpControl;
}
-int copyData(FD_t sfd, FD_t tfd) {
+static int copyData(FD_t sfd, FD_t tfd) {
char buf[BUFFER_SIZE];
fd_set emptySet, readSet;
struct timeval timeout;
return 0;
}
+static int ftpGetFileDone(urlinfo *u) {
+ if (u->ftpGetFileDoneNeeded && ftpCheckResponse(u, NULL))
+ return FTPERR_BAD_SERVER_RESPONSE;
+ u->ftpGetFileDoneNeeded = 0;
+ return 0;
+}
+
int ftpGetFileDesc(FD_t fd)
{
urlinfo *u;
u = (urlinfo *)fd->fd_url;
remotename = u->path;
+/*
+ * XXX When ftpGetFileDesc() is called, there may be a lurking
+ * XXX transfer complete message (if ftpGetFileDone() was not
+ * XXX called to clear that message). Clear that message now.
+ */
+
+ if (u->ftpGetFileDoneNeeded)
+ rc = ftpGetFileDone(u);
+
if (ftpDebug)
fprintf(stderr, "-> PASV\n");
if (write(u->ftpControl, "PASV\r\n", 6) != 6) {
return rc;
}
- return 0;
-}
-
-static int ftpGetFileDone(urlinfo *u) {
- if (ftpCheckResponse(u, NULL))
- return FTPERR_BAD_SERVER_RESPONSE;
+ u ->ftpGetFileDoneNeeded = 1;
return 0;
}
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-01-21 10:57-0500\n"
+"POT-Creation-Date: 1999-01-21 14:10-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "OK"
msgstr ""
-#: ../ftp.c:554
+#: ../ftp.c:567
msgid "Success"
msgstr ""
-#: ../ftp.c:557
+#: ../ftp.c:570
msgid "Bad server response"
msgstr ""
-#: ../ftp.c:560
+#: ../ftp.c:573
msgid "Server IO error"
msgstr ""
-#: ../ftp.c:563
+#: ../ftp.c:576
msgid "Server timeout"
msgstr ""
-#: ../ftp.c:566
+#: ../ftp.c:579
msgid "Unable to lookup server host address"
msgstr ""
-#: ../ftp.c:569
+#: ../ftp.c:582
msgid "Unable to lookup server host name"
msgstr ""
-#: ../ftp.c:572
+#: ../ftp.c:585
msgid "Failed to connect to server"
msgstr ""
-#: ../ftp.c:575
+#: ../ftp.c:588
msgid "Failed to establish data connection to server"
msgstr ""
-#: ../ftp.c:578
+#: ../ftp.c:591
msgid "IO error to local file"
msgstr ""
-#: ../ftp.c:581
+#: ../ftp.c:594
msgid "Error setting remote server to passive mode"
msgstr ""
-#: ../ftp.c:584
+#: ../ftp.c:597
msgid "File not found on server"
msgstr ""
-#: ../ftp.c:587
+#: ../ftp.c:600
msgid "Abort in progress"
msgstr ""
-#: ../ftp.c:591
+#: ../ftp.c:604
msgid "Unknown or unexpected error"
msgstr ""