FTP client functionality shared among FTP Gateway and Relay clients. More...

#include <FtpClient.h>

Inheritance diagram for Ftp::Client:
Collaboration diagram for Ftp::Client:

Public Types

enum  {
  BEGIN,
  SENT_USER,
  SENT_PASS,
  SENT_TYPE,
  SENT_MDTM,
  SENT_SIZE,
  SENT_EPRT,
  SENT_PORT,
  SENT_EPSV_ALL,
  SENT_EPSV_1,
  SENT_EPSV_2,
  SENT_PASV,
  SENT_CWD,
  SENT_LIST,
  SENT_NLST,
  SENT_REST,
  SENT_RETR,
  SENT_STOR,
  SENT_QUIT,
  READING_DATA,
  WRITING_DATA,
  SENT_MKDIR,
  SENT_FEAT,
  SENT_PWD,
  SENT_CDUP,
  SENT_DATA_REQUEST,
  SENT_COMMAND,
  END
}
 
typedef CbcPointer< AsyncJobPointer
 
typedef CbcPointer< BodyProducerPointer
 
typedef CbcPointer< BodyConsumerPointer
 

Public Member Functions

 Client (FwdState *fwdState)
 
virtual ~Client ()
 
virtual void failed (err_type error=ERR_NONE, int xerrno=0, ErrorState *ftperr=nullptr)
 handle a fatal transaction error, closing the control connection More...
 
virtual void timeout (const CommTimeoutCbParams &io)
 read timeout handler More...
 
virtual void maybeReadVirginBody ()
 read response data from the network More...
 
void writeCommand (const char *buf)
 
bool handlePasvReply (Ip::Address &remoteAddr)
 
bool handleEpsvReply (Ip::Address &remoteAddr)
 
bool sendEprt ()
 
bool sendPort ()
 
bool sendPassive ()
 
void connectDataChannel ()
 
bool openListenSocket ()
 
void switchTimeoutToDataChannel ()
 
virtual void noteMoreBodyDataAvailable (BodyPipe::Pointer)
 
virtual void noteBodyProductionEnded (BodyPipe::Pointer)
 
virtual void noteBodyProducerAborted (BodyPipe::Pointer)
 
virtual bool abortOnData (const char *reason)
 
virtual HttpRequestPointer originalRequest ()
 a hack to reach HttpStateData::orignal_request More...
 
virtual void noteAdaptationAnswer (const Adaptation::Answer &answer)
 
virtual void noteAdaptationAclCheckDone (Adaptation::ServiceGroupPointer group)
 
virtual void noteMoreBodySpaceAvailable (BodyPipe::Pointer)
 
virtual void noteBodyConsumerAborted (BodyPipe::Pointer)
 
virtual bool getMoreRequestBody (MemBuf &buf)
 either fill buf with available [encoded] request body bytes or return false More...
 
virtual void processReplyBody ()=0
 
virtual void swanSong ()
 
virtual bool doneAll () const
 whether positive goal has been reached More...
 
void serverComplete ()
 
bool canBeCalled (AsyncCall &call) const
 whether we can be called More...
 
void callStart (AsyncCall &call)
 
virtual void callEnd ()
 called right after the called job method More...
 
virtual void callException (const std::exception &e)
 called when the job throws during an async call More...
 
virtual void * toCbdata ()=0
 

Static Public Member Functions

static Pointer Start (AsyncJob *job)
 starts a freshly created job (i.e., makes the job asynchronous) More...
 

Public Attributes

CtrlChannel ctrl
 FTP control channel state. More...
 
DataChannel data
 FTP data channel state. More...
 
enum Ftp::Client:: { ... }  ftp_state_t
 
int state
 
char * old_request
 
char * old_reply
 
StoreEntryentry = nullptr
 
FwdState::Pointer fwd
 
HttpRequestPointer request
 

Protected Member Functions

virtual void start ()
 called by AsyncStart; do not call directly More...
 
virtual void closeServer ()
 
virtual bool doneWithServer () const
 
virtual const Comm::ConnectionPointerdataConnection () const
 
virtual void abortAll (const char *reason)
 abnormal transaction termination; reason is for debugging only More...
 
virtual Http::StatusCode failedHttpStatus (err_type &error)
 
