FTP client functionality shared among FTP Gateway and Relay clients. More...
#include <FtpClient.h>
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< AsyncJob > | Pointer |
typedef CbcPointer< BodyProducer > | Pointer |
typedef CbcPointer< BodyConsumer > | Pointer |
Public Member Functions | |
Client (FwdState *fwdState) | |
~Client () override | |
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... | |
void | maybeReadVirginBody () override |
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 () |
void | noteMoreBodyDataAvailable (BodyPipe::Pointer) override |
void | noteBodyProductionEnded (BodyPipe::Pointer) override |
void | noteBodyProducerAborted (BodyPipe::Pointer) override |
virtual bool | abortOnData (const char *reason) |
virtual HttpRequestPointer | originalRequest () |
a hack to reach HttpStateData::orignal_request More... | |
void | noteAdaptationAnswer (const Adaptation::Answer &answer) override |
void | noteAdaptationAclCheckDone (Adaptation::ServiceGroupPointer group) override |
void | noteMoreBodySpaceAvailable (BodyPipe::Pointer) override |
void | noteBodyConsumerAborted (BodyPipe::Pointer) override |
virtual bool | getMoreRequestBody (MemBuf &buf) |
either fill buf with available [encoded] request body bytes or return false More... | |
virtual void | processReplyBody ()=0 |
void | swanSong () override |
bool | doneAll () const override |
whether positive goal has been reached More... | |
void | serverComplete () |
void | markParsedVirginReplyAsWhole (const char *reasonWeAreSure) |
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... | |
void | handleStopRequest () |
process external request to terminate now (i.e. during this async call) More... | |
virtual void * | toCbdata ()=0 |
Static Public Member Functions | |
static void | Start (const Pointer &job) |
static void | RegisterWithCacheManager () |
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 |
StoreEntry * | entry = nullptr |
FwdState::Pointer | fwd |
HttpRequestPointer | request |
const InstanceId< AsyncJob > | id |
job identifier More... | |
Protected Member Functions | |
void | start () override |
called by AsyncStart; do not call directly More... | |
void | closeServer () override |
bool | doneWithServer () const override |
const Comm::ConnectionPointer & | dataConnection () const override |
void | abortAll (const char *reason) override |
abnormal transaction termination; reason is for debugging only More... | |
void | noteDelayAwareReadChance () override |
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 () |
void | sentRequestBody (const CommIoCbParams &io) override |
void | doneSendingRequestBody () override |
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 HttpReply * | virginReply () const |
HttpReply * | virginReply () |
HttpReply * | setVirginReply (HttpReply *r) |
HttpReply * | finalReply () |
HttpReply * | setFinalReply (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... | |
void | delayRead () |
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 > &) |
Static Protected Member Functions | |
static void | ReportAllJobs (StoreEntry *) |
writes a cache manager report about all jobs existing in this worker More... | |
Protected Attributes | |
JobWait< Comm::ConnOpener > | dataConnWait |
int64_t | currentOffset = 0 |
MemBuf * | responseBodyBuffer = nullptr |
BodyPipe::Pointer | requestBodySource |
AsyncCall::Pointer | requestSender |
BodyPipe::Pointer | virginBodyDestination |
CbcPointer< Adaptation::Initiate > | adaptedHeadSource |
BodyPipe::Pointer | adaptedBodySource |
bool | adaptationAccessCheckPending = false |
bool | startedAdaptation = false |
bool | receivedWholeAdaptedReply = false |
handleAdaptedBodyProductionEnded() was called More... | |
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... | |
bool | started_ = false |
Start() has finished successfully. More... | |
bool | swanSang_ = false |
swanSong() was called More... | |
Private Member Functions | |
CBDATA_INTERMEDIATE () | |
bool | parseControlReply (size_t &bytesUsed) |
void | serverComplete2 () |
void | sendBodyIsTooLargeError () |
void | maybePurgeOthers () |
virtual void | finalizedInCbdataChild ()=0 |
hack: ensure CBDATA_CHILD() after a toCbdata()-defining CBDATA_INTERMEDIATE() More... | |
Private Attributes | |
bool | shortenReadTimeout |
bool | completed = false |
HttpReply * | theVirginReply = nullptr |
HttpReply * | theFinalReply = nullptr |
Detailed Description
Definition at line 110 of file FtpClient.h.
Member Typedef Documentation
◆ Pointer [1/3]
|
inherited |
Definition at line 34 of file AsyncJob.h.
◆ Pointer [2/3]
|
inherited |
Definition at line 25 of file BodyPipe.h.
◆ Pointer [3/3]
|
inherited |
Definition at line 45 of file BodyPipe.h.
Member Enumeration Documentation
◆ anonymous enum
anonymous enum |
Definition at line 145 of file FtpClient.h.
Constructor & Destructor Documentation
◆ Client()
|
explicit |
Definition at line 184 of file FtpClient.cc.
References StatCounters::all, ctrl, ctrlClosed(), StatCounters::ftp, JobCallback, Ftp::CtrlChannel::last_command, Ftp::Channel::opened(), StatCounters::requests, StatCounters::server, FwdState::serverConnection(), statCounter, and xstrdup.
◆ ~Client()
|
override |
Definition at line 205 of file FtpClient.cc.
References safe_free.
Member Function Documentation
◆ abortAll()
|
overrideprotectedvirtual |
◆ abortOnBadEntry()
|
protectedinherited |
Definition at line 258 of file Client.cc.
References Client::abortOnData(), debugs, Client::entry, and StoreEntry::isAccepting().
Referenced by Client::handleAdaptationAborted(), Client::handleAdaptationBlocked(), Client::handleAdaptedBodyProducerAborted(), Client::handleAdaptedBodyProductionEnded(), Client::handleAdaptedHeader(), Client::handleMoreAdaptedBodyAvailable(), Client::noteAdaptationAclCheckDone(), and Client::resumeBodyStorage().
◆ abortOnData()
|
virtualinherited |
abnormal data transfer termination
- Return values
-
true the transaction will be terminated (abortAll called) false the transaction will survive
Reimplemented in Ftp::Relay.
Definition at line 311 of file Client.cc.
References Client::abortAll().
Referenced by Client::abortOnBadEntry(), Client::handleAdaptationBlocked(), Client::sendBodyIsTooLargeError(), and Client::sentRequestBody().
◆ adaptOrFinalizeReply()
|
protectedinherited |
Definition at line 996 of file Client.cc.
References Client::adaptationAccessCheckPending, FwdState::al, debugs, Client::fwd, Adaptation::methodRespmod, Client::originalRequest(), Adaptation::pointPreCache, Client::setFinalReply(), Adaptation::AccessCheck::Start(), and Client::virginReply().
Referenced by HttpStateData::processReply().
◆ adaptVirginReplyBody()
|
protectedinherited |
Definition at line 629 of file Client.cc.
References MemBuf::append(), assert, MemBuf::consume(), MemBuf::content(), MemBuf::contentSize(), debugs, MemBuf::init(), BodyPipe::putMoreData(), Client::responseBodyBuffer, Client::startedAdaptation, and Client::virginBodyDestination.
Referenced by Client::addVirginReplyBody().
◆ addVirginReplyBody()
|
protectedinherited |
Definition at line 1038 of file Client.cc.
References Client::adaptationAccessCheckPending, Client::adaptVirginReplyBody(), Client::adjustBodyBytesRead(), assert, Client::startedAdaptation, and Client::storeReplyBody().
Referenced by HttpStateData::decodeAndWriteReplyBody(), Client::noteMoreBodySpaceAvailable(), and HttpStateData::writeReplyBody().
◆ adjustBodyBytesRead()
|
protectedinherited |
Definition at line 1014 of file Client.cc.
References HierarchyLogEntry::bodyBytesRead, HttpRequest::hier, Must, and Client::originalRequest().
Referenced by Client::addVirginReplyBody().
◆ announceInitiatorAbort()
|
protectedinherited |
Definition at line 38 of file Initiator.cc.
References CallJobHere.
Referenced by ClientHttpRequest::~ClientHttpRequest(), and Client::cleanAdaptation().
◆ blockCaching()
|
protectedinherited |
Definition at line 552 of file Client.cc.
References SquidConfig::accessList, ACLFilledChecklist::al, FwdState::al, Acl::Answer::allowed(), Config, debugs, Client::entry, ACLChecklist::fastCheck(), MemObject::freshestReply(), Client::fwd, HTTPMSGLOCK(), StoreEntry::mem(), Client::originalRequest(), ACLFilledChecklist::reply, and SquidConfig::storeMiss.
Referenced by Client::setFinalReply().
◆ calcBufferSpaceToReserve()
|
protectedinherited |
Definition at line 1063 of file Client.cc.
References BodyPipe::buf(), debugs, SBuf::maxSize, min(), MemBuf::potentialSpaceSize(), Client::responseBodyBuffer, and Client::virginBodyDestination.
Referenced by HttpStateData::maybeMakeSpaceAvailable().
◆ callEnd()
|
virtualinherited |
called right after the called job method
Reimplemented in Adaptation::Icap::Xaction.
Definition at line 152 of file AsyncJob.cc.
References assert, AsyncCall::debugLevel, debugs, AsyncCall::debugSection, AsyncJob::done(), AsyncJob::inCall, AsyncJob::started_, AsyncJob::status(), AsyncJob::swanSang_, AsyncJob::swanSong(), and AsyncJob::typeName.
Referenced by Adaptation::Icap::Xaction::callEnd(), and AsyncJob::deleteThis().
◆ callException()
|
virtualinherited |
Reimplemented in ConnStateData, ClientHttpRequest, Adaptation::Icap::ModXact, Adaptation::Icap::ServiceRep, Adaptation::Icap::Xaction, Ipc::Forwarder, Ipc::Inquirer, and Ftp::Server.
Definition at line 143 of file AsyncJob.cc.
References cbdataReferenceValid(), debugs, Must, AsyncJob::mustStop(), and CbdataParent::toCbdata().
Referenced by ConnStateData::callException(), Adaptation::Icap::Xaction::callException(), Ipc::Forwarder::callException(), Ipc::Inquirer::callException(), and Ftp::Server::callException().
◆ callStart()
|
inherited |
called just before the called method
Definition at line 130 of file AsyncJob.cc.
References cbdataReferenceValid(), AsyncCall::debugLevel, debugs, AsyncCall::debugSection, AsyncJob::inCall, Must, AsyncJob::status(), CbdataParent::toCbdata(), and AsyncJob::typeName.
◆ canBeCalled()
|
inherited |
Definition at line 117 of file AsyncJob.cc.
References AsyncCall::cancel(), debugs, and AsyncJob::inCall.
◆ CBDATA_INTERMEDIATE()
|
private |
◆ cleanAdaptation()
|
protectedinherited |
Definition at line 604 of file Client.cc.
References Client::adaptationAccessCheckPending, Client::adaptedBodySource, Client::adaptedHeadSource, Adaptation::Initiator::announceInitiatorAbort(), assert, debugs, Client::doneWithAdaptation(), BodyConsumer::stopConsumingFrom(), BodyProducer::stopProducingFor(), and Client::virginBodyDestination.
Referenced by Client::handleAdaptationCompleted(), and Client::swanSong().
◆ clearAdaptation()
|
protectedinherited |
Definition at line 32 of file Initiator.cc.
References CbcPointer< Cbc >::clear().
Referenced by ClientHttpRequest::handleAdaptedHeader(), ClientHttpRequest::noteAdaptationAnswer(), and Client::noteAdaptationAnswer().
◆ closeServer()
|
overrideprotectedvirtual |
Close the FTP server connection(s). Used by serverComplete().
Implements Client.
Definition at line 233 of file FtpClient.cc.
References debugs, and Comm::IsConnOpen().
◆ completeForwarding()
|
protectedvirtualinherited |
default calls fwd->complete()
Reimplemented in Ftp::Gateway, and Ftp::Relay.
Definition at line 230 of file Client.cc.
References assert, FwdState::complete(), debugs, Client::doneWithFwd, and Client::fwd.
Referenced by Ftp::Gateway::completeForwarding(), Ftp::Relay::completeForwarding(), Client::handleAdaptationCompleted(), and Client::serverComplete2().
◆ connectDataChannel()
void Ftp::Client::connectDataChannel | ( | ) |
Definition at line 762 of file FtpClient.cc.
References COMM_TRANSPARENT, Config, conn, SquidConfig::connect, dataChannelConnected(), debugs, Comm::IsConnOpen(), JobCallback, safe_free, SquidConfig::Timeout, and xstrdup.
Referenced by ftpReadEPSV(), and ftpReadPasv().
◆ ctrlClosed()
|
protected |
◆ dataChannelConnected()
|
protectedpure virtual |
Implemented in Ftp::Gateway, and Ftp::Relay.
Referenced by connectDataChannel().
◆ dataClosed()
|
protectedvirtual |
Reimplemented in Ftp::Gateway.
Definition at line 810 of file FtpClient.cc.
References debugs.
Referenced by Ftp::Gateway::dataClosed(), and dataCloser().
◆ dataCloser()
|
protected |
Definition at line 802 of file FtpClient.cc.
References dataClosed(), and JobCallback.
◆ dataComplete()
|
protected |
Close data channel, if any, to conserve resources while we wait.
Definition at line 1024 of file FtpClient.cc.
References debugs.
Referenced by Ftp::Relay::HandleStoreAbort().
◆ dataConnection()
|
overrideprotectedvirtual |
- Returns
- primary or "request data connection"
Implements Client.
Definition at line 902 of file FtpClient.cc.
◆ dataRead()
|
protected |
Definition at line 955 of file FtpClient.cc.
References StatCounters::all, assert, DelayId::bytesIn(), DBG_IMPORTANT, debugs, EBIT_TEST, ENTRY_ABORTED, Comm::ERR_CLOSING, ERR_READ_ERROR, CommCommonCbParams::fd, CommCommonCbParams::flag, IoStats::Ftp, StatCounters::ftp, ignoreErrno(), IOStats, StatCounters::kbytes_in, Comm::OK, IoStats::read_hist, IoStats::reads, StatCounters::server, CommIoCbParams::size, statCounter, CommCommonCbParams::xerrno, and xstrerr().
Referenced by maybeReadVirginBody().
◆ delayRead()
|
protectedinherited |
Defer reading until it is likely to become possible. Eventually, noteDelayAwareReadChance() will be called.
Definition at line 1029 of file Client.cc.
References asyncCall(), MemObject::delayRead(), Client::entry, StoreEntry::mem(), and Client::noteDelayAwareReadChance().
Referenced by HttpStateData::readReply().
◆ deleteThis()
|
protectedinherited |
Definition at line 65 of file AsyncJob.cc.
References asyncCall(), AsyncJob::callEnd(), debugs, AsyncJob::deleteThis(), AsyncJob::inCall, JobMemFun(), Must, AsyncJob::stopReason, and AsyncJob::typeName.
Referenced by ConnStateData::connStateClosed(), and AsyncJob::deleteThis().
◆ done()
|
protectedinherited |
Definition at line 106 of file AsyncJob.cc.
References AsyncJob::doneAll(), and AsyncJob::stopReason.
Referenced by AsyncJob::callEnd(), HappyConnOpener::checkForNewConnection(), Downloader::downloadFinished(), and HappyConnOpener::maybeOpenPrimeConnection().
◆ doneAll()
|
overridevirtualinherited |
Reimplemented from AsyncJob.
Definition at line 217 of file Client.cc.
References AsyncJob::doneAll(), Client::doneWithAdaptation(), and Client::doneWithServer().
◆ doneSendingRequestBody()
|
overrideprotectedvirtual |
called after we wrote the last byte of the request body
Implements Client.
Definition at line 1087 of file FtpClient.cc.
References debugs, and Client::doneSendingRequestBody().
◆ doneWithAdaptation()
|
protectedvirtualinherited |
did we end ICAP communication?
Definition at line 621 of file Client.cc.
References Client::adaptationAccessCheckPending, Client::adaptedBodySource, Client::adaptedHeadSource, and Client::virginBodyDestination.
Referenced by Client::cleanAdaptation(), Client::doneAll(), Client::handleAdaptedHeader(), Client::noteBodyConsumerAborted(), and Client::serverComplete2().
◆ doneWithServer()
|
overrideprotectedvirtual |
Did we close all FTP server connection(s)?
- Return values
-
true Both server control and data channels are closed. And not waiting for a new data connection to open. false Either control channel or data is still active.
Implements Client.
Definition at line 256 of file FtpClient.cc.
References Comm::IsConnOpen().
◆ endAdaptedBodyConsumption()
|
protectedinherited |
Definition at line 830 of file Client.cc.
References Client::adaptedBodySource, Client::fwd, Client::handleAdaptationCompleted(), FwdState::markStoredReplyAsWhole(), Client::receivedWholeAdaptedReply, and BodyConsumer::stopConsumingFrom().
Referenced by Client::handleAdaptedBodyProductionEnded(), and Client::resumeBodyStorage().
◆ failed()
|
virtual |
Reimplemented in Ftp::Relay.
Definition at line 262 of file FtpClient.cc.
References debugs, error(), ErrorState::ftp, ErrorState::httpStatus, SysErrorDetail::NewIfAny(), ErrorState::reply, ErrorState::request, ErrorState::server_msg, ErrorState::type, ErrorState::xerrno, and xstrdup.
Referenced by Ftp::Gateway::dataClosed(), Ftp::Relay::failed(), ftpFail(), ftpReadTransferDone(), and ftpWriteTransferDone().
◆ failedHttpStatus()
|
protectedvirtual |
Reimplemented in Ftp::Gateway.
Definition at line 311 of file FtpClient.cc.
References ERR_FTP_FAILURE, ERR_NONE, ERR_READ_TIMEOUT, error(), Http::scBadGateway, and Http::scGatewayTimeout.
Referenced by Ftp::Gateway::failedHttpStatus().
◆ finalizedInCbdataChild()
|
privatepure virtualinherited |
◆ finalReply()
|
protectedinherited |
Definition at line 129 of file Client.cc.
References assert, and Client::theFinalReply.
Referenced by HttpStateData::haveParsedReplyHeaders(), and HttpStateData::reusableReply().
◆ getMoreRequestBody()
|
virtualinherited |
Reimplemented in HttpStateData.
Definition at line 438 of file Client.cc.
References BodyPipe::getMoreData(), Must, and Client::requestBodySource.
Referenced by HttpStateData::getMoreRequestBody(), and Client::sendMoreRequestBody().
◆ handleAdaptationAborted()
|
protectedinherited |
Definition at line 885 of file Client.cc.
References Client::abortAll(), Client::abortOnBadEntry(), debugs, Client::entry, Client::handledEarlyAdaptationAbort(), and StoreEntry::isEmpty().
Referenced by Client::noteAdaptationAnswer().
◆ handleAdaptationBlocked()
|
protectedinherited |
Definition at line 924 of file Client.cc.
References Client::abortAll(), Client::abortOnBadEntry(), Client::abortOnData(), aclGetDenyInfoPage(), FwdState::al, Config, debugs, SquidConfig::denyInfoList, HttpRequest::detailError(), FwdState::dontRetry(), Client::entry, ERR_ACCESS_DENIED, ERR_ICAP_FAILURE, ERR_NONE, FwdState::fail(), Client::fwd, RefCount< C >::getRaw(), StoreEntry::isEmpty(), MakeNamedErrorDetail(), Client::request, Adaptation::Answer::ruleId, Http::scForbidden, and String::termedBuf().
Referenced by Client::noteAdaptationAnswer().
◆ handleAdaptationCompleted()
|
protectedinherited |
Definition at line 866 of file Client.cc.
References Client::cleanAdaptation(), Client::closeServer(), Client::completeForwarding(), debugs, and Client::mayReadVirginReplyBody().
Referenced by Client::endAdaptedBodyConsumption(), Client::handleAdaptedBodyProducerAborted(), Client::handleAdaptedHeader(), and Client::noteBodyConsumerAborted().
◆ handleAdaptedBodyProducerAborted()
|
protectedinherited |
Definition at line 845 of file Client.cc.
References Client::abortOnBadEntry(), Client::adaptedBodySource, debugs, BodyPipe::exhausted(), Client::handleAdaptationCompleted(), Client::handledEarlyAdaptationAbort(), Must, and BodyConsumer::stopConsumingFrom().
Referenced by Client::noteBodyProducerAborted().
◆ handleAdaptedBodyProductionEnded()
|
protectedinherited |
Definition at line 815 of file Client.cc.
References Client::abortOnBadEntry(), Client::adaptedBodySource, Client::endAdaptedBodyConsumption(), BodyPipe::exhausted(), and Client::receivedWholeAdaptedReply.
Referenced by Client::noteBodyProductionEnded().
◆ handleAdaptedHeader()
|
protectedinherited |
Definition at line 717 of file Client.cc.
References Client::abortOnBadEntry(), Client::adaptedBodySource, assert, Http::Message::body_pipe, debugs, Client::doneWithAdaptation(), BodyPipe::expectNoConsumption(), Client::fwd, Client::handleAdaptationCompleted(), FwdState::markStoredReplyAsWhole(), BodyPipe::setConsumerIfNotLate(), and Client::setFinalReply().
Referenced by Client::noteAdaptationAnswer().
◆ handleControlReply()
|
protectedvirtual |
Reimplemented in Ftp::Gateway, and Ftp::Relay.
Definition at line 419 of file FtpClient.cc.
References assert, debugs, memReallocBuf(), and wordlistDestroy().
Referenced by Ftp::Gateway::handleControlReply(), and Ftp::Relay::handleControlReply().
◆ handledEarlyAdaptationAbort()
|
protectedinherited |
If the store entry is still empty, fully handles adaptation abort, returning true. Otherwise just updates the request error detail and returns false.
Definition at line 901 of file Client.cc.
References Client::abortAll(), FwdState::al, debugs, HttpRequest::detailError(), FwdState::dontRetry(), Client::entry, ERR_ICAP_FAILURE, FwdState::fail(), Client::fwd, RefCount< C >::getRaw(), StoreEntry::isEmpty(), MakeNamedErrorDetail(), Client::request, and Http::scInternalServerError.
Referenced by Client::handleAdaptationAborted(), and Client::handleAdaptedBodyProducerAborted().
◆ handleEpsvReply()
bool Client::handleEpsvReply | ( | Ip::Address & | remoteAddr | ) |
Definition at line 491 of file FtpClient.cc.
References code, Config, DBG_IMPORTANT, debugs, Ip::EnableIpv6, ERR_FTP_FAILURE, SquidConfig::Ftp, Comm::IsConnOpen(), port, Ip::Address::port(), and SquidConfig::sanitycheck.
Referenced by ftpReadEPSV().
◆ handleMoreAdaptedBodyAvailable()
|
protectedinherited |
Definition at line 768 of file Client.cc.
References Client::abortOnBadEntry(), Client::adaptedBodySource, assert, asyncCall(), BodyPipeCheckout::buf, BodyPipe::buf(), StoreEntry::bytesWanted(), BodyPipeCheckout::checkIn(), MemBuf::consume(), BodyPipe::consumedSize(), MemBuf::contentSize(), Client::currentOffset, debugs, StoreEntry::deferProducer(), Client::entry, StoreIOBuffer::length, Client::resumeBodyStorage(), and StoreEntry::write().
Referenced by Client::noteMoreBodyDataAvailable(), and Client::resumeBodyStorage().
◆ handleMoreRequestBodyAvailable()
|
protectedinherited |
Definition at line 319 of file Client.cc.
References debugs, Client::requestSender, and Client::sendMoreRequestBody().
Referenced by Client::noteMoreBodyDataAvailable().
◆ handlePasvReply()
bool Client::handlePasvReply | ( | Ip::Address & | remoteAddr | ) |
extracts remoteAddr from PASV response, validates it, sets data address details, and returns true on success
Definition at line 455 of file FtpClient.cc.
References code, Config, DBG_IMPORTANT, debugs, fd_table, SquidConfig::Ftp, Comm::IsConnOpen(), Ftp::ParseIpPort(), and SquidConfig::sanitycheck.
Referenced by ftpReadPasv().
◆ handleRequestBodyProducerAborted()
|
protectedpure virtualinherited |
Implemented in Ftp::Gateway, Ftp::Relay, and HttpStateData.
Definition at line 351 of file Client.cc.
References debugs, FwdState::dontRetry(), Client::fwd, Client::requestBodySource, Client::requestSender, and BodyConsumer::stopConsumingFrom().
Referenced by Ftp::Gateway::handleRequestBodyProducerAborted(), Ftp::Relay::handleRequestBodyProducerAborted(), HttpStateData::handleRequestBodyProducerAborted(), and Client::noteBodyProducerAborted().
◆ handleRequestBodyProductionEnded()
|
protectedinherited |
Definition at line 329 of file Client.cc.
References debugs, Client::doneSendingRequestBody(), Client::receivedWholeRequestBody, and Client::requestSender.
Referenced by Client::noteBodyProductionEnded().
◆ handleStopRequest()
|
inlineinherited |
Definition at line 73 of file AsyncJob.h.
References AsyncJob::mustStop().
◆ haveParsedReplyHeaders()
|
protectedvirtualinherited |
called when got final headers
Reimplemented in Ftp::Gateway, and HttpStateData.
Definition at line 537 of file Client.cc.
References HttpReply::contentRange(), Client::currentOffset, Client::maybePurgeOthers(), Must, Client::theFinalReply, and HttpHdrRangeSpec::UnknownPosition.
Referenced by Ftp::Gateway::haveParsedReplyHeaders(), HttpStateData::haveParsedReplyHeaders(), and Client::setFinalReply().
◆ initiateAdaptation()
|
protectedinherited |
Definition at line 23 of file Initiator.cc.
References Adaptation::Initiate::initiator(), and Ident::Start().
Referenced by ClientHttpRequest::startAdaptation(), and Client::startAdaptation().
◆ initiated()
|
inlineprotectedinherited |
Definition at line 52 of file Initiator.h.
References CbcPointer< Cbc >::set().
Referenced by ClientHttpRequest::startAdaptation(), and Client::startAdaptation().
◆ initReadBuf()
|
protected |
Definition at line 221 of file FtpClient.cc.
References MemBuf::init().
Referenced by Ftp::Gateway::Gateway().
◆ markParsedVirginReplyAsWhole()
|
inherited |
remember that the received virgin reply was parsed in its entirety, including its body (if any)
Definition at line 158 of file Client.cc.
References assert, debugs, Client::fwd, FwdState::markStoredReplyAsWhole(), and Client::startedAdaptation.
Referenced by HttpStateData::decodeAndWriteReplyBody(), ftpReadTransferDone(), and HttpStateData::writeReplyBody().
◆ maybePurgeOthers()
|
privateinherited |
Definition at line 516 of file Client.cc.
References SBuf::c_str(), Http::CONTENT_LOCATION, debugs, HttpRequest::effectiveRequestUri(), RefCount< C >::getRaw(), Http::LOCATION, HttpRequest::method, purgeEntriesByHeader(), purgeEntriesByUrl(), HttpRequestMethod::purgesOthers(), Client::request, HttpReply::sline, Http::StatusLine::status(), and Client::theFinalReply.
Referenced by Client::haveParsedReplyHeaders().
◆ maybeReadVirginBody()
|
overridevirtual |
Implements Client.
Definition at line 915 of file FtpClient.cc.
References comm_read(), commSetConnTimeout(), Config, dataRead(), debugs, fd_table, Comm::IsConnOpen(), JobCallback, SquidConfig::read, timeout(), and SquidConfig::Timeout.
Referenced by ftpReadList(), and ftpReadRetr().
◆ mayReadVirginReplyBody()
|
protectedpure virtualinherited |
Implemented in Ftp::Gateway, Ftp::Relay, and HttpStateData.
Referenced by Client::handleAdaptationCompleted().
◆ mustStop()
|
protectedinherited |
Definition at line 85 of file AsyncJob.cc.
References debugs, AsyncJob::inCall, Must, AsyncJob::stopReason, and AsyncJob::typeName.
Referenced by HttpStateData::abortAll(), AsyncJob::callException(), HttpStateData::continueAfterParsingHeader(), HttpStateData::drop1xx(), HttpStateData::handleMoreRequestBodyAvailable(), AsyncJob::handleStopRequest(), HttpStateData::httpStateConnClosed(), HttpStateData::httpTimeout(), HttpStateData::proceedAfter1xx(), ConnStateData::proxyProtocolError(), HttpStateData::readReply(), HttpStateData::start(), and HttpStateData::wroteLast().
◆ noteAdaptationAclCheckDone()
|
overridevirtualinherited |
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 957 of file Client.cc.
References Client::abortOnBadEntry(), Client::adaptationAccessCheckPending, debugs, Client::originalRequest(), Client::processReplyBody(), Client::request, Client::sendBodyIsTooLargeError(), Client::setFinalReply(), Client::startAdaptation(), and Client::virginReply().
◆ noteAdaptationAnswer()
|
overridevirtualinherited |
called with the initial adaptation decision (adapt, block, error); virgin and/or adapted body transmission may continue after this
Implements Adaptation::Initiator.
Definition at line 697 of file Client.cc.
References Client::adaptedHeadSource, Adaptation::Answer::akBlock, Adaptation::Answer::akError, Adaptation::Answer::akForward, Adaptation::Initiator::clearAdaptation(), Adaptation::Answer::final, RefCount< C >::getRaw(), Client::handleAdaptationAborted(), Client::handleAdaptationBlocked(), Client::handleAdaptedHeader(), Adaptation::Answer::kind, and Adaptation::Answer::message.
◆ noteBodyConsumerAborted()
|
overridevirtualinherited |
Implements BodyProducer.
Definition at line 685 of file Client.cc.
References Client::doneWithAdaptation(), Client::handleAdaptationCompleted(), BodyProducer::stopProducingFor(), and Client::virginBodyDestination.
◆ noteBodyProducerAborted()
|
overridevirtualinherited |
Implements BodyConsumer.
Definition at line 298 of file Client.cc.
References Client::adaptedBodySource, Client::handleAdaptedBodyProducerAborted(), Client::handleRequestBodyProducerAborted(), and Client::requestBodySource.
◆ noteBodyProductionEnded()
|
overridevirtualinherited |
Implements BodyConsumer.
Definition at line 284 of file Client.cc.
References Client::adaptedBodySource, Client::handleAdaptedBodyProductionEnded(), Client::handleRequestBodyProductionEnded(), and Client::requestBodySource.
◆ noteDelayAwareReadChance()
|
overrideprotectedvirtual |
Called when a previously delayed dataConnection() read may be possible.
- See also
- delayRead()
Implements Client.
Definition at line 908 of file FtpClient.cc.
◆ noteMoreBodyDataAvailable()
|
overridevirtualinherited |
Implements BodyConsumer.
Definition at line 270 of file Client.cc.
References Client::adaptedBodySource, Client::handleMoreAdaptedBodyAvailable(), Client::handleMoreRequestBodyAvailable(), and Client::requestBodySource.
◆ noteMoreBodySpaceAvailable()
|
overridevirtualinherited |
Implements BodyProducer.
Definition at line 671 of file Client.cc.
References Client::addVirginReplyBody(), Client::completed, Client::maybeReadVirginBody(), Client::responseBodyBuffer, and Client::serverComplete2().
◆ openListenSocket()
bool Client::openListenSocket | ( | ) |
Definition at line 795 of file FtpClient.cc.
◆ originalRequest()
|
virtualinherited |
Definition at line 570 of file Client.cc.
References Client::request.
Referenced by Client::adaptOrFinalizeReply(), Client::adjustBodyBytesRead(), Client::blockCaching(), HttpStateData::finishingBrokenPost(), HttpStateData::handle1xx(), Client::noteAdaptationAclCheckDone(), Client::serverComplete(), and Client::startRequestBodyFlow().
◆ parseControlReply()
|
private |
Parses FTP server control response into ctrl structure fields, setting bytesUsed and returning true on success.
Definition at line 1101 of file FtpClient.cc.
References assert, Ftp::crlf, debugs, head, wordlist::key, wordlist::next, safe_free, wordlistDestroy(), xmalloc, xstrdup, and xstrncpy().
◆ processReplyBody()
|
pure virtualinherited |
Implemented in Ftp::Gateway, Ftp::Relay, and HttpStateData.
Referenced by Client::noteAdaptationAclCheckDone().
◆ readControlReply()
|
protected |
Definition at line 362 of file FtpClient.cc.
References StatCounters::all, assert, commUnsetConnTimeout(), DBG_IMPORTANT, debugs, EBIT_TEST, ENTRY_ABORTED, Comm::ERR_CLOSING, ERR_FTP_FAILURE, ERR_READ_ERROR, CommCommonCbParams::fd, fd_bytes(), FD_READ, CommCommonCbParams::flag, StatCounters::ftp, ignoreErrno(), Comm::IsConnOpen(), StatCounters::kbytes_in, Comm::OK, StatCounters::server, CommIoCbParams::size, statCounter, STORE_PENDING, CommCommonCbParams::xerrno, and xstrerr().
Referenced by scheduleReadControlReply().
◆ RegisterWithCacheManager()
|
staticinherited |
Definition at line 215 of file AsyncJob.cc.
References Mgr::RegisterAction(), and AsyncJob::ReportAllJobs().
Referenced by mainInitialize().
◆ replyBodySpace()
|
protectedinherited |
- Deprecated:
- use SBuf I/O API and calcBufferSpaceToReserve() instead
Definition at line 1098 of file Client.cc.
References BodyPipe::buf(), debugs, min(), MemBuf::potentialSpaceSize(), Client::responseBodyBuffer, MemBuf::spaceSize(), and Client::virginBodyDestination.
◆ ReportAllJobs()
|
staticprotectedinherited |
Definition at line 198 of file AsyncJob.cc.
References AllJobs().
Referenced by AsyncJob::RegisterWithCacheManager().
◆ resumeBodyStorage()
|
protectedinherited |
Definition at line 752 of file Client.cc.
References Client::abortOnBadEntry(), Client::adaptedBodySource, Client::endAdaptedBodyConsumption(), BodyPipe::exhausted(), and Client::handleMoreAdaptedBodyAvailable().
Referenced by Client::handleMoreAdaptedBodyAvailable().
◆ scheduleReadControlReply()
|
protected |
DPW 2007-04-23 Looks like there are no longer anymore callers that set buffered_ok=1. Perhaps it can be removed at some point.
Definition at line 325 of file FtpClient.cc.
References comm_read(), commSetConnTimeout(), commUnsetConnTimeout(), Config, SquidConfig::connect, debugs, Comm::IsConnOpen(), JobCallback, min(), SquidConfig::read, readControlReply(), timeout(), and SquidConfig::Timeout.
Referenced by Ftp::Relay::scheduleReadControlReply().
◆ sendBodyIsTooLargeError()
|
privateinherited |
Definition at line 985 of file Client.cc.
References Client::abortOnData(), FwdState::al, FwdState::dontRetry(), ERR_TOO_BIG, FwdState::fail(), Client::fwd, RefCount< C >::getRaw(), Client::request, and Http::scForbidden.
Referenced by Client::noteAdaptationAclCheckDone().
◆ sendEprt()
bool Client::sendEprt | ( | ) |
Definition at line 607 of file FtpClient.cc.
References Packable::appendf(), comm_local_port(), Config, MemBuf::content(), Ftp::crlf, debugs, SquidConfig::eprt, ERR_FTP_FAILURE, SquidConfig::Ftp, Comm::IsConnOpen(), MAX_IPSTRLEN, and MemBuf::reset().
◆ sendMoreRequestBody()
|
protectedinherited |
Definition at line 412 of file Client.cc.
References assert, conn, MemBuf::contentSize(), Client::dataConnection(), debugs, Client::getMoreRequestBody(), Comm::IsConnOpen(), JobCallback, Client::requestBodySource, Client::requestSender, Client::sentRequestBody(), and Comm::Write().
Referenced by Client::handleMoreRequestBodyAvailable(), and Client::sentRequestBody().
◆ 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 653 of file FtpClient.cc.
References SquidConfig::accessList, Acl::Answer::allowed(), Packable::appendf(), Config, MemBuf::content(), Ftp::crlf, DBG_IMPORTANT, debugs, SquidConfig::epsv_all, ERR_FTP_FAILURE, ACLChecklist::fastCheck(), SquidConfig::Ftp, SquidConfig::ftp_epsv, SquidConfig::passive, MemBuf::reset(), and wordlistDestroy().
Referenced by ftpSendPassive().
◆ sendPort()
bool Client::sendPort | ( | ) |
Definition at line 646 of file FtpClient.cc.
References ERR_FTP_FAILURE.
◆ sentRequestBody()
|
overrideprotectedvirtual |
Implements Client.
Definition at line 1076 of file FtpClient.cc.
References StatCounters::ftp, StatCounters::kbytes_out, Client::sentRequestBody(), StatCounters::server, CommIoCbParams::size, and statCounter.
◆ serverComplete()
|
inherited |
call when no server communication is expected
Definition at line 180 of file Client.cc.
References assert, Client::closeServer(), Client::completed, debugs, Client::doneWithServer(), HttpRequest::hier, Client::originalRequest(), Client::requestBodySource, Client::responseBodyBuffer, Client::serverComplete2(), BodyConsumer::stopConsumingFrom(), and HierarchyLogEntry::stopPeerClock().
Referenced by ftpReadQuit(), HttpStateData::processReplyBody(), and Ftp::Relay::serverComplete().
◆ serverComplete2()
|
privateinherited |
Continuation of serverComplete
Definition at line 202 of file Client.cc.
References Client::completeForwarding(), debugs, Client::doneWithAdaptation(), BodyProducer::stopProducingFor(), and Client::virginBodyDestination.
Referenced by Client::noteMoreBodySpaceAvailable(), and Client::serverComplete().
◆ setFinalReply()
Definition at line 136 of file Client.cc.
References FwdState::al, assert, Client::blockCaching(), debugs, EBIT_TEST, Client::entry, StoreEntry::flags, Client::fwd, Client::haveParsedReplyHeaders(), HTTPMSGLOCK(), StoreEntry::release(), RELEASE_REQUEST, StoreEntry::replaceHttpReply(), AccessLogEntry::reply, StoreEntry::startWriting(), and Client::theFinalReply.
Referenced by Client::adaptOrFinalizeReply(), Client::handleAdaptedHeader(), and Client::noteAdaptationAclCheckDone().
◆ setVirginReply()
Definition at line 116 of file Client.cc.
References FwdState::al, assert, debugs, Client::fwd, HTTPMSGLOCK(), AccessLogEntry::reply, and Client::theVirginReply.
Referenced by HttpStateData::processReplyHeader().
◆ start()
|
overrideprotectedvirtual |
Reimplemented from AsyncJob.
Reimplemented in Ftp::Gateway, and Ftp::Relay.
Definition at line 215 of file FtpClient.cc.
Referenced by Ftp::Gateway::start(), and Ftp::Relay::start().
◆ Start()
|
staticinherited |
Promises to start the configured job (eventually). The job is deemed to be running asynchronously beyond this point, so the caller should only access the job object via AsyncCalls rather than directly.
swanSong() is only called for jobs for which this method has returned successfully (i.e. without throwing).
Definition at line 37 of file AsyncJob.cc.
References CallJobHere, AsyncJob::start(), and AsyncJob::started_.
Referenced by Ftp::Server::AcceptCtrlConnection(), clientListenerConnectionOpened(), Ipc::Coordinator::handleCacheMgrRequest(), Ipc::Coordinator::handleSnmpRequest(), httpAccept(), httpsAccept(), httpStart(), idnsInitVC(), Ftp::Gateway::listenForDataChannel(), Ftp::Server::listenForDataConnection(), Log::TcpLogger::Open(), peerProbeConnect(), Mgr::FunAction::respond(), Mgr::InfoAction::respond(), Ipc::SendMessage(), Mgr::Inquirer::sendResponse(), snmpConstructReponse(), SquidMain(), CacheManager::start(), Adaptation::AccessCheck::Start(), Rock::Rebuild::Start(), JobWaitBase::start_(), BodyPipe::startAutoConsumptionIfNeeded(), Ftp::StartGateway(), Ftp::StartRelay(), PeerPoolMgrsRr::syncConfig(), and Rock::SwapDir::updateHeaders().
◆ startAdaptation()
|
protectedinherited |
Definition at line 578 of file Client.cc.
References Client::adaptedHeadSource, FwdState::al, assert, Http::Message::body_pipe, debugs, HttpReply::expectingBody(), Client::fwd, Adaptation::Initiator::initiateAdaptation(), Adaptation::Initiator::initiated(), HttpRequest::method, Must, BodyPipe::setBodySize(), size, Client::startedAdaptation, Client::virginBodyDestination, and Client::virginReply().
Referenced by Client::noteAdaptationAclCheckDone().
◆ startRequestBodyFlow()
|
protectedinherited |
Definition at line 239 of file Client.cc.
References assert, Http::Message::body_pipe, debugs, Client::originalRequest(), Client::requestBodySource, BodyPipe::setConsumerIfNotLate(), and BodyPipe::status().
Referenced by HttpStateData::sendRequest().
◆ status()
|
protectedvirtualinherited |
for debugging, starts with space
Reimplemented in Adaptation::Ecap::XactionRep, Adaptation::Icap::ServiceRep, Adaptation::Icap::Xaction, Adaptation::Initiate, Http::Tunneler, Comm::TcpAcceptor, HappyConnOpener, Ipc::Inquirer, and Security::PeerConnector.
Definition at line 182 of file AsyncJob.cc.
References MemBuf::append(), Packable::appendf(), MemBuf::content(), MemBuf::reset(), AsyncJob::stopReason, and MemBuf::terminate().
Referenced by AsyncJob::callEnd(), AsyncJob::callStart(), Adaptation::Initiate::status(), and Comm::TcpAcceptor::status().
◆ stopConsumingFrom()
Definition at line 118 of file BodyPipe.cc.
References assert, BodyPipe::clearConsumer(), and debugs.
Referenced by ClientHttpRequest::~ClientHttpRequest(), Client::cleanAdaptation(), Client::doneSendingRequestBody(), Client::endAdaptedBodyConsumption(), ClientHttpRequest::endRequestSatisfaction(), Client::handleAdaptedBodyProducerAborted(), Client::handleRequestBodyProducerAborted(), BodySink::noteBodyProducerAborted(), ClientHttpRequest::noteBodyProducerAborted(), BodySink::noteBodyProductionEnded(), Client::serverComplete(), and Client::swanSong().
◆ stopProducingFor()
Definition at line 107 of file BodyPipe.cc.
References assert, BodyPipe::clearProducer(), and debugs.
Referenced by ConnStateData::~ConnStateData(), Client::cleanAdaptation(), ConnStateData::finishDechunkingRequest(), Client::noteBodyConsumerAborted(), and Client::serverComplete2().
◆ storeReplyBody()
|
protectedinherited |
Definition at line 1054 of file Client.cc.
References Client::currentOffset, Client::entry, and StoreEntry::write().
Referenced by Client::addVirginReplyBody().
◆ swanSong()
|
overridevirtualinherited |
Reimplemented from AsyncJob.
Reimplemented in Ftp::Relay.
Definition at line 68 of file Client.cc.
References Client::adaptedBodySource, assert, Client::cleanAdaptation(), Client::closeServer(), Client::doneWithFwd, Client::doneWithServer(), Client::fwd, FwdState::handleUnregisteredServerEnd(), Client::requestBodySource, BodyConsumer::stopConsumingFrom(), AsyncJob::swanSong(), and Client::virginBodyDestination.
Referenced by Ftp::Relay::swanSong().
◆ switchTimeoutToDataChannel()
void Ftp::Client::switchTimeoutToDataChannel | ( | ) |
Cancel the timeout on the Control socket and establish one on the data socket
Definition at line 1065 of file FtpClient.cc.
References commSetConnTimeout(), commUnsetConnTimeout(), Config, JobCallback, SquidConfig::read, timeout(), and SquidConfig::Timeout.
Referenced by ftpReadList(), and ftpReadRetr().
◆ timeout()
|
virtual |
Reimplemented in Ftp::Gateway.
Definition at line 890 of file FtpClient.cc.
References CommCommonCbParams::conn, debugs, and ERR_READ_TIMEOUT.
Referenced by maybeReadVirginBody(), scheduleReadControlReply(), switchTimeoutToDataChannel(), and Ftp::Gateway::timeout().
◆ toCbdata()
|
pure virtualinherited |
Referenced by AsyncJob::callException(), and AsyncJob::callStart().
◆ virginReply() [1/2]
|
protectedinherited |
Definition at line 102 of file Client.cc.
References assert, and Client::theVirginReply.
◆ virginReply() [2/2]
|
protectedinherited |
Definition at line 109 of file Client.cc.
References assert, and Client::theVirginReply.
Referenced by Client::adaptOrFinalizeReply(), HttpStateData::continueAfterParsingHeader(), HttpStateData::handleMoreRequestBodyAvailable(), Client::noteAdaptationAclCheckDone(), HttpStateData::persistentConnStatus(), Client::startAdaptation(), HttpStateData::statusIfComplete(), HttpStateData::truncateVirginBody(), and HttpStateData::writeReplyBody().
◆ writeCommand()
void Client::writeCommand | ( | const char * | buf | ) |
Definition at line 823 of file FtpClient.cc.
References Config, debugs, Ftp::escapeIAC(), SquidConfig::Ftp, Comm::IsConnOpen(), JobCallback, safe_free, SquidConfig::telnet, Comm::Write(), writeCommandCallback(), and xstrdup.
Referenced by ftpSendCwd(), ftpSendList(), ftpSendMdtm(), ftpSendMkdir(), ftpSendNlst(), ftpSendPass(), ftpSendPORT(), ftpSendQuit(), ftpSendRest(), ftpSendRetr(), ftpSendSize(), ftpSendStor(), ftpSendType(), and ftpSendUser().
◆ writeCommandCallback()
|
protected |
Definition at line 855 of file FtpClient.cc.
References StatCounters::all, CommCommonCbParams::conn, DBG_IMPORTANT, debugs, Comm::ERR_CLOSING, ERR_WRITE_ERROR, CommCommonCbParams::fd, fd_bytes(), FD_WRITE, CommCommonCbParams::flag, StatCounters::ftp, StatCounters::kbytes_out, StatCounters::server, CommIoCbParams::size, statCounter, CommCommonCbParams::xerrno, and xstrerr().
Referenced by writeCommand().
Member Data Documentation
◆ adaptationAccessCheckPending
|
protectedinherited |
Definition at line 189 of file Client.h.
Referenced by Client::adaptOrFinalizeReply(), Client::addVirginReplyBody(), Client::cleanAdaptation(), Client::doneWithAdaptation(), Client::noteAdaptationAclCheckDone(), and HttpStateData::processReplyBody().
◆ adaptedBodySource
|
protectedinherited |
to consume adated response body
Definition at line 187 of file Client.h.
Referenced by Client::~Client(), Client::cleanAdaptation(), Client::doneWithAdaptation(), Client::endAdaptedBodyConsumption(), Client::handleAdaptedBodyProducerAborted(), Client::handleAdaptedBodyProductionEnded(), Client::handleAdaptedHeader(), Client::handleMoreAdaptedBodyAvailable(), Client::noteBodyProducerAborted(), Client::noteBodyProductionEnded(), Client::noteMoreBodyDataAvailable(), Client::resumeBodyStorage(), and Client::swanSong().
◆ adaptedHeadSource
|
protectedinherited |
to get adapted response headers
Definition at line 186 of file Client.h.
Referenced by Client::cleanAdaptation(), Client::doneWithAdaptation(), Client::noteAdaptationAnswer(), and Client::startAdaptation().
◆ completed
|
privateinherited |
serverComplete() has been called
Definition at line 90 of file Client.h.
Referenced by Client::noteMoreBodySpaceAvailable(), and Client::serverComplete().
◆ ctrl
CtrlChannel Ftp::Client::ctrl |
Definition at line 142 of file FtpClient.h.
Referenced by Client(), ftpFail(), ftpOpenListenSocket(), ftpReadCwd(), ftpReadEPRT(), ftpReadEPSV(), ftpReadList(), ftpReadMdtm(), ftpReadMkdir(), ftpReadPass(), ftpReadPORT(), ftpReadRest(), ftpReadRetr(), ftpReadSize(), ftpReadTransferDone(), ftpReadType(), ftpReadUser(), ftpReadWelcome(), ftpSendReply(), and ftpWriteTransferDone().
◆ currentOffset
|
protectedinherited |
Our current offset in the StoreEntry
Definition at line 172 of file Client.h.
Referenced by Ftp::Gateway::getCurrentOffset(), Client::handleMoreAdaptedBodyAvailable(), Client::haveParsedReplyHeaders(), Ftp::Gateway::setCurrentOffset(), and Client::storeReplyBody().
◆ data
DataChannel Ftp::Client::data |
Definition at line 143 of file FtpClient.h.
Referenced by ftpOpenListenSocket(), ftpReadList(), ftpReadRetr(), ftpSendPORT(), and Ftp::Relay::HandleStoreAbort().
◆ dataConnWait
|
protected |
Waits for an FTP data connection to the server to be established/opened. This wait only happens in FTP passive mode (via PASV or EPSV).
Definition at line 210 of file FtpClient.h.
◆ doneWithFwd
|
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 199 of file Client.h.
Referenced by Client::completeForwarding(), HttpStateData::httpStateConnClosed(), HttpStateData::proceedAfter1xx(), and Client::swanSong().
◆ entry
|
inherited |
Definition at line 176 of file Client.h.
Referenced by Client::Client(), Ftp::Gateway::Gateway(), HttpStateData::HttpStateData(), Ftp::Relay::Relay(), Client::~Client(), Client::abortOnBadEntry(), Client::blockCaching(), HttpStateData::buildRequestPrefix(), HttpStateData::continueAfterParsingHeader(), Client::delayRead(), ftpFail(), ftpSendReply(), ftpWriteTransferDone(), Client::handleAdaptationAborted(), Client::handleAdaptationBlocked(), Client::handledEarlyAdaptationAbort(), Client::handleMoreAdaptedBodyAvailable(), HttpStateData::handleMoreRequestBodyAvailable(), HttpStateData::handleRequestBodyProducerAborted(), HttpStateData::haveParsedReplyHeaders(), HttpStateData::httpBuildRequestHeader(), HttpStateData::httpTimeout(), HttpStateData::keepaliveAccounting(), HttpStateData::peerSupportsConnectionPinning(), HttpStateData::processReply(), HttpStateData::processReplyBody(), HttpStateData::processReplyHeader(), HttpStateData::processSurrogateControl(), HttpStateData::readReply(), HttpStateData::reusableReply(), Client::sentRequestBody(), Client::setFinalReply(), HttpStateData::statusIfComplete(), Client::storeReplyBody(), and HttpStateData::wroteLast().
◆
enum { ... } Ftp::Client::ftp_state_t |
◆ fwd
|
inherited |
Definition at line 177 of file Client.h.
Referenced by Client::Client(), HttpStateData::HttpStateData(), Client::adaptOrFinalizeReply(), Client::blockCaching(), HttpStateData::buildRequestPrefix(), HttpStateData::closeServer(), Client::completeForwarding(), HttpStateData::continueAfterParsingHeader(), HttpStateData::drop1xx(), Client::endAdaptedBodyConsumption(), HttpStateData::finishingBrokenPost(), HttpStateData::forwardUpgrade(), ftpFail(), ftpSendReply(), HttpStateData::handle1xx(), Client::handleAdaptationBlocked(), Client::handleAdaptedHeader(), Client::handledEarlyAdaptationAbort(), HttpStateData::handleRequestBodyProducerAborted(), Client::handleRequestBodyProducerAborted(), HttpStateData::httpTimeout(), Client::markParsedVirginReplyAsWhole(), HttpStateData::markPrematureReplyBodyEofFailure(), HttpStateData::proceedAfter1xx(), HttpStateData::processReplyBody(), HttpStateData::readReply(), Client::sendBodyIsTooLargeError(), Client::sentRequestBody(), Client::setFinalReply(), Client::setVirginReply(), Client::startAdaptation(), Client::swanSong(), and HttpStateData::wroteLast().
◆ id
|
inherited |
Definition at line 75 of file AsyncJob.h.
◆ inCall
|
protectedinherited |
Definition at line 86 of file AsyncJob.h.
Referenced by AsyncJob::callEnd(), AsyncJob::callStart(), AsyncJob::canBeCalled(), AsyncJob::deleteThis(), and AsyncJob::mustStop().
◆ old_reply
char* Ftp::Client::old_reply |
Definition at line 178 of file FtpClient.h.
Referenced by ftpSendReply().
◆ old_request
char* Ftp::Client::old_request |
Definition at line 177 of file FtpClient.h.
Referenced by ftpSendReply().
◆ receivedWholeAdaptedReply
|
protectedinherited |
Definition at line 193 of file Client.h.
Referenced by Client::endAdaptedBodyConsumption(), and Client::handleAdaptedBodyProductionEnded().
◆ receivedWholeRequestBody
|
protectedinherited |
Definition at line 195 of file Client.h.
Referenced by HttpStateData::finishingChunkedRequest(), HttpStateData::getMoreRequestBody(), Client::handleRequestBodyProductionEnded(), and Client::sentRequestBody().
◆ request
|
inherited |
Definition at line 178 of file Client.h.
Referenced by Ftp::Gateway::Gateway(), HttpStateData::HttpStateData(), HttpStateData::buildRequestPrefix(), HttpStateData::checkDateSkew(), HttpStateData::continueAfterParsingHeader(), HttpStateData::decideIfWeDoRanges(), HttpStateData::drop1xx(), HttpStateData::forwardUpgrade(), ftpFail(), ftpReadType(), ftpSendPassive(), ftpSendReply(), ftpSendStor(), ftpSendType(), ftpSendUser(), ftpTrySlashHack(), HttpStateData::handle1xx(), Client::handleAdaptationBlocked(), Client::handledEarlyAdaptationAbort(), HttpStateData::handleMoreRequestBodyAvailable(), HttpStateData::haveParsedReplyHeaders(), HttpStateData::httpBuildRequestHeader(), HttpStateData::keepaliveAccounting(), Client::maybePurgeOthers(), Client::noteAdaptationAclCheckDone(), Client::originalRequest(), HttpStateData::peerSupportsConnectionPinning(), HttpStateData::persistentConnStatus(), HttpStateData::proceedAfter1xx(), HttpStateData::processReplyBody(), HttpStateData::processReplyHeader(), HttpStateData::processSurrogateControl(), HttpStateData::readReply(), HttpStateData::reusableReply(), Client::sendBodyIsTooLargeError(), HttpStateData::sendRequest(), Client::sentRequestBody(), HttpStateData::statusIfComplete(), HttpStateData::truncateVirginBody(), HttpStateData::writeReplyBody(), and HttpStateData::wroteLast().
◆ requestBodySource
|
protectedinherited |
to consume request body
Definition at line 181 of file Client.h.
Referenced by Client::~Client(), Client::doneSendingRequestBody(), Client::getMoreRequestBody(), HttpStateData::getMoreRequestBody(), HttpStateData::handleMoreRequestBodyAvailable(), Client::handleRequestBodyProducerAborted(), Client::noteBodyProducerAborted(), Client::noteBodyProductionEnded(), Client::noteMoreBodyDataAvailable(), Client::sendMoreRequestBody(), HttpStateData::sendRequest(), Client::sentRequestBody(), Client::serverComplete(), Client::startRequestBodyFlow(), and Client::swanSong().
◆ requestSender
|
protectedinherited |
set if we are expecting Comm::Write to call us back
Definition at line 182 of file Client.h.
Referenced by HttpStateData::finishingBrokenPost(), HttpStateData::finishingChunkedRequest(), Client::handleMoreRequestBodyAvailable(), Client::handleRequestBodyProducerAborted(), Client::handleRequestBodyProductionEnded(), Client::sendMoreRequestBody(), HttpStateData::sendRequest(), and Client::sentRequestBody().
◆ responseBodyBuffer
|
protectedinherited |
Data temporarily buffered for ICAP
Definition at line 173 of file Client.h.
Referenced by Client::~Client(), Client::adaptVirginReplyBody(), Client::calcBufferSpaceToReserve(), Client::noteMoreBodySpaceAvailable(), Client::replyBodySpace(), and Client::serverComplete().
◆ 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 217 of file FtpClient.h.
◆ started_
|
protectedinherited |
Definition at line 88 of file AsyncJob.h.
Referenced by AsyncJob::~AsyncJob(), AsyncJob::callEnd(), and AsyncJob::Start().
◆ startedAdaptation
|
protectedinherited |
Definition at line 190 of file Client.h.
Referenced by Client::adaptVirginReplyBody(), Client::addVirginReplyBody(), Client::markParsedVirginReplyAsWhole(), and Client::startAdaptation().
◆ state
int Ftp::Client::state |
Definition at line 176 of file FtpClient.h.
Referenced by ftpFail(), ftpReadList(), ftpReadRetr(), ftpSendCwd(), ftpSendList(), ftpSendMdtm(), ftpSendMkdir(), ftpSendNlst(), ftpSendPass(), ftpSendPassive(), ftpSendPORT(), ftpSendQuit(), ftpSendRest(), ftpSendRetr(), ftpSendSize(), ftpSendStor(), ftpSendType(), and ftpSendUser().
◆ stopReason
|
protectedinherited |
Definition at line 84 of file AsyncJob.h.
Referenced by AsyncJob::deleteThis(), AsyncJob::done(), AsyncJob::mustStop(), AsyncJob::status(), and HappyConnOpener::status().
◆ swanSang_
|
protectedinherited |
Definition at line 89 of file AsyncJob.h.
Referenced by AsyncJob::~AsyncJob(), and AsyncJob::callEnd().
◆ theFinalReply
|
privateinherited |
adapted reply from ICAP or virgin reply
Definition at line 206 of file Client.h.
Referenced by Client::~Client(), Client::finalReply(), Client::haveParsedReplyHeaders(), Client::maybePurgeOthers(), and Client::setFinalReply().
◆ theVirginReply
|
privateinherited |
reply received from the origin server
Definition at line 205 of file Client.h.
Referenced by Client::~Client(), Client::setVirginReply(), and Client::virginReply().
◆ typeName
|
protectedinherited |
Definition at line 85 of file AsyncJob.h.
Referenced by AsyncJob::AsyncJob(), Adaptation::Icap::Xaction::Xaction(), AsyncJob::~AsyncJob(), AsyncJob::callEnd(), AsyncJob::callStart(), AsyncJob::deleteThis(), and AsyncJob::mustStop().
◆ virginBodyDestination
|
protectedinherited |
to provide virgin response body
Definition at line 185 of file Client.h.
Referenced by Client::~Client(), Client::adaptVirginReplyBody(), Client::calcBufferSpaceToReserve(), Client::cleanAdaptation(), Client::doneWithAdaptation(), Client::noteBodyConsumerAborted(), Client::replyBodySpace(), Client::serverComplete2(), Client::startAdaptation(), and Client::swanSong().
The documentation for this class was generated from the following files:
- src/clients/FtpClient.h
- src/clients/FtpClient.cc