]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Don't clobbert ctrl.message when the PASS command fails.
authorwessels <>
Fri, 25 Jun 1999 03:12:22 +0000 (03:12 +0000)
committerwessels <>
Fri, 25 Jun 1999 03:12:22 +0000 (03:12 +0000)
It looks like we moved the server response to "cwd_message" after
PASS so that it could be displayed in a directory listing, but
if PASS fails it wiped out important information for the user
(such as alternate FTP sites)

src/ftp.cc

index e1ca9eca5e4402cc1e559c43d07f05f587523420..f44e558bf5acf011252a1bb1000e6528d62793c3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.285 1999/05/19 19:57:45 wessels Exp $
+ * $Id: ftp.cc,v 1.286 1999/06/24 21:12:22 wessels Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -1290,7 +1290,7 @@ ftpHandleControlReply(FtpStateData * ftpState)
     safe_free(ftpState->ctrl.last_reply);
     ftpState->ctrl.last_reply = (*W)->key;
     safe_free(*W);
-    debug(9, 8) ("ftpReadControlReply: state=%d, code=%d\n", ftpState->state,
+    debug(9, 8) ("ftpHandleControlReply: state=%d, code=%d\n", ftpState->state,
        ftpState->ctrl.replycode);
     FTP_SM_FUNCS[ftpState->state] (ftpState);
 }
@@ -1364,13 +1364,13 @@ ftpReadPass(FtpStateData * ftpState)
 {
     int code = ftpState->ctrl.replycode;
     debug(9, 3) ("ftpReadPass\n");
-    if (ftpState->ctrl.message) {
-       if (ftpState->cwd_message)
-           wordlistDestroy(&ftpState->cwd_message);
-       ftpState->cwd_message = ftpState->ctrl.message;
-       ftpState->ctrl.message = NULL;
-    }
     if (code == 230) {
+       if (ftpState->ctrl.message) {
+           if (ftpState->cwd_message)
+               wordlistDestroy(&ftpState->cwd_message);
+           ftpState->cwd_message = ftpState->ctrl.message;
+           ftpState->ctrl.message = NULL;
+       }
        ftpSendType(ftpState);
     } else {
        ftpFail(ftpState);