void ctrlClosed (const CommCloseCbParams &io)
 handler called by Comm when FTP control channel is closed unexpectedly More...
 
void scheduleReadControlReply (int buffered_ok)
 
void readControlReply (const CommIoCbParams &io)
 
virtual void handleControlReply ()
 
void writeCommandCallback (const CommIoCbParams &io)
 
virtual void dataChannelConnected (const CommConnectCbParams &io)=0
 
void dataRead (const CommIoCbParams &io)
 
void dataComplete ()
 
AsyncCall::Pointer dataCloser ()
 creates a data channel Comm close callback More...
 
virtual void dataClosed (const CommCloseCbParams &io)
 handler called by Comm when FTP data channel is closed unexpectedly More...
 
void initReadBuf ()
 
virtual void sentRequestBody (const CommIoCbParams &io)
 
virtual void doneSendingRequestBody ()
 
virtual void haveParsedReplyHeaders ()
 called when we have final (possibly adapted) reply headers; kids extend More...
 
virtual void completeForwarding ()
 
bool startRequestBodyFlow ()
 
void handleMoreRequestBodyAvailable ()
 
void handleRequestBodyProductionEnded ()
 
virtual void handleRequestBodyProducerAborted ()=0
 
void sendMoreRequestBody ()
 
virtual bool mayReadVirginReplyBody () const =0
 whether we may receive more virgin response body bytes More...
 
bool abortOnBadEntry (const char *abortReason)
 Entry-dependent callbacks use this check to quit if the entry went bad. More...
 
bool blockCaching ()
 whether to prevent caching of an otherwise cachable response More...
 
void startAdaptation (const Adaptation::ServiceGroupPointer &group, HttpRequest *cause)
 Initiate an asynchronous adaptation transaction which will call us back. More...
 
void adaptVirginReplyBody (const char *buf, ssize_t len)
 
void cleanAdaptation ()
 
virtual bool doneWithAdaptation () const
 
void handleMoreAdaptedBodyAvailable ()
 
void handleAdaptedBodyProductionEnded ()
 
void handleAdaptedBodyProducerAborted ()
 
void handleAdaptedHeader (Http::Message *msg)
 
void handleAdaptationCompleted ()
 
void handleAdaptationBlocked (const Adaptation::Answer &answer)
 
void handleAdaptationAborted (bool bypassable=false)
 
bool handledEarlyAdaptationAbort ()
 
void resumeBodyStorage ()
 called by StoreEntry when it has more buffer space available More...
 
void endAdaptedBodyConsumption ()
 called when the entire adapted response body is consumed More...
 
const HttpReplyvirginReply () const
 
HttpReplyvirginReply ()
 
HttpReplysetVirginReply (HttpReply *r)
 
HttpReplyfinalReply ()
 
HttpReplysetFinalReply (HttpReply *r)
 
void adaptOrFinalizeReply ()
 
void addVirginReplyBody (const char *buf, ssize_t len)
 
void storeReplyBody (const char *buf, ssize_t len)
 
size_t replyBodySpace (const MemBuf &readBuf, const size_t minSpace) const
 
size_t calcBufferSpaceToReserve (const size_t space, const size_t wantSpace) const
 determine how much space the buffer needs to reserve More...
 
void adjustBodyBytesRead (const int64_t delta)
 initializes bodyBytesRead stats if needed and applies delta More...
 
CbcPointer< Initiate > initiateAdaptation (Initiate *x)
 < starts freshly created initiate and returns a safe pointer to it More...
 
void clearAdaptation (CbcPointer< Initiate > &x)
 clears the pointer (does not call announceInitiatorAbort) More...
 
void announceInitiatorAbort (CbcPointer< Initiate > &x)
 inform the transaction about abnormal termination and clear the pointer More...
 
bool initiated (const CbcPointer< AsyncJob > &job) const
 Must(initiated(initiate)) instead of Must(initiate.set()), for clarity. More...
 
void deleteThis (const char *aReason)
 
void mustStop (const char *aReason)
 
bool done () const
 the job is destroyed in callEnd() when done() More...
 
virtual const char * status () const
 internal cleanup; do not call directly More...
 
void stopProducingFor (RefCount< BodyPipe > &, bool atEof)
 
void stopConsumingFrom (RefCount< BodyPipe > &)
 

