--------------------- PatchSet 5286 Date: 2007/08/13 10:05:17 Author: amosjeffries Branch: squid3-ipv6 Tag: (none) Log: Bah. I left a compile error in HEAD from FTP fix. Members: src/ftp.cc:1.26.2.35->1.26.2.36 Index: squid3/src/ftp.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ftp.cc,v retrieving revision 1.26.2.35 retrieving revision 1.26.2.36 diff -u -r1.26.2.35 -r1.26.2.36 --- squid3/src/ftp.cc 13 Aug 2007 09:27:39 -0000 1.26.2.35 +++ squid3/src/ftp.cc 13 Aug 2007 10:05:17 -0000 1.26.2.36 @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.26.2.35 2007/08/13 09:27:39 amosjeffries Exp $ + * $Id: ftp.cc,v 1.26.2.36 2007/08/13 10:05:17 amosjeffries Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -222,6 +222,7 @@ virtual void haveParsedReplyHeaders(); virtual bool doneWithServer() const; + bool haveControlChannel(const char *) const; private: // BodyConsumer for HTTP: consume request body. @@ -1864,7 +1865,7 @@ ftpSendUser(FtpStateData * ftpState) { /* check the server control channel is still available */ - if(!haveControlChannel("ftpSendUser")) + if(!ftpState || !ftpState->haveControlChannel("ftpSendUser")) return; if (ftpState->proxy_host != NULL) @@ -1898,7 +1899,7 @@ ftpSendPass(FtpStateData * ftpState) { /* check the server control channel is still available */ - if(!haveControlChannel("ftpSendPass")) + if(!ftpState || !ftpState->haveControlChannel("ftpSendPass")) return; snprintf(cbuf, 1024, "PASS %s\r\n", ftpState->password); @@ -1927,7 +1928,7 @@ char mode; /* check the server control channel is still available */ - if(!haveControlChannel("ftpSendType")) + if(!ftpState || !ftpState->haveControlChannel("ftpSendType")) return; /* @@ -2052,7 +2053,7 @@ char *path = ftpState->filepath; /* check the server control channel is still available */ - if(!haveControlChannel("ftpSendCwd")) + if(!ftpState || !ftpState->haveControlChannel("ftpSendCwd")) return; debugs(9, 3, "ftpSendCwd"); @@ -2106,7 +2107,7 @@ char *path = ftpState->filepath; /* check the server control channel is still available */ - if(!haveControlChannel("ftpSendMkdir")) + if(!ftpState || !ftpState->haveControlChannel("ftpSendMkdir")) return; debugs(9, 3, "ftpSendMkdir: with path=" << path); @@ -2160,7 +2161,7 @@ ftpSendMdtm(FtpStateData * ftpState) { /* check the server control channel is still available */ - if(!haveControlChannel("ftpSendMdtm")) + if(!ftpState || !ftpState->haveControlChannel("ftpSendMdtm")) return; assert(*ftpState->filepath != '\0'); @@ -2190,7 +2191,7 @@ ftpSendSize(FtpStateData * ftpState) { /* check the server control channel is still available */ - if(!haveControlChannel("ftpSendPasv")) + if(!ftpState || !ftpState->haveControlChannel("ftpSendPasv")) return; /* Only send SIZE for binary transfers. The returned size @@ -2258,7 +2259,7 @@ struct addrinfo *AI = NULL; /* check the server control channel is still available */ - if(!haveControlChannel("ftpSendPasv")) + if(!ftpState || !ftpState->haveControlChannel("ftpSendPasv")) return; debugs(9, 3, HERE << "ftpSendPasv started"); @@ -2546,7 +2547,7 @@ unsigned char *portptr; /* check the server control channel is still available */ - if(!haveControlChannel("ftpSendPort")) + if(!ftpState || !ftpState->haveControlChannel("ftpSendPort")) return; debugs(9, 3, "This is ftpSendPort"); @@ -2742,7 +2743,7 @@ ftpSendStor(FtpStateData * ftpState) { /* check the server control channel is still available */ - if(!haveControlChannel("ftpSendStor")) + if(!ftpState || !ftpState->haveControlChannel("ftpSendStor")) return; if (ftpState->filepath != NULL) { @@ -2807,7 +2808,7 @@ ftpSendRest(FtpStateData * ftpState) { /* check the server control channel is still available */ - if(!haveControlChannel("ftpSendRest")) + if(!ftpState || !ftpState->haveControlChannel("ftpSendRest")) return; snprintf(cbuf, 1024, "REST %d\r\n", ftpState->restart_offset); @@ -2865,7 +2866,7 @@ ftpSendList(FtpStateData * ftpState) { /* check the server control channel is still available */ - if(!haveControlChannel("ftpSendList")) + if(!ftpState || !ftpState->haveControlChannel("ftpSendList")) return; if (ftpState->filepath) { @@ -2882,7 +2883,7 @@ ftpSendNlst(FtpStateData * ftpState) { /* check the server control channel is still available */ - if(!haveControlChannel("ftpSendNlst")) + if(!ftpState || !ftpState->haveControlChannel("ftpSendNlst")) return; ftpState->flags.tried_nlst = 1; @@ -2936,7 +2937,7 @@ ftpSendRetr(FtpStateData * ftpState) { /* check the server control channel is still available */ - if(!haveControlChannel("ftpSendRetr")) + if(!ftpState || !ftpState->haveControlChannel("ftpSendRetr")) return; assert(ftpState->filepath != NULL); @@ -3043,7 +3044,7 @@ ftpSendQuit(FtpStateData * ftpState) { /* check the server control channel is still available */ - if(!haveControlChannel("ftpSendQuit")) + if(!ftpState || !ftpState->haveControlChannel("ftpSendQuit")) return; snprintf(cbuf, 1024, "QUIT\r\n"); @@ -3498,7 +3499,7 @@ } bool -haveControlChannel(const char *caller_name) +FtpStateData::haveControlChannel(const char *caller_name) const { if(!doneWithServer()) return true;