Inheritance diagram for Ftp::Gateway:
Collaboration diagram for Ftp::Gateway:

Public Types

enum  {
typedef CbcPointer< AsyncJobPointer
typedef CbcPointer< BodyProducerPointer
typedef CbcPointer< BodyConsumerPointer

Public Member Functions

 Gateway (FwdState *)
virtual ~Gateway ()
virtual void start ()
 called by AsyncStart; do not call directly More...
virtual Http::StatusCode failedHttpStatus (err_type &error)
int restartable ()
void appendSuccessHeader ()
void hackShortcut (StateMethod *nextState)
void unhack ()
void readStor ()
void parseListing ()
MemBufhtmlifyListEntry (const char *line)
void completedListing (void)
void listenForDataChannel (const Comm::ConnectionPointer &conn)
 create a data channel acceptor and start listening. More...
int checkAuth (const HttpHeader *req_hdr)
void checkUrlpath ()
void buildTitleUrl ()
void writeReplyBody (const char *, size_t len)
void printfReplyBody (const char *fmt,...)
virtual void completeForwarding ()
void processHeadResponse ()
void processReplyBody ()
void setCurrentOffset (int64_t offset)
int64_t getCurrentOffset () const
virtual void dataChannelConnected (const CommConnectCbParams &io)
virtual void timeout (const CommTimeoutCbParams &io)
 read timeout handler More...
void ftpAcceptDataConnection (const CommAcceptCbParams &io)
SBuf ftpRealm ()
void loginFailed (void)
virtual void haveParsedReplyHeaders ()
 called when we have final (possibly adapted) reply headers; kids extend More...
virtual bool haveControlChannel (const char *caller_name) const
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 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 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 HttpReplyftpAuthRequired (HttpRequest *request, SBuf &realm)
static Pointer Start (AsyncJob *job)
 starts a freshly created job (i.e., makes the job asynchronous) More...

Public Attributes

char user [MAX_URL]
char password [MAX_URL]
int password_url
char * reply_hdr
int reply_hdr_state
String clean_url
String title_url
String base_href
int conn_att
int login_att
time_t mdtm
int64_t theSize
char * filepath
char * dirpath
int64_t restart_offset
char * proxy_host
size_t list_width
String cwd_message
char * old_filepath
char typecode
MemBuf listing
 FTP directory listing in HTML format. More...
GatewayFlags flags
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

Static Public Attributes

static PF ftpDataWrite

Protected Member Functions

virtual void handleControlReply ()
virtual void dataClosed (const CommCloseCbParams &io)
 handler called by Comm when FTP data channel is closed unexpectedly More...
virtual void closeServer ()
virtual bool doneWithServer () const
virtual const
dataConnection () const
virtual void abortAll (const char *reason)
 abnormal transaction termination; reason is for debugging only More...
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)
void writeCommandCallback (const CommIoCbParams &io)
void dataRead (const CommIoCbParams &io)
void dataComplete ()
AsyncCall::Pointer dataCloser ()
 creates a data channel Comm close callback More...
void initReadBuf ()
virtual void sentRequestBody (const CommIoCbParams &io)
virtual void doneSendingRequestBody ()
bool startRequestBodyFlow ()
void handleMoreRequestBodyAvailable ()
void handleRequestBodyProductionEnded ()
void sendMoreRequestBody ()
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

virtual bool mayReadVirginReplyBody () const
 whether we may receive more virgin response body bytes More...
virtual void handleRequestBodyProducerAborted ()
void loginParser (const SBuf &login, bool escaped)

Detailed Description

FTP Gateway: An FTP client that takes an HTTP request with an ftp:// URI, converts it into one or more FTP commands, and then converts one or more FTP responses into the final HTTP response.

Definition at line 92 of file

Member Typedef Documentation

Definition at line 25 of file BodyPipe.h.

Definition at line 34 of file AsyncJob.h.

Definition at line 45 of file BodyPipe.h.

Member Enumeration Documentation

anonymous enum

Definition at line 127 of file FtpClient.h.

Constructor & Destructor Documentation

Ftp::Gateway::~Gateway ( )

Member Function Documentation

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

Implements Client.

Definition at line 1020 of file

References data, debugs, and NULL.

bool Client::abortOnData ( const char *  reason)

abnormal data transfer termination

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

Reimplemented in Ftp::Relay.

Definition at line 288 of file

References Client::abortAll().

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