Protected Attributes

int64_t currentOffset = 0
 
MemBufresponseBodyBuffer = nullptr
 
BodyPipe::Pointer requestBodySource
 
AsyncCall::Pointer requestSender
 
BodyPipe::Pointer virginBodyDestination
 
CbcPointer< Adaptation::InitiateadaptedHeadSource
 
BodyPipe::Pointer adaptedBodySource
 
bool adaptationAccessCheckPending = false
 
bool startedAdaptation = false
 
bool receivedWholeRequestBody = false
 handleRequestBodyProductionEnded called More...
 
const char * doneWithFwd = nullptr
 
const char * stopReason
 reason for forcing done() to be true More...
 
const char * typeName
 kid (leaf) class name, for debugging More...
 
AsyncCall::Pointer inCall
 the asynchronous call being handled, if any More...
 
const InstanceId< AsyncJobid
 job identifier More...
 

Private Member Functions

 CBDATA_CLASS (Client)
 
bool parseControlReply (size_t &bytesUsed)
 

Private Attributes

bool shortenReadTimeout
 

Detailed Description

Definition at line 92 of file FtpClient.h.

Member Typedef Documentation

◆ Pointer [1/3]

Definition at line 25 of file BodyPipe.h.

◆ Pointer [2/3]

Definition at line 34 of file AsyncJob.h.

◆ Pointer [3/3]

Definition at line 45 of file BodyPipe.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
BEGIN 
SENT_USER 
SENT_PASS 
SENT_TYPE 
SENT_MDTM 
SENT_SIZE 
SENT_EPRT 
SENT_PORT 
SENT_EPSV_ALL 
SENT_EPSV_1 
SENT_EPSV_2 
SENT_PASV 
SENT_CWD 
SENT_LIST 
SENT_NLST 
SENT_REST 
SENT_RETR 
SENT_STOR 
SENT_QUIT 
READING_DATA 
WRITING_DATA 
SENT_MKDIR 
SENT_FEAT 
SENT_PWD 
SENT_CDUP 
SENT_DATA_REQUEST 
SENT_COMMAND 
END 

Definition at line 127 of file FtpClient.h.

Constructor & Destructor Documentation

◆ Client()

◆ ~Client()

Client::~Client ( )
virtual

Member Function Documentation

◆ abortAll()

void Ftp::Client::abortAll ( const char *  reason)
protectedvirtual

◆ abortOnBadEntry()

◆ abortOnData()

bool Client::abortOnData ( const char *  reason)
virtualinherited

abnormal data transfer termination

Return values
truethe transaction will be terminated (abortAll called)
falsethe transaction will survive

Reimplemented in Ftp::Relay.

Definition at line 287 of file Client.cc.

References Client::abortAll().

Referenced by Client::abortOnBadEntry(), dataRead(), Client::handleAdaptationBlocked(), readControlReply(), Client::sendBodyIsTooLargeError(), and Client::sentRequestBody().

◆ adaptOrFinalizeReply()

◆ adaptVirginReplyBody()

void Client::adaptVirginReplyBody ( const char *  buf,
ssize_t  len 
)
protectedinherited

◆ addVirginReplyBody()

◆ adjustBodyBytesRead()

void Client::adjustBodyBytesRead ( const int64_t  delta)
protectedinherited

◆ announceInitiatorAbort()

◆ blockCaching()

◆ calcBufferSpaceToReserve()

size_t Client::calcBufferSpaceToReserve ( const size_t  space,
const size_t  wantSpace 
) const
protectedinherited

◆ callEnd()

void AsyncJob::callEnd ( )
virtualinherited

◆ callException()

◆ callStart()

void AsyncJob::callStart ( AsyncCall call)
inherited

◆ canBeCalled()

bool AsyncJob::canBeCalled ( AsyncCall call) const
inherited

Definition at line 101 of file AsyncJob.cc.

References AsyncCall::cancel(), debugs, HERE(), AsyncJob::inCall, and NULL.

Referenced by AsyncJob::swanSong().

◆ CBDATA_CLASS()

Ftp::Client::CBDATA_CLASS ( Client  )
private

◆ cleanAdaptation()

◆ clearAdaptation()

◆ closeServer()

void Ftp::Client::closeServer ( )
protectedvirtual

