Go to the documentation of this file.
125 virtual void start();
190 #define CTRL_BUFLEN 16*1024
364 debugs(9, 3, entry->url());
368 "control channel " << ctrl.conn);
397 debugs(9, 4,
"login=" << login <<
", escaped=" << escaped);
398 debugs(9, 9,
"IN : login=" << login <<
", escaped=" << escaped <<
", user=" << user <<
", password=" << password);
409 const SBuf userName = login.
substr(0, colonPos);
412 debugs(9, 9,
"found user=" << userName <<
' ' <<
413 (upto != userName.
length() ?
", truncated-to=" :
", length=") << upto <<
414 ", escaped=" << escaped);
417 debugs(9, 9,
"found user=" << user <<
" (" << strlen(user) <<
") unescaped.");
427 debugs(9, 9,
"found password=" << pass <<
" " <<
428 (upto != pass.
length() ?
", truncated-to=" :
", length=") << upto <<
429 ", escaped=" << escaped);
434 debugs(9, 9,
"found password=" << password <<
" (" << strlen(password) <<
") unescaped.");
437 debugs(9, 9,
"OUT: login=" << login <<
", escaped=" << escaped <<
", user=" << user <<
", password=" << password);
444 debugs(9, 5,
"The control connection to the remote end is closed");
454 const char *note = entry->url();
463 debugs(9, 3,
"Unconnected data socket created on " <<
conn);
466 conn->tos = ctrl.conn->tos;
467 conn->nfmark = ctrl.conn->nfmark;
473 data.opened(
conn, dataCloser());
474 switchTimeoutToDataChannel();
480 if (SENT_PASV == state) {
482 flags.pasv_supported =
false;
486 dataConnWait.cancel(
"timeout");
495 "Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
496 "Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
504 for (i = 0; i < 12; ++i)
505 if (!strcasecmp(buf,
Month[i]))
521 #define MAX_TOKENS 64
528 struct FtpLineToken {
529 char *token =
nullptr;
534 static char tbuf[128];
536 static int scan_ftp_initialized = 0;
537 static regex_t scan_ftp_integer;
539 static regex_t scan_ftp_dostime;
540 static regex_t scan_ftp_dosdate;
542 if (!scan_ftp_initialized) {
543 scan_ftp_initialized = 1;
571 tokens[n_tokens].pos = t - xbuf;
578 for (i = 3; i < n_tokens - 2; ++i) {
590 if (
regexec(&scan_ftp_integer, day, 0,
NULL, 0) != 0)
593 if (
regexec(&scan_ftp_time, year, 0,
NULL, 0) != 0)
596 const auto *copyFrom = buf +
tokens[i].pos;
599 auto dateSize = snprintf(tbuf,
sizeof(tbuf),
"%s %2s %5s", month, day, year);
600 bool isTypeA = (dateSize == 12) && (strncmp(copyFrom, tbuf, dateSize) == 0);
603 dateSize = snprintf(tbuf,
sizeof(tbuf),
"%s %2s %-5s", month, day, year);
604 bool isTypeB = (dateSize == 12 || dateSize == 11) && (strncmp(copyFrom, tbuf, dateSize) == 0);
607 if (isTypeA || isTypeB) {
610 const auto finalDateSize = snprintf(tbuf,
sizeof(tbuf),
"%s %2s %5s", month, day, year);
611 assert(finalDateSize >= 0);
615 copyFrom = buf +
tokens[i + 2].pos + strlen(
tokens[i + 2].token);
617 while (strchr(
w_space, *copyFrom))
628 if (strchr(
w_space, *copyFrom))
634 if (p->
type ==
'l' && (t = strstr(p->
name,
" -> "))) {
649 if (!strcasecmp(
tokens[2].token,
"<dir>")) {
656 snprintf(tbuf,
sizeof(tbuf),
"%s %s",
tokens[0].token,
tokens[1].token);
659 if (p->
type ==
'd') {
676 const char *ct = buf + 1;
681 int l = strcspn(ct,
",");
694 p->
size = atoi(ct + 1);
698 tm = (time_t) strtol(ct + 1, &tmp, 0);
705 *(strstr(p->
date,
"\n")) =
'\0';
727 ct = strstr(ct,
",");
746 for (i = 0; i < n_tokens; ++i)
758 debugs(9, 7,
"line={" << line <<
"}");
760 if (strlen(line) > 1024) {
761 html <<
"<tr><td colspan=\"5\">" << line <<
"</td></tr>\n";
766 if (flags.dir_slash && dirpath && typecode !=
'D') {
773 html <<
"<tr class=\"entry\"><td colspan=\"5\">" << line <<
"</td></tr>\n";
776 for (p = line; *p &&
xisspace(*p); ++p);
778 flags.listformat_unknown = 1;
783 if (!strcmp(parts->
name,
".") || !strcmp(parts->
name,
"..")) {
799 switch (parts->
type) {
802 icon.
appendf(
"<img border=\"0\" src=\"%s\" alt=\"%-6s\">",
809 icon.
appendf(
"<img border=\"0\" src=\"%s\" alt=\"%-6s\">",
824 icon.
appendf(
"<img border=\"0\" src=\"%s\" alt=\"%-6s\">",
827 chdir.
appendf(
"<a href=\"%s/;type=d\"><img border=\"0\" src=\"%s\" "
828 "alt=\"[DIR]\"></a>",
836 icon.
appendf(
"<img border=\"0\" src=\"%s\" alt=\"%-6s\">",
844 if (parts->
type !=
'd') {
847 "alt=\"[VIEW]\"></a>",
853 "alt=\"[DOWNLOAD]\"></a>",
859 html <<
"<tr class=\"entry\">"
860 "<td class=\"icon\"><a href=\"" << href <<
"\">" << icon <<
"</a></td>"
861 "<td class=\"filename\"><a href=\"" << href <<
"\">" <<
html_quote(
text.c_str()) <<
"</a></td>"
862 "<td class=\"date\">" << parts->
date <<
"</td>"
863 "<td class=\"size\">" <<
size <<
"</td>"
864 "<td class=\"actions\">" << chdir << view << download << link <<
"</td>"
874 char *buf = data.readBuf->content();
881 size_t len = data.readBuf->contentSize();
884 debugs(9, 3,
"no content to parse for " << entry->url() );
891 sbuf = (
char *)
xmalloc(len + 1);
893 end = sbuf + len - 1;
895 while (*end !=
'\r' && *end !=
'\n' && end > sbuf)
900 debugs(9, 3,
"usable = " << usable <<
" of " << len <<
" bytes.");
903 if (buf[0] ==
'\0' && len == 1) {
904 debugs(9, 3,
"NIL ends data from " << entry->url() <<
" transfer problem?");
905 data.readBuf->consume(len);
907 debugs(9, 3,
"didn't find end for " << entry->url());
914 debugs(9, 3, (
unsigned long int)len <<
" bytes to play with");
919 s += strspn(s,
crlf);
921 for (; s < end; s += strcspn(s,
crlf), s += strspn(s,
crlf)) {
922 debugs(9, 7,
"s = {" << s <<
"}");
923 linelen = strcspn(s,
crlf) + 1;
933 debugs(9, 7,
"{" << line <<
"}");
935 if (!strncmp(line,
"total", 5))
942 if (htmlifyListEntry(line, html)) {
950 data.readBuf->consume(usable);
966 if (!flags.http_header_sent && data.readBuf->contentSize() >= 0 && !flags.isdir)
967 appendSuccessHeader();
974 abortAll(
"entry aborted after calling appendSuccessHeader()");
980 if (adaptationAccessCheckPending) {
981 debugs(9, 3,
"returning from Ftp::Gateway::processReplyBody due to adaptationAccessCheckPending");
988 if (!flags.listing) {
993 maybeReadVirginBody();
995 }
else if (
const int csize = data.readBuf->contentSize()) {
996 writeReplyBody(data.readBuf->content(), csize);
997 debugs(9, 5,
"consuming " << csize <<
" bytes of readBuf");
998 data.readBuf->consume(csize);
1003 maybeReadVirginBody();
1028 #if HAVE_AUTH_MODULE_BASIC
1031 if (!auth.isEmpty()) {
1032 flags.authenticated = 1;
1033 loginParser(auth,
false);
1045 fatal(
"FTP login parsing destroyed username info");
1054 if (strcmp(user,
"anonymous") == 0 && !flags.tried_auth_anonymous) {
1056 flags.tried_auth_anonymous=1;
1058 }
else if (!flags.tried_auth_nopass) {
1060 flags.tried_auth_nopass=1;
1074 static const SBuf middle(
";type=");
1075 const auto typeSpecStart =
request->
url.path().find(middle);
1078 const auto typecodePos = typeSpecStart + middle.
length();
1079 typecode = (typecodePos < fullPath.length()) ?
1080 static_cast<char>(
xtoupper(fullPath[typecodePos])) :
'\0';
1081 request->
url.path(fullPath.substr(0, typeSpecStart));
1090 flags.need_base_href = 1;
1091 }
else if (!
request->
url.path().cmp(
"/%2f/")) {
1095 }
else if ((l >= 1) && (
request->
url.path()[l-1] ==
'/')) {
1102 flags.dir_slash = 1;
1109 title_url =
"ftp://";
1111 if (strcmp(user,
"anonymous")) {
1112 title_url.append(user);
1113 title_url.append(
"@");
1121 base_href =
"ftp://";
1123 if (strcmp(user,
"anonymous") != 0) {
1127 base_href.append(
":");
1131 base_href.append(
"@");
1136 base_href.append(
"/");
1142 if (!checkAuth(&
request->header)) {
1144 SBuf realm(ftpRealm());
1145 const auto reply = ftpAuthRequired(
request.getRaw(), realm, fwd->al);
1146 entry->replaceHttpReply(reply);
1153 debugs(9, 5,
"FD " << (ctrl.conn ? ctrl.conn->fd : -1) <<
" : host=" <<
request->
url.host() <<
1154 ", path=" <<
request->
url.path() <<
", user=" << user <<
", passwd=" << password);
1165 if (ctrl.message ==
NULL)
1172 cwd_message.append(
'\n');
1173 cwd_message.append(w->key);
1197 }
else if (
code == 120) {
1217 if ((state == SENT_USER || state == SENT_PASS) && ctrl.replycode >= 400) {
1218 if (ctrl.replycode == 421 || ctrl.replycode == 426) {
1221 }
else if (ctrl.replycode >= 430 && ctrl.replycode <= 439) {
1224 }
else if (ctrl.replycode >= 530 && ctrl.replycode <= 539) {
1238 failed(
ERR_NONE, ctrl.replycode, err);
1244 #if HAVE_AUTH_MODULE_BASIC
1247 SBuf realm(ftpRealm());
1252 entry->replaceHttpReply(newrep);
1262 realm.
appendf(
"FTP %s ", user);
1264 realm.
append(
"unknown", 7);
1298 }
else if (
code == 331) {
1395 p += strcspn(p,
"/");
1431 debugs(9, 3,
"the final component was a directory");
1443 debugs(9, 3,
"final component is probably a file");
1462 if (!strcmp(path,
"..") || !strcmp(path,
"/")) {
1515 debugs(9, 3,
"with path=" << path);
1527 debugs(9, 3,
"path " << path <<
", code " <<
code);
1531 }
else if (
code == 550) {
1554 debugs(9, 3,
"Directory path did not end in /");
1584 }
else if (
code < 0) {
1624 debugs(9, 2,
"SIZE reported " <<
1629 }
else if (
code < 0) {
1679 debugs(9, 5,
"handling HEAD response");
1681 appendSuccessHeader();
1689 abortAll(
"entry aborted while processing HEAD");
1694 if (adaptationAccessCheckPending) {
1695 debugs(9,3,
"returning due to adaptationAccessCheckPending");
1722 dataConnWait.finish();
1725 debugs(9, 2,
"Failed to connect. Retrying via another method.");
1729 writeCommand(
"ABOR\r\n");
1736 data.opened(io.
conn, dataCloser());
1754 debugs(9, 5,
"The control connection to the remote end is closed");
1772 if (setsockopt(ftpState->
ctrl.
conn->
fd, SOL_SOCKET, SO_REUSEADDR,
1773 (
char *) &on,
sizeof(on)) == -1) {
1782 temp->local.port(0);
1796 debugs(9,
DBG_IMPORTANT,
"FTP does not allow PORT method after 'EPSV ALL' has been sent.");
1823 unsigned char *addrptr = (
unsigned char *) &((
struct sockaddr_in*)AI->
ai_addr)->sin_addr;
1824 unsigned char *portptr = (
unsigned char *) &((
struct sockaddr_in*)AI->
ai_addr)->sin_port;
1826 addrptr[0], addrptr[1], addrptr[2], addrptr[3],
1827 portptr[0], portptr[1]);
1842 debugs(9, 3,
"PORT not supported by remote end");
1857 debugs(9, 3,
"EPRT not supported by remote end");
1875 debugs(9, 5,
"The control connection to the remote end is closed");
1880 data.listenConn->close();
1881 data.listenConn =
NULL;
1889 abortAll(
"entry aborted when accepting data conn");
1890 data.listenConn->close();
1891 data.listenConn =
NULL;
1898 data.listenConn =
NULL;
1918 "ERROR: FTP data connection from unexpected server (" <<
1920 data.conn->remote <<
" or " << ctrl.conn->remote);
1932 data.opened(io.
conn, dataCloser());
1935 debugs(9, 3,
"Connected data socket on " <<
1936 io.
conn <<
". FD table says: " <<
1937 "ctrl-peer= " <<
fd_table[ctrl.conn->fd].ipaddr <<
", " <<
1938 "data-peer= " <<
fd_table[data.conn->fd].ipaddr);
1940 assert(haveControlChannel(
"ftpAcceptDataConnection"));
2003 int code = ctrl.replycode;
2007 if (!originalRequest()->body_pipe) {
2008 debugs(9, 3,
"zero-size STOR?");
2009 state = WRITING_DATA;
2014 if (!startRequestBodyFlow()) {
2020 debugs(9, 3,
"starting data transfer");
2021 switchTimeoutToDataChannel();
2022 sendMoreRequestBody();
2023 fwd->dontRetry(
true);
2024 state = WRITING_DATA;
2025 debugs(9, 3,
"writing data channel");
2026 }
else if (
code == 150) {
2028 debugs(9, 3,
"ftpReadStor: accepting data channel");
2029 listenForDataChannel(data.conn);
2053 if (restart_offset > 0)
2065 int64_t desired_offset =
request->range->lowestOffset(theSize);
2067 if (desired_offset <= 0)
2070 if (desired_offset >= theSize)
2073 restart_offset = desired_offset;
2087 }
else if (
code > 0) {
2088 debugs(9, 3,
"REST not supported");
2149 }
else if (
code == 150) {
2189 }
else if (
code == 150) {
2192 }
else if (
code >= 300) {
2212 entry->lock(
"Ftp::Gateway");
2217 ctrl.message =
NULL;
2220 entry->unlock(
"Ftp::Gateway");
2250 debugs(9, 3,
"ftpState=" <<
this);
2260 if (!(
code == 226 ||
code == 250)) {
2324 if (old_request !=
NULL) {
2334 setCurrentOffset(0);
2340 if (old_request ==
NULL) {
2341 old_request = ctrl.last_command;
2342 ctrl.last_command =
NULL;
2343 old_reply = ctrl.last_reply;
2344 ctrl.last_reply =
NULL;
2346 if (pathcomps ==
NULL && filepath !=
NULL)
2347 old_filepath =
xstrdup(filepath);
2357 const bool slashHack = ftpState->
request->
url.
path().caseCmp(
"/%2f", 4)==0;
2362 " reply code " <<
code <<
"flags(" <<
2365 "mdtm=" << ftpState->
mdtm <<
", size=" << ftpState->
theSize <<
2366 "slashhack=" << (slashHack?
"T":
"F"));
2373 switch (ftpState->
state) {
2389 ftpState->
failed(error_code, 0, ftperr);
2391 HttpReply *newrep = ftperr->BuildHttpReply();
2408 if (ctrl.replycode > 500) {
2411 }
else if (ctrl.replycode == 421) {
2420 if (ctrl.replycode == 550) {
2443 debugs(9, 5,
"ftpState (" << ftpState <<
") is valid!");
2448 }
else if (
code == 227) {
2482 if (flags.http_header_sent)
2487 flags.http_header_sent = 1;
2489 assert(entry->isEmpty());
2494 auto t = urlPath.
rfind(
'/');
2497 const char *mime_type =
NULL;
2498 const char *mime_enc =
NULL;
2501 mime_type =
"text/html";
2506 mime_type =
"application/octet-stream";
2512 mime_type =
"text/plain";
2525 if (0 == getCurrentOffset()) {
2528 }
else if (theSize < getCurrentOffset()) {
2536 " current offset=" << getCurrentOffset() <<
2537 ", but theSize=" << theSize <<
2538 ". assuming full content response");
2543 range_spec.
offset = getCurrentOffset();
2544 range_spec.
length = theSize - getCurrentOffset();
2554 setVirginReply(reply);
2555 adaptOrFinalizeReply();
2568 if (flags.authenticated ||
2569 getCurrentOffset() ||
2580 #if HAVE_AUTH_MODULE_BASIC
2603 }
else if (!
request->
url.path().startsWith(newbuf)) {
2608 return request->effectiveRequestUri();
2615 va_start (args, fmt);
2616 static char buf[4096];
2618 vsnprintf(buf, 4096, fmt, args);
2619 writeReplyBody(buf, strlen(buf));
2630 debugs(9, 5,
"writing " << dataLength <<
" bytes to the reply");
2631 addVirginReplyBody(dataToWrite, dataLength);
2643 if (fwd ==
NULL || flags.completed_forwarding) {
2644 debugs(9, 3,
"avoid double-complete on FD " <<
2645 (ctrl.conn ? ctrl.conn->fd : -1) <<
", Data FD " << data.conn->fd <<
2646 ", this " <<
this <<
", fwd " << fwd);
2650 flags.completed_forwarding =
true;
2663 if (doneWithServer())
2668 debugs(9,
DBG_IMPORTANT,
"WARNING: FTP Server Control channel is closed, but Data channel still active.");
2669 debugs(9, 2, caller_name <<
": attempted on a closed FTP channel.");
2680 return !doneWithServer();
virtual bool mayReadVirginReplyBody() const
whether we may receive more virgin response body bytes
static void ftpTrySlashHack(Ftp::Gateway *ftpState)
void fatal(const char *message)
const char * xstrerr(int error)
void * xcalloc(size_t n, size_t sz)
size_type find(char c, size_type startPos=0) const
void wordlistDestroy(wordlist **list)
destroy a wordlist
AnyP::Uri url
the request URI
bool makePublic(const KeyScope keyScope=ksDefault)
static FTPSM ftpReadTransferDone
void connectDataChannel()
void writeCommand(const char *buf)
bool pasv_supported
PASV command is allowed.
virtual void timeout(const CommTimeoutCbParams &io)
read timeout handler
static void ftpOpenListenSocket(Ftp::Gateway *ftpState, int fallback)
HttpReply * BuildHttpReply(void)
virtual void handleRequestBodyProducerAborted()=0
void error(char *format,...)
AccessLogEntryPointer al
info for the future access.log entry
@ ERR_CACHE_ACCESS_DENIED
bool tried_auth_nopass
auth tried username with no password already.
struct ErrorState::@59 ftp
void init(mb_size_t szInit, mb_size_t szMax)
static HttpReply * ftpAuthRequired(HttpRequest *request, SBuf &realm, AccessLogEntry::Pointer &)
bool htmlifyListEntry(const char *line, PackableStream &)
void SBufToCstring(char *d, const SBuf &s)
char * html_quote(const char *)
int checkAuth(const HttpHeader *req_hdr)
static void FreeAddr(struct addrinfo *&ai)
void loginParser(const SBuf &login, bool escaped)
char * xstrncpy(char *dst, const char *src, size_t n)
void detailError(const ErrorDetail::Pointer &dCode)
set error type-specific detail code
int cbdataReferenceValid(const void *p)
bool IsConnOpen(const Comm::ConnectionPointer &conn)
#define rfc1738_escape(x)
virtual void failed(err_type error=ERR_NONE, int xerrno=0, ErrorState *ftperr=nullptr)
handle a fatal transaction error, closing the control connection
void replaceHttpReply(const HttpReplyPointer &, const bool andStartWriting=true)
void * memAllocate(mem_type)
Allocate one element from the typed pool.
static FTPSM ftpSendMkdir
static FTPSM ftpRestOrList
virtual void haveParsedReplyHeaders()
called when we have final (possibly adapted) reply headers; kids extend
virtual void dataClosed(const CommCloseCbParams &io)
handler called by Comm when FTP data channel is closed unexpectedly
char * wordlistChopHead(wordlist **wl)
int xerrno
The last errno to occur. non-zero if flag is Comm::COMM_ERROR.
SBuf substr(size_type pos, size_type n=npos) const
struct SquidConfig::@112 Ftp
virtual void dataChannelConnected(const CommConnectCbParams &io)
FTP client functionality shared among FTP Gateway and Relay clients.
virtual void maybeReadVirginBody()
read response data from the network
virtual void completeForwarding()
void() StateMethod(Ftp::Gateway *)
CBDATA_NAMESPACED_CLASS_INIT(Ftp, Gateway)
struct sockaddr * ai_addr
void comm_open_listener(int sock_type, int proto, Comm::ConnectionPointer &conn, const char *note)
virtual bool haveControlChannel(const char *caller_name) const
size_type rfind(char c, size_type endPos=npos) const
bool handlePasvReply(Ip::Address &remoteAddr)
virtual void start()
called by AsyncStart; do not call directly
mb_size_t contentSize() const
available data size
static FTPSM ftpReadMkdir
static char cbuf[CTRL_BUFLEN]
const char * rawContent() const
bool completed_forwarding
void rfc1738_unescape(char *url)
#define SQUIDSBUFPRINT(s)
virtual void handleControlReply()
virtual void dataClosed(const CommCloseCbParams &io)
handler called by Comm when FTP data channel is closed unexpectedly
MemBlob::size_type size_type
void append(char const *buf, int len)
static FTPSM ftpReadWelcome
HttpRequestPointer request
void appendSuccessHeader()
#define EBIT_TEST(flag, bit)
bool handleEpsvReply(Ip::Address &remoteAddr)
Comm::ConnectionPointer conn
@ srcFtp
ftp_port or FTP server
void close()
planned close: removes the close handler and calls comm_close
void ftpAcceptDataConnection(const CommAcceptCbParams &io)
int conn
the current server connection FD
bool tried_auth_anonymous
auth has tried to use anonymous credentials already.
bool authenticated
authentication success
Comm::Flag flag
comm layer result status.
static FTPSM ftpTraverseDirectory
virtual void completeForwarding()
#define JobCallback(dbgSection, dbgLevel, Dialer, job, method)
Convenience macro to create a Dialer-based job callback.
Comm::ConnectionPointer conn
channel descriptor
int64_t strtoll(const char *nptr, char **endptr, int base)
size_type length() const
Returns the number of bytes stored in SBuf.
char * xstrndup(const char *s, size_t n)
SBuf & append(const SBuf &S)
DataChannel data
FTP data channel state.
static FTPSM ftpSendPassive
int regexec(regex_t *preg, const char *string, size_t nmatch, pmatch, int eflags) const
bool mimeGetViewOption(const char *fn)
static const size_type npos
void markParsedVirginReplyAsWhole(const char *reasonWeAreSure)
virtual void handleControlReply()
uint32_t sources
The message sources.
void writeReplyBody(const char *, size_t len)
static void ftpListPartsFree(ftpListParts **parts)
static const char * Month[]
void hackShortcut(StateMethod *nextState)
void clear()
remove the close handler, leave connection open
virtual void handleRequestBodyProducerAborted()
Comm::ConnectionPointer listenConn
const char * mimeGetContentType(const char *fn)
virtual Http::StatusCode failedHttpStatus(err_type &error)
MemBuf listing
FTP directory listing in HTML format.
void getAddrInfo(struct addrinfo *&ai, int force=AF_UNSPEC) const
virtual Http::StatusCode failedHttpStatus(err_type &error)
const SBuf & UrlWith2f(HttpRequest *)
static ftpListParts * ftpListParseParts(const char *buf, struct Ftp::GatewayFlags flags)
void processHeadResponse()
void httpHeaderAddContRange(HttpHeader *, HttpHdrRangeSpec, int64_t)
char * content()
start of the added data
static int is_month(const char *buf)
void memFree(void *, int type)
Free a element allocated by memAllocate()
void printfReplyBody(const char *fmt,...)
void StartGateway(FwdState *const fwdState)
A new FTP Gateway job.
const char * mimeGetContentEncoding(const char *fn)
void reset(char const *str)
void listenForDataChannel(const Comm::ConnectionPointer &conn)
create a data channel acceptor and start listening.
void Controller::create() STUB void Controller Controller nil
void completedListing(void)
void release(const bool shareable=false)
time_t ParseIso3307(const char *)
Convert from ISO 3307 style time: YYYYMMDDHHMMSS or YYYYMMDDHHMMSS.xxx.
char * rfc1738_do_escape(const char *url, int flags)
int64_t getCurrentOffset() const
SBuf & appendf(const char *fmt,...)
CtrlChannel ctrl
FTP control channel state.
virtual void haveParsedReplyHeaders()
called when we have final (possibly adapted) reply headers; kids extend
const char * mimeGetIconURL(const char *fn)
void setHeaders(Http::StatusCode status, const char *reason, const char *ctype, int64_t clen, time_t lmt, time_t expires)
bool mimeGetDownloadOption(const char *fn)
virtual void start()
called by AsyncStart; do not call directly
#define rfc1738_escape_part(x)
const char * wordlistAdd(wordlist **list, const char *key)
virtual void timeout(const CommTimeoutCbParams &io)
read timeout handler
void host(const char *src)
static FTPSM ftpSendReply
HttpRequestPointer request
struct _request * request(char *urlin)
#define debugs(SECTION, LEVEL, CONTENT)
void setCurrentOffset(int64_t offset)
void switchTimeoutToDataChannel()
size_type copy(char *dest, size_type n) const
char mimeGetTransferMode(const char *fn)
static FTPSM ftpWriteTransferDone
bool epsv_all_sent
EPSV ALL has been used. Must abort on failures.
static void Start(const Pointer &job)
int regcomp(regex_t *preg, const char *pattern, int cflags)