Don't just unset FTP_PATH unilaterally, it might have been a timeout
in which case we should simply log in again.
This commit is contained in:
parent
a5ff41a0e2
commit
1d90be277e
|
@ -190,19 +190,17 @@ mediaGetFTP(Device *dev, char *file, Boolean probe)
|
|||
while ((fp = ftpGet(OpenConn, try, 0)) == NULL) {
|
||||
/* If a hard fail, try to "bounce" the ftp server to clear it */
|
||||
if (ftpErrno(OpenConn) != 550) {
|
||||
char *cp = variable_get(VAR_FTP_PATH);
|
||||
|
||||
dev->shutdown(dev);
|
||||
variable_unset(VAR_FTP_PATH);
|
||||
if (ftpErrno(OpenConn) != 421)) /* Timeout? */
|
||||
variable_unset(VAR_FTP_PATH);
|
||||
/* If we can't re-initialize, just forget it */
|
||||
if (!dev->init(dev)) {
|
||||
netDown(dev);
|
||||
fclose(OpenConn);
|
||||
OpenConn = NULL;
|
||||
variable_unset(VAR_FTP_PATH);
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
variable_set2(VAR_FTP_PATH, cp);
|
||||
}
|
||||
else if (probe)
|
||||
return NULL;
|
||||
|
|
|
@ -190,19 +190,17 @@ mediaGetFTP(Device *dev, char *file, Boolean probe)
|
|||
while ((fp = ftpGet(OpenConn, try, 0)) == NULL) {
|
||||
/* If a hard fail, try to "bounce" the ftp server to clear it */
|
||||
if (ftpErrno(OpenConn) != 550) {
|
||||
char *cp = variable_get(VAR_FTP_PATH);
|
||||
|
||||
dev->shutdown(dev);
|
||||
variable_unset(VAR_FTP_PATH);
|
||||
if (ftpErrno(OpenConn) != 421)) /* Timeout? */
|
||||
variable_unset(VAR_FTP_PATH);
|
||||
/* If we can't re-initialize, just forget it */
|
||||
if (!dev->init(dev)) {
|
||||
netDown(dev);
|
||||
fclose(OpenConn);
|
||||
OpenConn = NULL;
|
||||
variable_unset(VAR_FTP_PATH);
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
variable_set2(VAR_FTP_PATH, cp);
|
||||
}
|
||||
else if (probe)
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in New Issue