◆ completeForwarding()

void Client::completeForwarding ( )
protectedvirtualinherited

◆ connectDataChannel()

◆ ctrlClosed()

void Ftp::Client::ctrlClosed ( const CommCloseCbParams io)
protected

Definition at line 862 of file FtpClient.cc.

References Ftp::Channel::clear(), ctrl, debugs, Client::doneWithFwd, AsyncJob::mustStop(), and AsyncJob::status().

Referenced by Client().

◆ dataChannelConnected()

virtual void Ftp::Client::dataChannelConnected ( const CommConnectCbParams io)
protectedpure virtual

Implemented in Ftp::Gateway, and Ftp::Relay.

Referenced by connectDataChannel().

◆ dataClosed()

void Ftp::Client::dataClosed ( const CommCloseCbParams io)
protectedvirtual

◆ dataCloser()

◆ dataComplete()

void Client::dataComplete ( )
protected

Close data channel, if any, to conserve resources while we wait.

Definition at line 991 of file FtpClient.cc.

References Ftp::Channel::close(), data, debugs, scheduleReadControlReply(), and AsyncJob::status().

Referenced by Ftp::Relay::abort(), Ftp::Relay::abortOnData(), dataRead(), doneSendingRequestBody(), and Ftp::Gateway::readStor().

◆ dataConnection()

const Comm::ConnectionPointer & Client::dataConnection ( ) const
protectedvirtual
Returns
primary or "request data connection"

Implements Client.

Definition at line 883 of file FtpClient.cc.

References Ftp::Channel::conn, and data.

◆ dataRead()

◆ deleteThis()

void AsyncJob::deleteThis ( const char *  aReason)
protectedinherited

◆ done()

◆ doneAll()

bool Client::doneAll ( ) const
virtualinherited

Reimplemented from AsyncJob.

Definition at line 193 of file Client.cc.

References AsyncJob::doneAll(), Client::doneWithAdaptation(), and Client::doneWithServer().

◆ doneSendingRequestBody()

void Ftp::Client::doneSendingRequestBody ( )
protectedvirtual

called after we wrote the last byte of the request body

Implements Client.

Definition at line 1054 of file FtpClient.cc.

References dataComplete(), debugs, Client::doneSendingRequestBody(), and AsyncJob::status().

◆ doneWithAdaptation()

bool Client::doneWithAdaptation ( ) const
protectedvirtualinherited

◆ doneWithServer()

bool Ftp::Client::doneWithServer ( ) const
protectedvirtual

Did we close all FTP server connection(s)?

Return values
trueBoth server control and data channels are closed. And not waiting for a new data connection to open.
falseEither control channel or data is still active.

Implements Client.

Definition at line 240 of file FtpClient.cc.

References Ftp::Channel::conn, ctrl, data, and Comm::IsConnOpen().

Referenced by Ftp::Relay::failed(), Ftp::Gateway::haveControlChannel(), and Ftp::Gateway::mayReadVirginReplyBody().

◆ endAdaptedBodyConsumption()

void Client::endAdaptedBodyConsumption ( )
protectedinherited

◆ failed()

◆ failedHttpStatus()

Http::StatusCode Client::failedHttpStatus ( err_type error)
protectedvirtual

◆ finalReply()

HttpReply * Client::finalReply ( )
protectedinherited

Definition at line 128 of file Client.cc.

References assert, and Client::theFinalReply.

Referenced by HttpStateData::haveParsedReplyHeaders(), and HttpStateData::reusableReply().

◆ getMoreRequestBody()

bool Client::getMoreRequestBody ( MemBuf buf)
virtualinherited

◆ handleAdaptationAborted()

void Client::handleAdaptationAborted ( bool  bypassable = false)
protectedinherited

◆ handleAdaptationBlocked()

◆ handleAdaptationCompleted()

◆ handleAdaptedBodyProducerAborted()

◆ handleAdaptedBodyProductionEnded()

void Client::handleAdaptedBodyProductionEnded ( )
protectedinherited

◆ handleAdaptedHeader()

◆ handleControlReply()

◆ handledEarlyAdaptationAbort()

bool Client::handledEarlyAdaptationAbort ( )
protectedinherited

◆ handleEpsvReply()

