- "round-robin" cache_peer counters are reset every 5 minutes to
compensate previously dead peers
- DNS retransmit parameters
+ - Show all FTP server messages
Changes to Squid-2.4.DEVEL2 ():
/*
- * $Id: cache_cf.cc,v 1.340 2000/05/02 20:31:44 hno Exp $
+ * $Id: cache_cf.cc,v 1.341 2000/05/02 20:41:22 hno Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
*list = NULL;
}
-wordlist *
+const char *
wordlistAdd(wordlist ** list, const char *key)
{
while (*list)
*list = memAllocate(MEM_WORDLIST);
(*list)->key = xstrdup(key);
(*list)->next = NULL;
- return *list;
+ return (*list)->key;
+}
+
+void
+wordlistJoin(wordlist ** list, wordlist **wl)
+{
+ while (*list)
+ list = &(*list)->next;
+ *list = *wl;
+ *wl = NULL;
+}
+
+void
+wordlistAddWl(wordlist ** list, wordlist *wl)
+{
+ while (*list)
+ list = &(*list)->next;
+ for(;wl;wl=wl->next, list = &(*list)->next) {
+ *list = memAllocate(MEM_WORDLIST);
+ (*list)->key = xstrdup(wl->key);
+ (*list)->next = NULL;
+ }
}
void
/*
- * $Id: ftp.cc,v 1.291 2000/05/02 20:25:33 hno Exp $
+ * $Id: ftp.cc,v 1.292 2000/05/02 20:41:22 hno Exp $
*
* DEBUG: section 9 File Transfer Protocol (FTP)
* AUTHOR: Harvest Derived
xmemmove(ftpState->ctrl.buf, ftpState->ctrl.buf + bytes_used,
ftpState->ctrl.offset);
}
- /* Find the last line of the reply message */
+ /* Move the last line of the reply message to ctrl.last_reply */
for (W = &ftpState->ctrl.message; (*W)->next; W = &(*W)->next);
safe_free(ftpState->ctrl.last_reply);
- ftpState->ctrl.last_reply = (*W)->key;
- safe_free(*W);
+ ftpState->ctrl.last_reply = xstrdup((*W)->key);
+ wordlistDestroy(W);
+ /* Copy the rest of the message to cwd_message to be printed in
+ * error messages
+ */
+ wordlistAddWl(&ftpState->cwd_message, ftpState->ctrl.message);
debug(9, 8) ("ftpHandleControlReply: state=%d, code=%d\n", ftpState->state,
ftpState->ctrl.replycode);
FTP_SM_FUNCS[ftpState->state] (ftpState);
if (ftpState->ctrl.message) {
if (strstr(ftpState->ctrl.message->key, "NetWare"))
ftpState->flags.skip_whitespace = 1;
- if (ftpState->cwd_message)
- wordlistDestroy(&ftpState->cwd_message);
- ftpState->cwd_message = ftpState->ctrl.message;
- ftpState->ctrl.message = NULL;
}
ftpSendUser(ftpState);
} else if (code == 120) {
int code = ftpState->ctrl.replycode;
debug(9, 3) ("ftpReadPass\n");
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);
if (code >= 200 && code < 300) {
/* CWD OK */
ftpUnhack(ftpState);
+ /* Reset cwd_message to only include the last message */
if (ftpState->cwd_message)
wordlistDestroy(&ftpState->cwd_message);
ftpState->cwd_message = ftpState->ctrl.message;
err = errorCon(ERR_FTP_FAILURE, HTTP_BAD_GATEWAY);
err->xerrno = errno;
err->request = requestLink(ftpState->request);
- err->ftp.server_msg = ftpState->ctrl.message;
- ftpState->ctrl.message = NULL;
+ err->ftp.server_msg = ftpState->cwd_message;
+ ftpState->cwd_message = NULL;
if (ftpState->old_request)
command = ftpState->old_request;
else
/*
- * $Id: net_db.cc,v 1.142 2000/03/06 16:23:33 wessels Exp $
+ * $Id: net_db.cc,v 1.143 2000/05/02 20:41:23 hno Exp $
*
* DEBUG: section 38 Network Measurement Database
* AUTHOR: Duane Wessels
static netdbEntry *netdbLookupHost(const char *key);
static net_db_peer *netdbPeerByName(const netdbEntry * n, const char *);
static net_db_peer *netdbPeerAdd(netdbEntry * n, peer * e);
-static char *netdbPeerName(const char *name);
+static const char *netdbPeerName(const char *name);
static IPH netdbSendPing;
static QS sortPeerByRtt;
static QS sortByRtt;
count, tvSubMsec(start, current_time));
}
-static char *
+static const char *
netdbPeerName(const char *name)
{
- wordlist *w;
+ const wordlist *w;
for (w = peer_names; w; w = w->next) {
if (!strcmp(w->key, name))
return w->key;
}
- w = wordlistAdd(&peer_names, name);
- return w->key;
+ return wordlistAdd(&peer_names, name);
}
static void
/*
- * $Id: protos.h,v 1.361 2000/05/02 20:31:45 hno Exp $
+ * $Id: protos.h,v 1.362 2000/05/02 20:41:23 hno Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
extern int parseConfigFile(const char *file_name);
extern void intlistDestroy(intlist **);
extern int intlistFind(intlist * list, int i);
-extern wordlist *wordlistAdd(wordlist **, const char *);
+extern const char *wordlistAdd(wordlist **, const char *);
+extern void wordlistAddWl(wordlist **, wordlist *);
+extern void wordlistJoin(wordlist **, wordlist **);
extern wordlist *wordlistDup(const wordlist *);
extern void wordlistDestroy(wordlist **);
extern void configFreeMemory(void);