void Client::adaptVirginReplyBody ( const char *  buf,
ssize_t  len 
void Client::adjustBodyBytesRead ( const int64_t  delta)
void Adaptation::Initiator::announceInitiatorAbort ( CbcPointer< Initiate > &  x)

Definition at line 38 of file

References CallJobHere.

Referenced by Client::cleanAdaptation(), and ClientHttpRequest::~ClientHttpRequest().

void Ftp::Gateway::buildTitleUrl ( )
size_t Client::calcBufferSpaceToReserve ( const size_t  space,
const size_t  wantSpace 
) const
void AsyncJob::callEnd ( )
void AsyncJob::callStart ( AsyncCall call)
bool AsyncJob::canBeCalled ( AsyncCall call) const

Definition at line 101 of file

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

Ftp::Gateway::CBDATA_CLASS ( Gateway  )
int Ftp::Gateway::checkAuth ( const HttpHeader req_hdr)

Locates the FTP user:password login.

Highest to lowest priority:

  • Checks URL (ftp://user:pass@domain)
  • Authorization: Basic header
  • squid.conf anonymous-FTP settings (default: anonymous:Squid@).

Special Case: A username-only may be provided in the URL and password in the HTTP headers.

TODO: we might be able to do something about locating username from other sources: ie, external ACL user=* tag or ident lookup

Return values
1if we have everything needed to complete this request.
0if something is missing.

Definition at line 1054 of file

References SquidConfig::anon_user, Http::AUTHORIZATION, Config, fatal(), SquidConfig::Ftp, HttpHeader::getAuth(), MAX_URL, null_string, request(), _request::url, and xstrncpy().

void Ftp::Gateway::checkUrlpath ( )

Definition at line 1098 of file

References SBuf::length(), SBuf::npos, request(), _request::url, and xtoupper.

void Adaptation::Initiator::clearAdaptation ( CbcPointer< Initiate > &  x)
void Ftp::Client::closeServer ( )

Close the FTP server connection(s). Used by serverComplete().

Implements Client.

Definition at line 217 of file

References data, debugs, and Comm::IsConnOpen().

void Ftp::Gateway::completedListing ( void  )

Generate the HTTP headers and template fluff around an FTP directory listing display.

Definition at line 2282 of file

References assert, EBIT_CLR, ENTRY_FWD_HDR_WAIT, ERR_DIR_LISTING, ErrorState::ftp, ErrorState::listing, NULL, request(), Http::scOkay, and xstrdup.

Referenced by ftpReadTransferDone().

void Ftp::Gateway::completeForwarding ( )

A hack to ensure we do not double-complete on the forward entry.

Ftp::Gateway logic should probably be rewritten to avoid double-completion or FwdState should be rewritten to allow it.

Reimplemented from Client.

Definition at line 2715 of file

References Client::completeForwarding(), data, debugs, and NULL.

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

Definition at line 862 of file

References debugs.

Referenced by Ftp::Client::Client().

void Ftp::Gateway::dataChannelConnected ( const CommConnectCbParams io)
void Ftp::Gateway::dataClosed ( const CommCloseCbParams io)

Reimplemented from Ftp::Client.

Definition at line 318 of file

References Ftp::Client::dataClosed(), ERR_FTP_FAILURE, and Ftp::Client::failed().

AsyncCall::Pointer Ftp::Client::dataCloser ( )

Definition at line 786 of file

References Ftp::Client::dataClosed(), and JobCallback.

void Client::dataComplete ( )

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

Definition at line 991 of file

References data, and debugs.

Referenced by Ftp::Relay::abort().

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

Implements Client.

Definition at line 883 of file

References data.

void AsyncJob::deleteThis ( const char *  aReason)
bool AsyncJob::done ( ) const

Definition at line 90 of file

References AsyncJob::doneAll(), NULL, and AsyncJob::stopReason.

Referenced by AsyncJob::callEnd(), and Downloader::downloadFinished().

bool Client::doneAll ( ) const

Reimplemented from AsyncJob.

Definition at line 194 of file

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

void Ftp::Client::doneSendingRequestBody ( )

called after we wrote the last byte of the request body

Implements Client.

Definition at line 1054 of file

References debugs, and Client::doneSendingRequestBody().

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

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

References data, and Comm::IsConnOpen().

void Client::endAdaptedBodyConsumption ( )
void Client::failed ( err_type  error = ERR_NONE,
int  xerrno = 0,
ErrorState ftperr = nullptr 
Http::StatusCode Ftp::Gateway::failedHttpStatus ( err_type error)
HttpReply * Client::finalReply ( )

Definition at line 129 of file

References assert, and Client::theFinalReply.

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

void Ftp::Gateway::ftpAcceptDataConnection ( const CommAcceptCbParams io)

"read" handler to accept FTP data connections.

iocomm accept(2) callback parameters
Need to send error message on control channel
When squid.conf ftp_sanitycheck is enabled, check the new connection is actually being made by the remote client which is connected to the FTP control socket. Or the one which we were told to listen for by control channel messages (may differ under NAT). This prevents third-party hacks, but also third-party load balancing handshakes.

On Comm::OK start using the accepted data socket and discard the temporary listen socket.

Definition at line 1943 of file

References assert, Comm::Connection::close(), Config, CommCommonCbParams::conn, data, DBG_IMPORTANT, debugs, EBIT_TEST, ENTRY_ABORTED, fd_table, CommCommonCbParams::flag, SquidConfig::Ftp, ftpFail, HERE(), Comm::IsConnOpen(), NULL, Comm::OK, Comm::Connection::remote, SquidConfig::sanitycheck, CommCommonCbParams::xerrno, and xstrerr().

Referenced by listenForDataChannel().

HttpReply * Ftp::Gateway::ftpAuthRequired ( HttpRequest request,
SBuf realm 
SBuf Ftp::Gateway::ftpRealm ( )

Definition at line 1285 of file

References SBuf::append(), SBuf::appendf(), request(), and _request::url.

int64_t Ftp::Gateway::getCurrentOffset ( ) const

Definition at line 149 of file

References Client::currentOffset.

bool Client::getMoreRequestBody ( MemBuf buf)
void Ftp::Gateway::hackShortcut ( StateMethod nextState)

Definition at line 2404 of file

References debugs, HERE(), NULL, and xstrdup.

Referenced by ftpFail(), and ftpReadRetr().

void Client::handleAdaptationAborted ( bool  bypassable = false)
void Client::handleAdaptedBodyProductionEnded ( )
void Ftp::Gateway::handleControlReply ( )

Reimplemented from Ftp::Client.

Definition at line 1190 of file

References FTP_SM_FUNCS, Ftp::Client::handleControlReply(), wordlist::next, and NULL.

bool Client::handledEarlyAdaptationAbort ( )
bool Client::handleEpsvReply ( Ip::Address remoteAddr)
void Client::handleMoreRequestBodyAvailable ( )
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 439 of file

References buf, code, Config, data, DBG_IMPORTANT, debugs, fd_table, SquidConfig::Ftp, Comm::IsConnOpen(), NULL, Ftp::ParseIpPort(), and SquidConfig::sanitycheck.

Referenced by ftpReadPasv().

void Ftp::Gateway::handleRequestBodyProducerAborted ( )

Implements Client.

Definition at line 2320 of file

References debugs, ERR_READ_ERROR, Client::handleRequestBodyProducerAborted(), and HERE().

void Client::handleRequestBodyProductionEnded ( )
bool Ftp::Gateway::haveControlChannel ( const char *  caller_name) const

Have we lost the FTP server control channel?

Return values
trueThe server control channel is available.
falseThe server control channel is not available.

Definition at line 2735 of file

References DBG_IMPORTANT, debugs, and Comm::IsConnOpen().

Referenced by ftpSendCwd(), ftpSendList(), ftpSendMdtm(), ftpSendMkdir(), ftpSendNlst(), ftpSendPass(), ftpSendPassive(), ftpSendPORT(), ftpSendQuit(), ftpSendRest(), ftpSendRetr(), ftpSendSize(), ftpSendStor(), ftpSendType(), and ftpSendUser().

void Ftp::Gateway::haveParsedReplyHeaders ( )

called when got final headers

Reimplemented from Client.

Definition at line 2635 of file

References Client::haveParsedReplyHeaders(), StoreEntry::makePublic(), StoreEntry::release(), and StoreEntry::timestampsSet().

CbcPointer< Adaptation::Initiate > Adaptation::Initiator::initiateAdaptation ( Initiate x)
bool Adaptation::Initiator::initiated ( const CbcPointer< AsyncJob > &  job) const

Definition at line 52 of file Initiator.h.

References CbcPointer< Cbc >::set().

Referenced by Client::startAdaptation(), and ClientHttpRequest::startAdaptation().

void Client::initReadBuf ( )

Definition at line 205 of file

References data, and NULL.

Referenced by Gateway().

void Ftp::Gateway::loginFailed ( void  )

Translate FTP login failure into HTTP error this is an attmpt to get the 407 message to show up outside Squid. its NOT a general failure. But a correct FTP response type.

Definition at line 1241 of file

References ErrorState::BuildHttpReply(), SBuf::c_str(), ERR_FTP_FORBIDDEN, ERR_FTP_UNAVAILABLE, ERR_NONE, ftpFail, Http::Message::header, NULL, HttpHeader::putAuth(), Http::scForbidden, Http::scServiceUnavailable, and Http::scUnauthorized.

Referenced by ftpReadPass(), and ftpReadUser().

void Ftp::Gateway::loginParser ( const SBuf login,
bool  escaped 

Parse a possible login username:password pair. Produces filled member variables user, password, password_url if anything found.

logina decoded Basic authentication credential token or URI user-info token
escapedwhether to URL-decode the token after extracting user and password

Definition at line 399 of file

References SBuf::copy(), debugs, SBuf::find(), SBuf::isEmpty(), SBuf::length(), SBuf::npos, rfc1738_unescape(), and SBuf::substr().

void Client::maybeReadVirginBody ( )
bool Ftp::Gateway::mayReadVirginReplyBody ( ) const

Implements Client.

Definition at line 2751 of file

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

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 906 of file

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

void Client::noteAdaptationAnswer ( const Adaptation::Answer answer)
void Client::noteBodyConsumerAborted ( BodyPipe::Pointer  )
void Client::noteBodyProducerAborted ( BodyPipe::Pointer  bp)
void Client::noteBodyProductionEnded ( BodyPipe::Pointer  bp)
void Client::noteMoreBodyDataAvailable ( BodyPipe::Pointer  bp)
void Client::noteMoreBodySpaceAvailable ( BodyPipe::Pointer  )
bool Client::openListenSocket ( )

Definition at line 779 of file

void Ftp::Gateway::parseListing ( )
void Ftp::Gateway::printfReplyBody ( const char *  fmt,

Definition at line 2686 of file

void Ftp::Gateway::processHeadResponse ( )

Definition at line 1705 of file

References debugs, EBIT_TEST, ENTRY_ABORTED, ftpSendQuit, and HERE().

Referenced by ftpSendPassive().

void Ftp::Gateway::processReplyBody ( )

Implements Client.

Definition at line 987 of file

References data, debugs, EBIT_TEST, ENTRY_ABORTED, HERE(), _request::method, Http::METHOD_HEAD, and request().

void Ftp::Gateway::readStor ( )

Definition at line 2074 of file

References code, data, DBG_IMPORTANT, debugs, ftpFail, HERE(), and Comm::IsConnOpen().

Referenced by ftpReadStor().

size_t Client::replyBodySpace ( const MemBuf readBuf,
const size_t  minSpace 
) const
int Ftp::Gateway::restartable ( )

Definition at line 2124 of file

References request().

Referenced by ftpRestOrList().

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

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 309 of file

References comm_read(), commSetConnTimeout(), commUnsetConnTimeout(), Config, SquidConfig::connect, data, debugs, Comm::IsConnOpen(), JobCallback, min(), SquidConfig::read, Ftp::Client::readControlReply(), Ftp::Client::timeout(), and SquidConfig::Timeout.

Referenced by Ftp::Relay::scheduleReadControlReply().

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

References SquidConfig::accessList, allow_t::allowed(), Packable::appendf(), Config, MemBuf::content(), Ftp::crlf, data, DBG_IMPORTANT, debugs, SquidConfig::epsv_all, ERR_FTP_FAILURE, ACLChecklist::fastCheck(), SquidConfig::Ftp, SquidConfig::ftp_epsv, NULL, SquidConfig::passive, MemBuf::reset(), and wordlistDestroy().

Referenced by ftpSendPassive().

bool Client::sendPort ( )

Definition at line 630 of file


void Client::sentRequestBody ( const CommIoCbParams io)
void Ftp::Gateway::setCurrentOffset ( int64_t  offset)

Definition at line 148 of file

References Client::currentOffset.

Referenced by ftpReadRest().

HttpReply * Client::setVirginReply ( HttpReply r)

Definition at line 118 of file

References assert, debugs, HERE(), HTTPMSGLOCK(), and Client::theVirginReply.

Referenced by HttpStateData::processReplyHeader().

void Ftp::Gateway::start ( )

Reimplemented from Ftp::Client.

Definition at line 1168 of file

References debugs, request(), Ftp::Client::start(), and _request::url.

bool Client::startRequestBodyFlow ( )
void BodyProducer::stopProducingFor ( RefCount< BodyPipe > &  p,
bool  atEof 
void Client::storeReplyBody ( const char *  buf,
ssize_t  len 

Definition at line 994 of file

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

Referenced by Client::addVirginReplyBody().

void Ftp::Client::switchTimeoutToDataChannel ( )

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

Definition at line 1032 of file

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

Referenced by ftpReadList(), and ftpReadRetr().

void Ftp::Gateway::timeout ( const CommTimeoutCbParams io)

Reimplemented from Ftp::Client.

Definition at line 482 of file

References data, DBG_IMPORTANT, debugs, NULL, and Ftp::Client::timeout().

virtual void* CbdataParent::toCbdata ( )
pure virtualinherited
void Ftp::Gateway::unhack ( )

Forget hack status. Next error is shown to the user

Definition at line 2393 of file

References debugs, HERE(), NULL, and safe_free.

Referenced by ftpReadCwd(), ftpReadMdtm(), and ftpReadSize().

HttpReply * Client::virginReply ( )

Definition at line 104 of file

References assert, and Client::theVirginReply.

void Ftp::Gateway::writeReplyBody ( const char *  dataToWrite,
size_t  dataLength 

Call this when there is data from the origin server which should be sent to either StoreEntry, or to ICAP...

Definition at line 2702 of file

References debugs, and HERE().

Member Data Documentation

CbcPointer<Adaptation::Initiate> Client::adaptedHeadSource

to get adapted response headers

Definition at line 174 of file Client.h.

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

String Ftp::Gateway::base_href

Definition at line 106 of file

String Ftp::Gateway::clean_url

Definition at line 104 of file

int Ftp::Gateway::conn_att

Definition at line 107 of file

int64_t Client::currentOffset = 0
String Ftp::Gateway::cwd_message

Definition at line 117 of file

Referenced by ftpReadCwd().

DataChannel Ftp::Client::data
char* Ftp::Gateway::dirpath

Definition at line 113 of file

Referenced by ftpTraverseDirectory().

const char* Client::doneWithFwd = nullptr

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(), HttpStateData::httpStateConnClosed(), and Client::swanSong().

enum { ... } Ftp::Client::ftp_state_t
PF Ftp::Gateway::ftpDataWrite

Definition at line 152 of file

const InstanceId<AsyncJob> AsyncJob::id

Definition at line 72 of file AsyncJob.h.

AsyncCall::Pointer AsyncJob::inCall
size_t Ftp::Gateway::list_width

Definition at line 116 of file

MemBuf Ftp::Gateway::listing

Definition at line 120 of file

int Ftp::Gateway::login_att

Definition at line 108 of file

Referenced by ftpReadWelcome().

time_t Ftp::Gateway::mdtm

Definition at line 109 of file

Referenced by ftpFail(), ftpReadMdtm(), and ftpSendReply().

char* Ftp::Gateway::old_filepath

Definition at line 118 of file

char* Ftp::Client::old_reply

Definition at line 160 of file FtpClient.h.

Referenced by ftpSendReply().

char* Ftp::Client::old_request

Definition at line 159 of file FtpClient.h.

Referenced by ftpSendReply().

char Ftp::Gateway::password[MAX_URL]

Definition at line 100 of file

Referenced by ftpSendPass(), and Gateway().

int Ftp::Gateway::password_url

Definition at line 101 of file

wordlist* Ftp::Gateway::pathcomps

Definition at line 111 of file

Referenced by ftpReadType(), ftpTraverseDirectory(), and ftpTrySlashHack().

char* Ftp::Gateway::proxy_host

Definition at line 115 of file

Referenced by ftpSendUser().

bool Client::receivedWholeRequestBody = false
char* Ftp::Gateway::reply_hdr

Definition at line 102 of file

int Ftp::Gateway::reply_hdr_state

Definition at line 103 of file

MemBuf* Client::responseBodyBuffer = nullptr
int64_t Ftp::Gateway::restart_offset

Definition at line 114 of file

Referenced by ftpReadRest(), and ftpSendRest().

bool Client::startedAdaptation = false
const char* AsyncJob::stopReason
int64_t Ftp::Gateway::theSize

Definition at line 110 of file

Referenced by ftpFail(), ftpReadSize(), and ftpSendPassive().

String Ftp::Gateway::title_url

Definition at line 105 of file

Referenced by ftpListDir(), and ftpReadSize().

char Ftp::Gateway::typecode

Definition at line 119 of file

Referenced by ftpRestOrList(), and ftpSendType().

char Ftp::Gateway::user[MAX_URL]

Definition at line 99 of file

Referenced by ftpSendUser(), and Gateway().

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






Web Site Translations