◆ handleMoreAdaptedBodyAvailable()

◆ handleMoreRequestBodyAvailable()

void Client::handleMoreRequestBodyAvailable ( )
protectedinherited

◆ handlePasvReply()

bool Client::handlePasvReply ( Ip::Address remoteAddr)

◆ handleRequestBodyProducerAborted()

◆ handleRequestBodyProductionEnded()

void Client::handleRequestBodyProductionEnded ( )
protectedinherited

◆ haveParsedReplyHeaders()

void Client::haveParsedReplyHeaders ( )
protectedvirtualinherited

◆ initiateAdaptation()

◆ initiated()

◆ initReadBuf()

void Client::initReadBuf ( )
protected

Definition at line 205 of file FtpClient.cc.

References data, MemBuf::init(), NULL, and Ftp::DataChannel::readBuf.

Referenced by Ftp::Gateway::Gateway(), and maybeReadVirginBody().

◆ maybeReadVirginBody()

◆ mayReadVirginReplyBody()

virtual bool Client::mayReadVirginReplyBody ( ) const
protectedpure virtualinherited

◆ mustStop()

void AsyncJob::mustStop ( const char *  aReason)
protectedinherited

Definition at line 69 of file AsyncJob.cc.

References debugs, AsyncJob::inCall, Must, NULL, AsyncJob::stopReason, and AsyncJob::typeName.

Referenced by HttpStateData::abortAll(), abortAll(), Comm::TcpAcceptor::acceptOne(), Adaptation::Ecap::XactionRep::adaptationAborted(), Adaptation::AccessCheck::callBack(), AsyncJob::callException(), Security::PeerConnector::connectionClosed(), HttpStateData::continueAfterParsingHeader(), ctrlClosed(), Adaptation::Iterator::handleAdaptationBlock(), Adaptation::Iterator::handleAdaptationError(), Log::TcpLogger::handleClosure(), Adaptation::Icap::Xaction::handleCommClosed(), Http::Tunneler::handleConnectionClosure(), Mgr::Forwarder::handleError(), Ipc::Forwarder::handleError(), Ipc::Forwarder::handleException(), Ipc::Inquirer::handleException(), HttpStateData::handleMoreRequestBodyAvailable(), Ipc::Inquirer::handleRemoteAck(), Ipc::Forwarder::handleTimeout(), HttpStateData::httpStateConnClosed(), HttpStateData::httpTimeout(), Comm::ConnOpener::noteAbort(), Adaptation::Icap::ModXact::noteBodyConsumerAborted(), Snmp::Forwarder::noteCommClosed(), Snmp::Inquirer::noteCommClosed(), Mgr::Inquirer::noteCommClosed(), Mgr::Forwarder::noteCommClosed(), Mgr::StoreToCommWriter::noteCommClosed(), Adaptation::Icap::Xaction::noteCommRead(), Rock::HeaderUpdater::noteDoneReading(), Adaptation::Iterator::noteInitiatorAborted(), Adaptation::Icap::Xaction::noteInitiatorAborted(), Adaptation::Ecap::XactionRep::noteInitiatorAborted(), HttpStateData::readReply(), Comm::ConnOpener::sendAnswer(), Rock::Rebuild::start(), Security::PeerConnector::start(), HttpStateData::start(), Ipc::UdsSender::timedout(), and HttpStateData::wroteLast().

◆ noteAdaptationAclCheckDone()

void Client::noteAdaptationAclCheckDone ( Adaptation::ServiceGroupPointer  group)
virtualinherited

AccessCheck calls this back with a possibly nil service group to signal whether adaptation is needed and where it should start.

Reimplemented from Adaptation::Initiator.

Definition at line 905 of file Client.cc.

References Client::abortOnBadEntry(), Client::adaptationAccessCheckPending, debugs, HERE(), Client::originalRequest(), Client::processReplyBody(), Client::request, Client::sendBodyIsTooLargeError(), Client::setFinalReply(), Client::startAdaptation(), and Client::virginReply().

◆ noteAdaptationAnswer()

void Client::noteAdaptationAnswer ( const Adaptation::Answer answer)
virtualinherited

◆ noteBodyConsumerAborted()

void Client::noteBodyConsumerAborted ( BodyPipe::Pointer  )
virtualinherited

