]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Updates auto-save
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 7 Nov 2008 11:00:58 +0000 (00:00 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 7 Nov 2008 11:00:58 +0000 (00:00 +1300)
src/cache_cf.cc
src/cf.data.pre
src/enums.h
src/errorpage.cc
src/ftp.cc

index 1034576d65602edb3c97b3228130ce57b8d6e061..fb889c62456aa0d2269df9620834322fe7e95c0f 100644 (file)
@@ -2475,11 +2475,13 @@ free_time_t(time_t * var)
     *var = 0;
 }
 
+#if UNUSED_CODE
 static void
 dump_size_t(StoreEntry * entry, const char *name, size_t var)
 {
     storeAppendPrintf(entry, "%s %d\n", name, (int) var);
 }
+#endif
 
 static void
 dump_b_size_t(StoreEntry * entry, const char *name, size_t var)
@@ -2507,6 +2509,7 @@ dump_kb_int64_t(StoreEntry * entry, const char *name, int64_t var)
     storeAppendPrintf(entry, "%s %"PRId64" %s\n", name, var, B_KBYTES_STR);
 }
 
+#if UNUSED_CODE
 static void
 parse_size_t(size_t * var)
 {
@@ -2514,6 +2517,7 @@ parse_size_t(size_t * var)
     i = GetInteger();
     *var = (size_t) i;
 }
+#endif
 
 static void
 parse_b_size_t(size_t * var)
index 9b63091ff5ab281702c63ce5b4dbd07a7ae2f963..4c6a8ba5e46f54dce0f6d37730e2e59711d6a002 100644 (file)
@@ -2640,16 +2640,6 @@ DOC_START
        (for example perl.com).
 DOC_END
 
-NAME: ftp_list_width
-TYPE: size_t
-DEFAULT: 32
-LOC: Config.Ftp.list_width
-DOC_START
-       Sets the width of ftp listings. This should be set to fit in
-       the width of a standard browser. Setting this too small
-       can cut off long filenames when browsing ftp sites.
-DOC_END
-
 NAME: ftp_passive
 TYPE: onoff
 DEFAULT: on
index 559c0ee8c4b14b0c71c45f854ef518d52aa08a79..4e453ecf3342807b33fb0767be0de8060aad3fd3 100644 (file)
@@ -98,6 +98,7 @@ typedef enum {
     ERR_ESI,                    /* Failure to perform ESI processing */
     ERR_INVALID_RESP,
     ERR_ICAP_FAILURE,
+    ERR_FTP_LISTING,           /* Display of FTP remote directory */
     ERR_MAX
 } err_type;
 
index 0ba9f5d0b88300799bbcb2df8130d7bf96e9606d..b3b5c9881c52af1ce0a37b77ba28934667d05265 100644 (file)
@@ -812,7 +812,7 @@ ErrorState::Convert(char token)
         if (dnsserver_msg)
             p = dnsserver_msg;
         else if (ftp.cwd_msg)
-            p = ftp.cwd_msg;
+            wordlistCat(ftp.cwd_msg, &mb);
         else
             p = "[unknown]";
 
index 3001318d2fa1e5fb63ae29d82ded52bee8ceca66..d1fa22e442c8dfc53cb281aec0a5243c8bec0dfa 100644 (file)
@@ -107,13 +107,12 @@ struct _ftp_flags
     bool dir_slash;
     bool root_dir;
     bool no_dotdot;
-    bool html_header_sent;
     bool binary;
     bool try_slash_hack;
     bool put;
     bool put_mkdir;
     bool listformat_unknown;
-    bool listing_started;
+    bool listing;
     bool completed_forwarding;
 };
 
@@ -567,9 +566,6 @@ FtpStateData::ftpTimeout(const CommTimeoutCbParams &io)
 void
 FtpStateData::listingFinish()
 {
-    debugs(9,3,HERE);
-    entry->buffer();
-/*
 
 // TODO: figure out what this means and how to show it ...
 
@@ -580,7 +576,6 @@ FtpStateData::listingFinish()
         const char *path = flags.dir_slash ? filepath : ".";
         printfReplyBody("<A HREF=\"%s/\">[As extended directory]</A>\n", rfc1738_escape_part(path));
     }
-*/
 }
 #endif /* DEAD_CODE */
 
@@ -852,28 +847,6 @@ found:
     return p;
 }
 
-/// \ingroup ServerProtocolFTPInternal
-static const char *
-dots_fill(size_t len)
-{
-    static char buf[256];
-    size_t i = 0;
-
-    if (len > Config.Ftp.list_width) {
-        memset(buf, ' ', 256);
-        buf[0] = '\n';
-        buf[Config.Ftp.list_width + 4] = '\0';
-        return buf;
-    }
-
-    for (i = len; i < Config.Ftp.list_width; i++)
-        buf[i - len] = (i % 2) ? '.' : ' ';
-
-    buf[i - len] = '\0';
-
-    return buf;
-}
-
 MemBuf *
 FtpStateData::htmlifyListEntry(const char *line)
 {
@@ -1207,7 +1180,7 @@ FtpStateData::dataRead(const CommIoCbParams &io)
 
             maybeReadVirginBody();
         } else {
-            if (!flags.http_header_sent && !fwd->ftpPasvFailed() && flags.pasv_supported) {
+            if (!flags.http_header_sent && !fwd->ftpPasvFailed() && flags.pasv_supported && !flags.listing) {
                 fwd->dontRetry(false); /* this is a retryable error */
                 fwd->ftpPasvFailed(true);
             }
@@ -1267,28 +1240,12 @@ FtpStateData::processReplyBody()
 
     if (flags.isdir) {
 
-/*
-// TODO: do we still need this in header?
-    if (flags.need_base_href)
-        printfReplyBody("<BASE HREF=\"%s\">\n", html_quote(base_href.buf()));
-*/
-
-        if (cwd_message) {
-            String tmp;
-            for (wordlist *w = cwd_message; w; w = w->next) {
-                tmp.append(html_quote(w->key));
-                tmp.append("\n");
-            }
-           err_message = xstrdup(tmp.buf());
-        }
-
-        flags.html_header_sent = 1;
-
+        flags.listing = 1;
+        safe_delete(listing);
         parseListing();
         return;
 
-    } else 
-    if (const int csize = data.readBuf->contentSize()) {
+    } else if (const int csize = data.readBuf->contentSize()) {
         writeReplyBody(data.readBuf->content(), csize);
         debugs(9, 5, HERE << "consuming " << csize << " bytes of readBuf");
         data.readBuf->consume(csize);
@@ -3190,7 +3147,7 @@ ftpReadTransferDone(FtpStateData * ftpState)
     if (code == 226 || code == 250) {
         /* Connection closed; retrieval done. */
 
-        if (ftpState->flags.html_header_sent)
+        if (ftpState->flags.listing)
             ftpState->failed(ERR_FTP_LISTING, 0);
         ftpSendQuit(ftpState);
     } else {                   /* != 226 */
@@ -3421,13 +3378,13 @@ FtpStateData::failedErrorMessage(err_type error, int xerrno)
 
     if(error == ERR_FTP_LISTING) {
         err->ftp.listing = &listing;
+        err->ftp.cwd_msg = cwd_message;
     }
     else {
         err->ftp.server_msg = ctrl.message;
         ctrl.message = NULL;
     }
 
-
     if (old_request)
         command = old_request;
     else