/*
- * $Id: ftp.cc,v 1.434 2007/08/13 02:39:06 hno Exp $
+ * $Id: ftp.cc,v 1.435 2007/08/13 10:00:38 serassio Exp $
*
* DEBUG: section 9 File Transfer Protocol (FTP)
* AUTHOR: Harvest Derived
virtual void haveParsedReplyHeaders();
virtual bool doneWithServer() const;
+ virtual bool haveControlChannel(const char *caller_name);
private:
// BodyConsumer for HTTP: consume request body.
ftpSendUser(FtpStateData * ftpState)
{
/* check the server control channel is still available */
- if(!haveControlChannel("ftpSendUser"))
+ if(!ftpState->haveControlChannel("ftpSendUser"))
return;
if (ftpState->proxy_host != NULL)
ftpSendPass(FtpStateData * ftpState)
{
/* check the server control channel is still available */
- if(!haveControlChannel("ftpSendPass"))
+ if(!ftpState->haveControlChannel("ftpSendPass"))
return;
snprintf(cbuf, 1024, "PASS %s\r\n", ftpState->password);
char mode;
/* check the server control channel is still available */
- if(!haveControlChannel("ftpSendType"))
+ if(!ftpState->haveControlChannel("ftpSendType"))
return;
/*
char *path = ftpState->filepath;
/* check the server control channel is still available */
- if(!haveControlChannel("ftpSendCwd"))
+ if(!ftpState->haveControlChannel("ftpSendCwd"))
return;
debugs(9, 3, "ftpSendCwd");
char *path = ftpState->filepath;
/* check the server control channel is still available */
- if(!haveControlChannel("ftpSendMkdir"))
+ if(!ftpState->haveControlChannel("ftpSendMkdir"))
return;
debugs(9, 3, "ftpSendMkdir: with path=" << path);
ftpSendMdtm(FtpStateData * ftpState)
{
/* check the server control channel is still available */
- if(!haveControlChannel("ftpSendMdtm"))
+ if(!ftpState->haveControlChannel("ftpSendMdtm"))
return;
assert(*ftpState->filepath != '\0');
ftpSendSize(FtpStateData * ftpState)
{
/* check the server control channel is still available */
- if(!haveControlChannel("ftpSendPasv"))
+ if(!ftpState->haveControlChannel("ftpSendPasv"))
return;
/* Only send SIZE for binary transfers. The returned size
socklen_t addr_len;
/* check the server control channel is still available */
- if(!haveControlChannel("ftpSendPasv"))
+ if(!ftpState->haveControlChannel("ftpSendPasv"))
return;
debugs(9, 3, HERE << "ftpSendPasv started");
unsigned char *portptr;
/* check the server control channel is still available */
- if(!haveControlChannel("ftpSendPort"))
+ if(!ftpState->haveControlChannel("ftpSendPort"))
return;
debugs(9, 3, "This is ftpSendPort");
ftpSendStor(FtpStateData * ftpState)
{
/* check the server control channel is still available */
- if(!haveControlChannel("ftpSendStor"))
+ if(!ftpState->haveControlChannel("ftpSendStor"))
return;
if (ftpState->filepath != NULL) {
ftpSendRest(FtpStateData * ftpState)
{
/* check the server control channel is still available */
- if(!haveControlChannel("ftpSendRest"))
+ if(!ftpState->haveControlChannel("ftpSendRest"))
return;
snprintf(cbuf, 1024, "REST %d\r\n", ftpState->restart_offset);
ftpSendList(FtpStateData * ftpState)
{
/* check the server control channel is still available */
- if(!haveControlChannel("ftpSendList"))
+ if(!ftpState->haveControlChannel("ftpSendList"))
return;
if (ftpState->filepath) {
ftpSendNlst(FtpStateData * ftpState)
{
/* check the server control channel is still available */
- if(!haveControlChannel("ftpSendNlst"))
+ if(!ftpState->haveControlChannel("ftpSendNlst"))
return;
ftpState->flags.tried_nlst = 1;
ftpSendRetr(FtpStateData * ftpState)
{
/* check the server control channel is still available */
- if(!haveControlChannel("ftpSendRetr"))
+ if(!ftpState->haveControlChannel("ftpSendRetr"))
return;
assert(ftpState->filepath != NULL);
ftpSendQuit(FtpStateData * ftpState)
{
/* check the server control channel is still available */
- if(!haveControlChannel("ftpSendQuit"))
+ if(!ftpState->haveControlChannel("ftpSendQuit"))
return;
snprintf(cbuf, 1024, "QUIT\r\n");
}
bool
-haveControlChannel(const char *caller_name)
+FtpStateData::haveControlChannel(const char *caller_name)
{
if(!doneWithServer())
return true;