◆ noteBodyProducerAborted()

void Client::noteBodyProducerAborted ( BodyPipe::Pointer  bp)
virtualinherited

◆ noteBodyProductionEnded()

void Client::noteBodyProductionEnded ( BodyPipe::Pointer  bp)
virtualinherited

◆ noteMoreBodyDataAvailable()

void Client::noteMoreBodyDataAvailable ( BodyPipe::Pointer  bp)
virtualinherited

◆ noteMoreBodySpaceAvailable()

void Client::noteMoreBodySpaceAvailable ( BodyPipe::Pointer  )
virtualinherited

◆ openListenSocket()

bool Client::openListenSocket ( )

Definition at line 779 of file FtpClient.cc.

Referenced by sendEprt().

◆ originalRequest()

◆ parseControlReply()

bool Ftp::Client::parseControlReply ( size_t bytesUsed)
private

Parses FTP server control response into ctrl structure fields, setting bytesUsed and returning true on success.

Definition at line 1068 of file FtpClient.cc.

References assert, Ftp::CtrlChannel::buf, ctrl, debugs, head, wordlist::key, Ftp::CtrlChannel::last_reply, len, Ftp::CtrlChannel::message, wordlist::next, NULL, Ftp::CtrlChannel::offset, Ftp::CtrlChannel::replycode, safe_free, AsyncJob::status(), wordlistDestroy(), xmalloc, xstrdup, and xstrncpy().

Referenced by handleControlReply().

◆ processReplyBody()

virtual void Client::processReplyBody ( )
pure virtualinherited

◆ readControlReply()

◆ replyBodySpace()

size_t Client::replyBodySpace ( const MemBuf readBuf,
const size_t  minSpace 
) const
protectedinherited

◆ resumeBodyStorage()

◆ scheduleReadControlReply()

void Ftp::Client::scheduleReadControlReply ( int  buffered_ok)
protected

◆ sendEprt()

◆ sendMoreRequestBody()

◆ sendPassive()

bool Client::sendPassive ( )
Checks for EPSV ALL special conditions: If enabled to be sent, squid MUST NOT request any other connect methods. If 'ALL' is sent and fails the entire FTP Session fails. NP: By my reading exact EPSV protocols maybe attempted, but only EPSV method.

Closes any old FTP-Data connection which may exist. */

Checks for previous EPSV/PASV failures on this server/session. Diverts to EPRT immediately if they are not working.
Send EPSV (ALL,2,1) or PASV on the control channel.
  • EPSV ALL is used if enabled.
  • EPSV 2 is used if ALL is disabled and IPv6 is available and ctrl channel is IPv6.
  • EPSV 1 is used if EPSV 2 (IPv6) fails or is not available or ctrl channel is IPv4.
  • PASV is used if EPSV 1 fails.

Definition at line 637 of file FtpClient.cc.

References SquidConfig::accessList, allow_t::allowed(), Packable::appendf(), Ftp::Channel::close(), Config, Ftp::Channel::conn, MemBuf::content(), Ftp::crlf, ctrl, data, DBG_IMPORTANT, debugs, SquidConfig::epsv_all, ERR_FTP_FAILURE, failed(), ACLChecklist::fastCheck(), SquidConfig::Ftp, SquidConfig::ftp_epsv, Client::fwd, Ip::Address::isIPv4(), Ip::Address::isIPv6(), Comm::Connection::local, Ftp::CtrlChannel::message, NULL, Ftp::CtrlChannel::offset, SquidConfig::passive, Comm::Connection::remote, FwdState::request, MemBuf::reset(), sendEprt(), SENT_EPSV_1, SENT_EPSV_2, SENT_EPSV_ALL, SENT_PASV, shortenReadTimeout, state, AsyncJob::status(), wordlistDestroy(), and writeCommand().

Referenced by ftpSendPassive(), handleEpsvReply(), and Ftp::Relay::sendCommand().

◆ sendPort()

bool Client::sendPort ( )

Definition at line 630 of file FtpClient.cc.

References ERR_FTP_FAILURE, and failed().

Referenced by sendEprt().

◆ sentRequestBody()

void Client::sentRequestBody ( const CommIoCbParams io)
protectedvirtual

◆ serverComplete()

◆ setFinalReply()

