1 /*
2  * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 #ifndef SQUID_CLIENTS_FORWARD_H
10 #define SQUID_CLIENTS_FORWARD_H
11 
12 #include "sbuf/forward.h"
13 
14 class FwdState;
15 class HttpRequest;
16 
17 class AsyncJob;
18 template <class Cbc> class CbcPointer;
19 typedef CbcPointer<AsyncJob> AsyncJobPointer;
20 
21 namespace Ftp
22 {
23 
24 /// A new FTP Gateway job
25 AsyncJobPointer StartGateway(FwdState *const fwdState);
26 
27 /// A new FTP Relay job
28 AsyncJobPointer StartRelay(FwdState *const fwdState);
29 
30 /** Construct an URI with leading / in PATH portion for use by CWD command
31  *  possibly others. FTP encodes absolute paths as beginning with '/'
32  *  after the initial URI path delimiter, which happens to be / itself.
33  *  This makes FTP absolute URI appear as:  ftp:host:port//root/path
34  *  To encompass older software which compacts multiple // to / in transit
35  *  We use standard URI-encoding on the second / making it
36  *  ftp:host:port/%2froot/path  AKA 'the FTP %2f hack'.
37  *
38  * \todo Should be a URL class API call.
39  */
40 const SBuf &UrlWith2f(HttpRequest *);
41 
42 } // namespace Ftp
43 
44 #endif /* SQUID_CLIENTS_FORWARD_H */
45 
46