#include "wordlist.h"
#include "SquidTime.h"
#include "URLScheme.h"
+#include "SquidString.h"
/**
\defgroup ServerProtocolFTPInternal Server-Side FTP Internals
int64_t restarted_offset;
char *proxy_host;
size_t list_width;
- wordlist *cwd_message;
+ String cwd_message;
char *old_request;
char *old_reply;
char *old_filepath;
if (ctrl.message)
wordlistDestroy(&ctrl.message);
- if (cwd_message)
- wordlistDestroy(&cwd_message);
+ cwd_message.clean();
safe_free(ctrl.last_reply);
if (flags.isdir) {
flags.listing = 1;
- safe_delete(listing);
+ listing.reset();
parseListing();
return;
/* Copy the rest of the message to cwd_message to be printed in
* error messages
*/
- wordlistAddWl(&cwd_message, ctrl.message);
+ cwd_message.append('\n');
+ for (wordlist *w = ctrl.message; w; w = w->next) {
+ cwd_message.append(' ');
+ cwd_message.append(w->key);
+ }
debugs(9, 3, HERE << "state=" << state << ", code=" << ctrl.replycode);
if (code >= 200 && code < 300) {
/* CWD OK */
ftpState->unhack();
- /* Reset cwd_message to only include the last message */
-
- if (ftpState->cwd_message)
- wordlistDestroy(&ftpState->cwd_message);
-
- ftpState->cwd_message = ftpState->ctrl.message;
+ /* Reset cwd_message to only include the last message */
+ ftpState->cwd_message.reset("");
+ for (wordlist *w = ftpState->ctrl.message; w; w = w->next) {
+ ftpState->cwd_message.append(' ');
+ ftpState->cwd_message.append(w->key);
+ }
ftpState->ctrl.message = NULL;
/* Continue to traverse the path */
if(error == ERR_FTP_LISTING) {
err->ftp.listing = &listing;
- err->ftp.cwd_msg = cwd_message;
+ err->ftp.cwd_msg = xstrdup(html_quote(cwd_message.buf()));
}
else {
err->ftp.server_msg = ctrl.message;