◆ setVirginReply()

◆ Start()

◆ start()

void Client::start ( )
protectedvirtual

Reimplemented from AsyncJob.

Reimplemented in Ftp::Gateway, and Ftp::Relay.

Definition at line 199 of file FtpClient.cc.

References scheduleReadControlReply().

Referenced by Ftp::Relay::start(), and Ftp::Gateway::start().

◆ startAdaptation()

◆ startRequestBodyFlow()

◆ status()

◆ stopConsumingFrom()

◆ stopProducingFor()

◆ storeReplyBody()

void Client::storeReplyBody ( const char *  buf,
ssize_t  len 
)
protectedinherited

Definition at line 993 of file Client.cc.

References Client::currentOffset, Client::entry, len, and StoreEntry::write().

Referenced by Client::addVirginReplyBody().

◆ swanSong()

◆ switchTimeoutToDataChannel()

void Ftp::Client::switchTimeoutToDataChannel ( )

Cancel the timeout on the Control socket and establish one on the data socket

Definition at line 1032 of file FtpClient.cc.

References commSetConnTimeout(), commUnsetConnTimeout(), Config, Ftp::Channel::conn, ctrl, data, JobCallback, SquidConfig::read, timeout(), and SquidConfig::Timeout.

Referenced by ftpReadList(), ftpReadRetr(), Ftp::Gateway::listenForDataChannel(), and Ftp::Gateway::readStor().

◆ timeout()

◆ toCbdata()

virtual void* CbdataParent::toCbdata ( )
pure virtualinherited

◆ virginReply() [1/2]

◆ virginReply() [2/2]

HttpReply * Client::virginReply ( )
protectedinherited

Definition at line 103 of file Client.cc.

References assert, and Client::theVirginReply.

◆ writeCommand()

◆ writeCommandCallback()

Member Data Documentation

◆ adaptationAccessCheckPending

◆ adaptedBodySource

◆ adaptedHeadSource

CbcPointer<Adaptation::Initiate> Client::adaptedHeadSource
protectedinherited

to get adapted response headers

Definition at line 174 of file Client.h.

Referenced by Client::cleanAdaptation(), Client::doneWithAdaptation(), Client::noteAdaptationAnswer(), and Client::startAdaptation().

◆ ctrl

CtrlChannel Ftp::Client::ctrl

Definition at line 124 of file FtpClient.h.

Referenced by abortAll(), Ftp::Relay::abortOnData(), Client(), closeServer(), Ftp::Gateway::completedListing(), Ftp::Gateway::completeForwarding(), connectDataChannel(), Ftp::Relay::createHttpReply(), ctrlClosed(), doneWithServer(), failed(), Ftp::Gateway::failedHttpStatus(), Ftp::Gateway::ftpAcceptDataConnection(), ftpFail(), ftpOpenListenSocket(), ftpReadCwd(), ftpReadEPRT(), ftpReadEPSV(), ftpReadList(), ftpReadMdtm(), ftpReadMkdir(), ftpReadPass(), ftpReadPORT(), ftpReadRest(), ftpReadRetr(), ftpReadSize(), ftpReadTransferDone(), ftpReadType(), ftpReadUser(), ftpReadWelcome(), ftpSendReply(), ftpWriteTransferDone(), Ftp::Gateway::hackShortcut(), Ftp::Relay::handleControlReply(), Ftp::Gateway::handleControlReply(), handleControlReply(), handleEpsvReply(), handlePasvReply(), Ftp::Gateway::haveControlChannel(), Ftp::Gateway::listenForDataChannel(), Ftp::Gateway::loginFailed(), parseControlReply(), readControlReply(), Ftp::Relay::readCwdOrCdupReply(), Ftp::Relay::readDataReply(), Ftp::Relay::readEpsvReply(), Ftp::Relay::readFeatReply(), Ftp::Relay::readGreeting(), Ftp::Relay::readPasvReply(), Ftp::Relay::readReply(), Ftp::Gateway::readStor(), Ftp::Relay::readTransferDoneReply(), Ftp::Relay::readUserOrPassReply(), scheduleReadControlReply(), sendPassive(), Ftp::Relay::serverComplete(), Ftp::Gateway::start(), Ftp::Relay::startDirTracking(), Ftp::Relay::stopDirTracking(), switchTimeoutToDataChannel(), writeCommand(), and Ftp::Gateway::~Gateway().

