]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/clients/forward.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / clients / forward.h
index d32c4612dd957f037b24f6996d30091271822f36..2f5dfe5ed0bb8817a881c97adf96a6f7e2dfd7ee 100644 (file)
@@ -1,6 +1,16 @@
+/*
+ * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
 #ifndef SQUID_CLIENTS_FORWARD_H
 #define SQUID_CLIENTS_FORWARD_H
 
+#include "sbuf/forward.h"
+
 class FwdState;
 class HttpRequest;
 
@@ -8,7 +18,8 @@ class AsyncJob;
 template <class Cbc> class CbcPointer;
 typedef CbcPointer<AsyncJob> AsyncJobPointer;
 
-namespace Ftp {
+namespace Ftp
+{
 
 /// A new FTP Gateway job
 AsyncJobPointer StartGateway(FwdState *const fwdState);
@@ -16,14 +27,19 @@ AsyncJobPointer StartGateway(FwdState *const fwdState);
 /// A new FTP Relay job
 AsyncJobPointer StartRelay(FwdState *const fwdState);
 
-/**
- * \defgroup ServerProtocolFTPAPI Server-Side FTP API
- * \ingroup ServerProtocol
+/** Construct an URI with leading / in PATH portion for use by CWD command
+ *  possibly others. FTP encodes absolute paths as beginning with '/'
+ *  after the initial URI path delimiter, which happens to be / itself.
+ *  This makes FTP absolute URI appear as:  ftp:host:port//root/path
+ *  To encompass older software which compacts multiple // to / in transit
+ *  We use standard URI-encoding on the second / making it
+ *  ftp:host:port/%2froot/path  AKA 'the FTP %2f hack'.
+ *
+ * \todo Should be a URL class API call.
  */
-
-/// \ingroup ServerProtocolFTPAPI
-const char *UrlWith2f(HttpRequest *);
+const SBuf &UrlWith2f(HttpRequest *);
 
 } // namespace Ftp
 
 #endif /* SQUID_CLIENTS_FORWARD_H */
+