◆ currentOffset

int64_t Client::currentOffset = 0
protectedinherited

Our current offset in the StoreEntry

Definition at line 160 of file Client.h.

Referenced by Client::handleMoreAdaptedBodyAvailable(), Client::haveParsedReplyHeaders(), and Client::storeReplyBody().

◆ data

◆ doneWithFwd

const char* Client::doneWithFwd = nullptr
protectedinherited

whether we should not be talking to FwdState; XXX: clear fwd instead points to a string literal which is used only for debugging

Definition at line 184 of file Client.h.

Referenced by Client::completeForwarding(), ctrlClosed(), HttpStateData::httpStateConnClosed(), and Client::swanSong().

◆ entry

StoreEntry* Client::entry = nullptr
inherited

Definition at line 164 of file Client.h.

Referenced by Client::abortOnBadEntry(), Ftp::Gateway::appendSuccessHeader(), Client::blockCaching(), HttpStateData::buildRequestPrefix(), Client::Client(), Ftp::Gateway::completedListing(), HttpStateData::continueAfterParsingHeader(), dataRead(), Ftp::Relay::failed(), failed(), Ftp::Relay::failedErrorMessage(), Ftp::Relay::forwardReply(), Ftp::Gateway::ftpAcceptDataConnection(), ftpFail(), ftpSendReply(), ftpWriteTransferDone(), Ftp::Gateway::Gateway(), Client::handleAdaptationAborted(), Client::handleAdaptationBlocked(), Client::handleAdaptedBodyProducerAborted(), Client::handledEarlyAdaptationAbort(), Client::handleMoreAdaptedBodyAvailable(), HttpStateData::handleMoreRequestBodyAvailable(), HttpStateData::handleRequestBodyProducerAborted(), HttpStateData::haveParsedReplyHeaders(), Ftp::Gateway::haveParsedReplyHeaders(), HttpStateData::HttpStateData(), HttpStateData::httpTimeout(), HttpStateData::keepaliveAccounting(), Ftp::Gateway::listenForDataChannel(), Ftp::Gateway::loginFailed(), maybeReadVirginBody(), Ftp::Gateway::parseListing(), HttpStateData::peerSupportsConnectionPinning(), Ftp::Gateway::processHeadResponse(), Ftp::Relay::processReplyBody(), HttpStateData::processReplyBody(), Ftp::Gateway::processReplyBody(), HttpStateData::processReplyHeader(), HttpStateData::processSurrogateControl(), readControlReply(), HttpStateData::readReply(), Ftp::Relay::Relay(), HttpStateData::reusableReply(), Client::sentRequestBody(), Client::setFinalReply(), Ftp::Gateway::start(), HttpStateData::statusIfComplete(), Client::storeReplyBody(), timeout(), HttpStateData::wroteLast(), Client::~Client(), and Ftp::Gateway::~Gateway().

◆ ftp_state_t

enum { ... } Ftp::Client::ftp_state_t

◆ fwd

◆ id

const InstanceId<AsyncJob> AsyncJob::id
protectedinherited

Definition at line 72 of file AsyncJob.h.

◆ inCall

◆ old_reply

char* Ftp::Client::old_reply

◆ old_request

char* Ftp::Client::old_request

◆ receivedWholeRequestBody

bool Client::receivedWholeRequestBody = false
protectedinherited

◆ request

HttpRequestPointer Client::request
inherited

◆ requestBodySource

◆ requestSender

◆ responseBodyBuffer

MemBuf* Client::responseBodyBuffer = nullptr
protectedinherited

◆ shortenReadTimeout

bool Ftp::Client::shortenReadTimeout
private

XXX: An old hack for FTP servers like ftp.netscape.com that may not respond to PASV. Use faster connect timeout instead of read timeout.

Definition at line 194 of file FtpClient.h.

Referenced by scheduleReadControlReply(), and sendPassive().

◆ startedAdaptation

bool Client::startedAdaptation = false
protectedinherited

◆ state

◆ stopReason

const char* AsyncJob::stopReason
protectedinherited

◆ typeName

◆ virginBodyDestination


The documentation for this class was generated from the following files:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors