Skip to content
Browse files

TS-324: Remove most of the remaining FTP remnants from the core.

  • Loading branch information...
1 parent f06250e commit 49394f566a650c8fac5aed146f1a4eba18f16724 @zwoop zwoop committed Apr 30, 2010
Showing with 280 additions and 7,398 deletions.
  1. +0 −2 configure.ac
  2. +0 −3 doc/man/Makefile.am
  3. +0 −3 doc/man/config_cache.1
  4. +0 −62 doc/man/config_ftp.1
  5. +1 −2 doc/man/config_reset-stats.1
  6. +2 −3 doc/man/config_upgrade.1
  7. +1 −3 doc/man/show_cache.1
  8. +1 −1 doc/man/show_filter.1
  9. +0 −38 doc/man/show_ftp-stats.1
  10. +0 −37 doc/man/show_ftp.1
  11. +2 −2 doc/man/show_icp.1
  12. +0 −3 iocore/cache/Cache.cc
  13. +1 −2 iocore/cache/I_CacheDefs.h
  14. +1 −2 iocore/cache/P_CacheTest.h
  15. +1 −37 iocore/cache/test_Cache.i
  16. +1 −2 iocore/eventsystem/I_Event.h
  17. +1 −1 iocore/net/I_NetVConnection.h
  18. +0 −17 libinktomi++/InkErrno.h
  19. +0 −1 libinktomi++/TestHttpHeader.cc
  20. +1 −0 libinktomi++/mkdfa.c
  21. +0 −1 librecords/I_RecAlarms.h
  22. +0 −1 librecords/I_RecSignals.h
  23. +0 −83 proxy/CoreUtils.cc
  24. +0 −3 proxy/CoreUtils.h
  25. +0 −5 proxy/EventName.cc
  26. +0 −7 proxy/InkAPI.cc
  27. +0 −8 proxy/InkAPITest.cc
  28. +0 −20 proxy/Main.cc
  29. +0 −1 proxy/Main.h
  30. +0 −1 proxy/ParentSelection.cc
  31. +2 −13 proxy/README-stats.otl
  32. +0 −10 proxy/StatSystem.cc
  33. +1 −1 proxy/StatSystem.h
  34. +0 −3 proxy/TestPreProc.cc
  35. +8 −36 proxy/TestProxy.cc
  36. +0 −989 proxy/Transform.cc
  37. +0 −6 proxy/Transform.h
  38. +0 −38 proxy/TransformInternal.h
  39. +2 −50 proxy/Update.cc
  40. +0 −2 proxy/Update.h
  41. +1 −3 proxy/api/include/ts.h
  42. +0 −1 proxy/config/Makefile.am
  43. +0 −4 proxy/config/body_factory/default/Makefile.am
  44. +0 −15 proxy/config/body_factory/default/ftp#auth_required
  45. +0 −14 proxy/config/body_factory/default/ftp#bad_request
  46. +0 −15 proxy/config/body_factory/default/ftp#error
  47. +0 −14 proxy/config/body_factory/default/ftp#unsupported_method
  48. +1 −1 proxy/config/filter.config
  49. +0 −28 proxy/config/ftp_remap.config
  50. +4 −5 proxy/config/logs_xml.config
  51. +1 −136 proxy/config/stats.config.xml
  52. +0 −11 proxy/config/update.config
  53. +0 −1 proxy/hdrs/HTTP.h
  54. +1 −87 proxy/hdrs/HdrTest.cc
  55. +45 −154 proxy/hdrs/URL.cc
  56. +2 −7 proxy/hdrs/URL.h
  57. +0 −45 proxy/hdrs/test_header.cc
  58. +0 −27 proxy/http2/HttpConfig.cc
  59. +0 −24 proxy/http2/HttpConfig.h
  60. +0 −26 proxy/http2/HttpDebugNames.cc
  61. +60 −541 proxy/http2/HttpSM.cc
  62. +1 −15 proxy/http2/HttpSM.h
  63. +24 −927 proxy/http2/HttpTransact.cc
  64. +0 −64 proxy/http2/HttpTransact.h
  65. +0 −2 proxy/http2/HttpTransactHeaders.cc
  66. +0 −9 proxy/http2/HttpTransactHeaders.h
  67. +9 −13 proxy/http2/HttpTunnel.cc
  68. +0 −1 proxy/http2/HttpTunnel.h
  69. +0 −27 proxy/http2/HttpUpdateSM.cc
  70. +1 −1 proxy/http2/README.via
  71. +0 −10 proxy/http2/TestUrl.cc
  72. +3 −3 proxy/http2/remap/UrlRewrite.cc
  73. +2 −3 proxy/http2/stats.memo
  74. +0 −2 proxy/logging/Log.cc
  75. +0 −1 proxy/logging/LogAccess.h
  76. +6 −59 proxy/logging/LogAccessHttp.cc
  77. +0 −1 proxy/logging/LogAccessHttp.h
  78. +1 −3 proxy/logging/LogConfig.cc
  79. +0 −1 proxy/logging/LogStandalone.cc
  80. +0 −3 proxy/mgmt2/AddConfigFilesHere.cc
  81. +1 −1 proxy/mgmt2/AutoConf.cc
  82. +0 −1 proxy/mgmt2/BaseManager.h
  83. +0 −17 proxy/mgmt2/LocalManager.cc
  84. +0 −3 proxy/mgmt2/Main.cc
  85. +0 −309 proxy/mgmt2/RecordsConfig.cc
  86. +25 −105 proxy/mgmt2/StatAggregation.cc
  87. +1 −134 proxy/mgmt2/api2/CfgContextImpl.cc
  88. +0 −24 proxy/mgmt2/api2/CfgContextImpl.h
  89. +0 −42 proxy/mgmt2/api2/CfgContextUtils.cc
  90. +0 −1 proxy/mgmt2/api2/CfgContextUtils.h
  91. +0 −5 proxy/mgmt2/api2/CoreAPIShared.cc
  92. +0 −1 proxy/mgmt2/api2/CoreAPIShared.h
  93. +0 −39 proxy/mgmt2/api2/GenericParser.cc
  94. +0 −1 proxy/mgmt2/api2/GenericParser.h
  95. +0 −35 proxy/mgmt2/api2/INKMgmtAPI.cc
  96. +0 −12 proxy/mgmt2/api2/INKMgmtAPIStub.cc
  97. +3 −25 proxy/mgmt2/api2/include/INKMgmtAPI.h
  98. +4 −32 proxy/mgmt2/api2/remote/APITestCliRemote.cc
  99. +3 −59 proxy/mgmt2/cli/CLIconfigure.cc
  100. +6 −7 proxy/mgmt2/cli/CLIconfigure.h
  101. +4 −6 proxy/mgmt2/cli/CLIhelp.cc
  102. +0 −35 proxy/mgmt2/cli/CLImonitor.cc
  103. +1 −2 proxy/mgmt2/cli/CLImonitor.h
  104. +1 −10 proxy/mgmt2/cli2/CliCreateCommands.cc
  105. +2 −314 proxy/mgmt2/cli2/ConfigCmd.cc
  106. +0 −46 proxy/mgmt2/cli2/ConfigCmd.h
  107. +2 −150 proxy/mgmt2/cli2/ShowCmd.cc
  108. +0 −10 proxy/mgmt2/cli2/ShowCmd.h
  109. +3 −67 proxy/mgmt2/cli2/cli_detailed_command_list.txt
  110. +1 −8 proxy/mgmt2/cli2/cli_feature_spec.txt
  111. +0 −2 proxy/mgmt2/html2/agent-installer/Makefile.am
  112. +0 −7 proxy/mgmt2/html2/configure/Makefile.am
  113. +0 −12 proxy/mgmt2/html2/configure/c_basic.ink
  114. +0 −12 proxy/mgmt2/html2/configure/c_basic.ink.win
  115. +0 −174 proxy/mgmt2/html2/configure/c_ftp_cachability.ink
  116. +0 −139 proxy/mgmt2/html2/configure/c_ftp_general.ink
  117. +0 −162 proxy/mgmt2/html2/configure/c_ftp_timeout.ink
  118. +0 −30 proxy/mgmt2/html2/configure/c_http_cachability.ink
  119. +0 −50 proxy/mgmt2/html2/configure/c_http_general.ink
  120. +0 −14 proxy/mgmt2/html2/configure/c_http_timeout.ink
  121. +0 −72 proxy/mgmt2/html2/configure/c_mapping_ftp.ink
  122. +0 −62 proxy/mgmt2/html2/configure/c_reverse_proxy_ftp.ink
  123. +0 −157 proxy/mgmt2/html2/configure/c_snapshot_ftpsystem.ink
  124. +0 −19 proxy/mgmt2/html2/configure/f_configs.ink
  125. +0 −145 proxy/mgmt2/html2/configure/f_ftp_remap_config.ink
  126. +0 −1 proxy/mgmt2/html2/configure/helper/Makefile.am
  127. +0 −5 proxy/mgmt2/html2/english.dict
  128. +0 −2 proxy/mgmt2/html2/monitor/Makefile.am
  129. +0 −110 proxy/mgmt2/html2/monitor/m_ftp.ink
  130. +0 −87 proxy/mgmt2/html2/monitor/m_ftp_http.ink
  131. +0 −37 proxy/mgmt2/html2/mrtg/detailed.ink
  132. +0 −14 proxy/mgmt2/html2/mrtg/overview.ink
  133. +0 −28 proxy/mgmt2/html2/navigation_tree.xml
  134. +0 −25 proxy/mgmt2/html2/navigation_tree.xml.win
  135. +0 −25 proxy/mgmt2/html2/tune/navigation_tree.xmlcpp
  136. +3 −3 proxy/mgmt2/preparse/RemapReadConfig.cc
  137. +20 −54 proxy/mgmt2/uistats
  138. +0 −70 proxy/mgmt2/utils/MgmtConverter.cc
  139. +0 −2 proxy/mgmt2/utils/MgmtConverter.h
  140. +0 −105 proxy/mgmt2/web2/WebConfig.cc
  141. +0 −2 proxy/mgmt2/web2/WebConfig.h
  142. +6 −276 proxy/mgmt2/web2/WebConfigRender.cc
  143. +0 −6 proxy/mgmt2/web2/WebConfigRender.h
  144. +0 −4 proxy/mgmt2/web2/WebHttp.cc
  145. +0 −1 proxy/mgmt2/web2/WebHttpMessage.h
  146. +0 −12 proxy/mgmt2/web2/WebHttpRender.cc
  147. +0 −12 proxy/mgmt2/web2/WebHttpRender.h
  148. +2 −24 proxy/mgmt2/web2/WebOverview.cc
  149. +0 −54 proxy/ts-instantiate.pl
  150. +3 −4 test/deft/docs/test_tool_docs.html
  151. +1 −42 test/plugin/check-url/check-url-0.c
  152. +0 −32 test/plugin/test-mgmt/test-mgmt.c
View
2 configure.ac
@@ -171,7 +171,6 @@ AS_IF([test "x$enable_micro" = "xyes"],
AC_DEFINE(INK_NO_ACL)
AC_DEFINE(INK_NO_CLUSTER)
AC_DEFINE(INK_NO_DIAGS)
- AC_DEFINE(INK_NO_FTP)
AC_DEFINE(INK_NO_HOSTDB)
AC_DEFINE(INK_NO_ICP)
AC_DEFINE(INK_NO_LOG)
@@ -986,7 +985,6 @@ AH_TEMPLATE([INK_NO_ACL],[INK_NO_ACL])
AH_TEMPLATE([INK_NO_API],[INK_NO_API])
AH_TEMPLATE([INK_NO_CLUSTER],[INK_NO_CLUSTER])
AH_TEMPLATE([INK_NO_DIAGS],[INK_NO_DIAGS])
-AH_TEMPLATE([INK_NO_FTP],[INK_NO_FTP])
AH_TEMPLATE([INK_NO_HOSTDB],[INK_NO_HOSTDB])
AH_TEMPLATE([INK_NO_ICP],[INK_NO_ICP])
AH_TEMPLATE([INK_NO_LOG],[INK_NO_LOG])
View
3 doc/man/Makefile.am
@@ -23,7 +23,6 @@ man_MANS = \
config_clock.1 \
config_dns.1 \
config_filter.1 \
- config_ftp.1 \
config_get.1 \
config_hard-restart.1 \
config_hostdb.1 \
@@ -64,8 +63,6 @@ man_MANS = \
show_dns-resolver.1 \
show_dns-stats.1 \
show_filter.1 \
- show_ftp.1 \
- show_ftp-stats.1 \
show_hostdb.1 \
show_hostdb-stats.1 \
show_http.1 \
View
3 doc/man/config_cache.1
@@ -29,9 +29,6 @@ The following options are supported for the config:cache command:
.SS "http <on | off>"
Enables (on) or disables (off) the caching of HTTP requests. (The default value
is on.)
-.SS "ftp <on | off>"
-Enables (on) or disables (off) the caching of FTP requests sent by HTTP. (The
-default value is on.)
.SS "ignore-bypass <on | off>"
Enables (on) or disables (off) the ignore-bypass option. When enabled (on), the proxy ignores client requests to bypass the cache. (The default value is off.)
.SS "max-object-size <bytes>"
View
62 doc/man/config_ftp.1
@@ -1,62 +0,0 @@
-.\" Licensed to the Apache Software Foundation (ASF) under one .\"
-.\" or more contributor license agreements. See the NOTICE file .\"
-.\" distributed with this work for additional information .\"
-.\" regarding copyright ownership. The ASF licenses this file .\"
-.\" to you under the Apache License, Version 2.0 (the .\"
-.\" "License"); you may not use this file except in compliance .\"
-.\" with the License. You may obtain a copy of the License at .\"
-.\" .\"
-.\" http://www.apache.org/licenses/LICENSE-2.0 .\"
-.\" .\"
-.\" Unless required by applicable law or agreed to in writing, software .\"
-.\" distributed under the License is distributed on an "AS IS" BASIS, .\"
-.\" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. .\"
-.\" See the License for the specific language governing permissions and .\"
-.\" limitations under the License. .\"
-.TH "config:ftp"
-.SH NAME
-config:ftp \- Configures FTP caching, mode, and control.
-.SH SYNOPSIS
-config:ftp [options]
-.SH DESCRIPTION
-The config:ftp command enables you to configure FTP caching and control through
-a variety of options. You must use one of the options described below.
-.SH OPTIONS
-The following options are supported for the config:ftp command:
-.SS "mode <pasv-port | pasv | port>"
-Specifies the FTP connection mode. The options are PASV then PORT, PASV only,
-and PORT only. (The default value is PASV then PORT.)
-.SS "inactive-timeout <seconds>"
-Specifies how long the proxy waits for a response from the FTP server. (The
-default is 300 seconds.)
-.SS "anonymous-password <password>"
-Specifies the anonymous password for FTP servers that require a password for
-access. The anonymous password can be in cleartext.
-.SS "expire-after <seconds>"
-Specifies the maximum amount of time in seconds that an FTP document can stay in the proxy
-cache. (The default value is 259200.)
-.SH EXAMPLES
-.SS "Example 1. Specifying the PASV then PORT FTP connection mode"
-.PP
-.nf
-traffic_shell> config:ftp mode pasv-port
-traffic_shell>
-.SS "Example 2. Specifying duration proxy waits for FTP server"
-.SS " response"
-.PP
-.nf
-traffic_shell> config:ftp inactive-timeout 500
-traffic_shell>
-.SS "Example 3. Specifying anonymous password for FTP servers"
-.PP
-.nf
-traffic_shell> config:ftp anonymous-password admin@
-traffic_shell>
-.SS "Example 4. Specifying maximum time that an FTP document"
-.SS " can stay in the proxy cache"
-.PP
-.nf
-traffic_shell> config:ftp expire-after 50000
-traffic_shell>
-.SH "SEE ALSO"
-show:ftp, show:ftp-stats
View
3 doc/man/config_reset-stats.1
@@ -43,5 +43,4 @@ ts_shell>
.SH "SEE ALSO"
show:cache-stats, show:dns-stats, show:hostdb-stats, show:http-stats,
-show:ftp-stats, show:proxy-stats, show:http-trans-stats, show:icp-stats,
-show:logging-stats
+show:proxy-stats, show:http-trans-stats, show:icp-stats, show:logging-stats
View
5 doc/man/config_upgrade.1
@@ -32,9 +32,8 @@ Interactive upgrade allows you to choose the upgrade package from a list.
Reinstall allows you to install an older version of software with default
configuration settings.
.SS "<url>"
-Specifies the URL which is the location of the upgrade files on a remote server. If
-the URL is for FTP, then a username and password are required. If the URL is for HTTP or HTTPS,
-then username and password are optional.
+Specifies the URL which is the location of the upgrade files on a remote
+server.If the URL is for HTTP or HTTPS, then username and password are optional.
.SS "<username>"
Specifies the username that is used to access the URL on the remote server.
.SS "<password>"
View
4 doc/man/show_cache.1
@@ -35,16 +35,14 @@ hard disk partitions that make up the cache.
.nf
traffic_shell> show:cache
HTTP Caching --------------------------- on
-FTP Caching ---------------------------- on
Ignore User Requests To Bypass Cache --- off
-Maximum HTTP/FTP Object Size ----------- NONE
+Maximum HTTP Object Size ----------- NONE
Freshness
Verify Freshness By Checking --------- When The Object Has Expired
Minimum Information to be Cacheable -- Nothing
If Object has no Expiration Date:
Leave it in Cache for at least ----- 3600 s
but no more than ------------------- 86400 s
- FTP Cached Objects Expire After ------ 259200 s
Variable Content
Cache Responses to URLs that contain
"?",";","cgi" or end in ".asp" ----- off
View
2 doc/man/show_filter.1
@@ -19,7 +19,7 @@ show:filter \- This command displays filtering configuration information.
.SH SYNOPSIS
show:filter
.SH DESCRIPTION
-The show:filter command specifies which HTTP and FTP objects can be obtained
+The show:filter command specifies which HTTP can be obtained
through Traffic Server and which cannot. The show:filter command takes no
options.
.SH EXAMPLE
View
38 doc/man/show_ftp-stats.1
@@ -1,38 +0,0 @@
-.\" Licensed to the Apache Software Foundation (ASF) under one .\"
-.\" or more contributor license agreements. See the NOTICE file .\"
-.\" distributed with this work for additional information .\"
-.\" regarding copyright ownership. The ASF licenses this file .\"
-.\" to you under the Apache License, Version 2.0 (the .\"
-.\" "License"); you may not use this file except in compliance .\"
-.\" with the License. You may obtain a copy of the License at .\"
-.\" .\"
-.\" http://www.apache.org/licenses/LICENSE-2.0 .\"
-.\" .\"
-.\" Unless required by applicable law or agreed to in writing, software .\"
-.\" distributed under the License is distributed on an "AS IS" BASIS, .\"
-.\" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. .\"
-.\" See the License for the specific language governing permissions and .\"
-.\" limitations under the License. .\"
-.TH "show:ftp-stats"
-.SH NAME
-show:ftp-stats \- This command displays FTP statistics.
-.SH SYNOPSIS
-show:ftp-stats
-.SH DESCRIPTION
-The show:ftp-stats command displays FTP statistics, including open, PASV, and
-PORT connections values. The show:ftp-stats command takes no options.
-.SH EXAMPLE
-.PP
-When you execute the show:ftp-stats command, you see results in the following
-format:
-.PP
-.nf
-traffic_shell> show:ftp-stats
-Open Connections ------------ 0
-PASV Connections Successes -- 0
-PASV Connections Failure ---- 0
-PORT Connections Successes -- 0
-PORT Connections Failure ---- 0
-traffic_shell>
-.SH "SEE ALSO"
-show:cache, config:ftp
View
37 doc/man/show_ftp.1
@@ -1,37 +0,0 @@
-.\" Licensed to the Apache Software Foundation (ASF) under one .\"
-.\" or more contributor license agreements. See the NOTICE file .\"
-.\" distributed with this work for additional information .\"
-.\" regarding copyright ownership. The ASF licenses this file .\"
-.\" to you under the Apache License, Version 2.0 (the .\"
-.\" "License"); you may not use this file except in compliance .\"
-.\" with the License. You may obtain a copy of the License at .\"
-.\" .\"
-.\" http://www.apache.org/licenses/LICENSE-2.0 .\"
-.\" .\"
-.\" Unless required by applicable law or agreed to in writing, software .\"
-.\" distributed under the License is distributed on an "AS IS" BASIS, .\"
-.\" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. .\"
-.\" See the License for the specific language governing permissions and .\"
-.\" limitations under the License. .\"
-.TH "show:ftp"
-.SH NAME
-show:ftp \- This command displays FTP configuration.
-.SH SYNOPSIS
-show:ftp
-.SH DESCRIPTION
-The show:ftp command displays FTP configuration settings, including connectivity
-and timeout and expiration values. The show:ftp command takes no options.
-.SH EXAMPLE
-.PP
-When you execute the show:ftp command, you see results in the following format:
-.PP
-.nf
-traffic_shell> show:ftp
-FTP Caching ----------------------- on
-FTP Cached Objects Expired After -- 259200 s
-FTP Connection Mode --------------- PASV/PORT
-FTP Inactivity Timeout ------------ 300 s
-Anonymous FTP password ------------ inktomi
-traffic_shell>
-.SH "SEE ALSO"
-show:ftp-stats, config:ftp
View
4 doc/man/show_icp.1
@@ -19,8 +19,8 @@ show:icp \- This command displays ICP configuration.
.SH SYNOPSIS
show:icp [peers]
.SH DESCRIPTION
-The show:icp command displays FTP configuration settings, including connectivity
-and timeout and expiration values. The show:ftp command takes no options.
+The show:icp command displays ICP configuration settings, including connectivity
+and timeout and expiration values. The show:icp command takes no options.
.SH OPTIONS
The following option is supported for the show:icp command:
.SS peers
View
3 iocore/cache/Cache.cc
@@ -692,10 +692,8 @@ CacheProcessor::cacheInitialized()
} else {
caches_ready = caches_ready | CACHE_FRAG_TYPE_HTTP;
caches_ready = caches_ready | CACHE_FRAG_TYPE_NONE;
- caches_ready = caches_ready | CACHE_FRAG_TYPE_FTP;
caches[CACHE_FRAG_TYPE_HTTP] = theCache;
caches[CACHE_FRAG_TYPE_NONE] = theCache;
- caches[CACHE_FRAG_TYPE_FTP] = theCache;
}
}
if (theStreamCache) {
@@ -1661,7 +1659,6 @@ AIO_Callback_handler::handle_disk_failure(int event, void *data)
unsigned int caches_ready = 0;
caches_ready = caches_ready | CACHE_FRAG_TYPE_HTTP;
caches_ready = caches_ready | CACHE_FRAG_TYPE_NONE;
- caches_ready = caches_ready | CACHE_FRAG_TYPE_FTP;
caches_ready = ~caches_ready;
CacheProcessor::cache_ready &= caches_ready;
Warning("all partitions for http cache are corrupt, http cache disabled");
View
3 iocore/cache/I_CacheDefs.h
@@ -115,8 +115,7 @@ enum CacheFragType
{
CACHE_FRAG_TYPE_NONE = 1 << 0,
CACHE_FRAG_TYPE_HTTP = 1 << 1,
- CACHE_FRAG_TYPE_FTP = 1 << 2,
- CACHE_FRAG_TYPE_RTSP = 1 << 3
+ CACHE_FRAG_TYPE_RTSP = 1 << 2
};
#define CacheKey INK_MD5
View
3 iocore/cache/P_CacheTest.h
@@ -55,11 +55,10 @@ struct PinnedDocTable:Continuation
struct CacheTestHost {
char *name;
volatile unsigned int xlast_cachable_id;
- volatile unsigned int xlast_ftp_cachable_id;
double xprev_host_prob;
double xnext_host_prob;
- CacheTestHost():name(NULL), xlast_cachable_id(0), xlast_ftp_cachable_id(0),
+ CacheTestHost():name(NULL), xlast_cachable_id(0),
xprev_host_prob(0), xnext_host_prob(0) {}
};
View
38 iocore/cache/test_Cache.i
@@ -347,7 +347,6 @@ CacheTestControl::CacheTestControl()
xrun_length = 0;
xmean_doc_size = 13 * 1024;
xlast_cachable_id = 10000;
- xlast_ftp_cachable_id = 0;
xnum_hosts = 0;
xhotset_probability = 1;
xremove_probability = 0;
@@ -899,16 +898,6 @@ CacheTestControl::get_request(CacheSMTest * test, char *buffer, int size)
}
id = 1 + (id << 1);
sprintf(buffer, "http://%s/%s/%u", h->name, cache_test_id, id);
- } else {
- if (gen->drandom() <= xhotset_probability) {
- test->f.hit = 1;
- id = (unsigned int) (1 + h->xlast_ftp_cachable_id * gen->drandom());
-
- } else {
- id = 1 + ink_atomic_increment((volatile ink32 *) &h->xlast_ftp_cachable_id, 1);
- }
- id = 1 + (id << 1);
- sprintf(buffer, "ftp://%s/%s/%u", h->name, cache_test_id, id);
}
} else {
if (gen->drandom() <= xhttp_req_probability) {
@@ -920,16 +909,6 @@ CacheTestControl::get_request(CacheSMTest * test, char *buffer, int size)
}
id = 1 + (id << 1);
sprintf(buffer, "http://www.foobar.com/%s/%u", cache_test_id, id);
-
- } else {
- if (gen->drandom() <= xhotset_probability) {
- test->f.hit = 1;
- id = (unsigned int) (1 + xlast_ftp_cachable_id * gen->drandom());
- } else {
- id = 1 + ink_atomic_increment((volatile ink32 *) &xlast_ftp_cachable_id, 1);
- }
- id = 1 + (id << 1);
- sprintf(buffer, "ftp://www.foobar.com/%s/%u", cache_test_id, id);
}
}
@@ -1292,12 +1271,7 @@ CacheSMTest::make_request()
hdr->url_get(&url);
start_time = ink_get_hrtime();
action = cacheProcessor.open_read(this, &url, hdr, &params);
- } else
#endif
- {
- f.http_request = 0;
- start_time = ink_get_hrtime();
- action = cacheProcessor.open_read(this, &md5, CACHE_FRAG_TYPE_FTP, 0, 0);
}
if ((action != ACTION_RESULT_DONE) && (gen->drandom() <= control->xcancel_probability)) {
@@ -1444,12 +1418,6 @@ CacheSMTest::event_handler(int event, void *edata)
info.request_get(&h);
h.url_get(&u);
action = cacheProcessor.open_write(this, 0, &u, &h, alternate, pin_in_cache);
- } else {
- if (prob < (control->xupdate_probability)) {
- action = cacheProcessor.open_write(this, 0, &md5, CACHE_FRAG_TYPE_FTP, true, pin_in_cache);
- } else {
- action = cacheProcessor.remove(this, &md5);
- }
}
if ((action != ACTION_RESULT_DONE) && (gen->drandom() <= control->xcancel_probability)) {
cache_action = action;
@@ -1508,12 +1476,8 @@ CacheSMTest::event_handler(int event, void *edata)
info.request_get(&h);
h.url_get(&u);
action = cacheProcessor.open_write(this, total_size, &u, &h, NULL, pin_in_cache);
- } else
-#endif
- {
- action = cacheProcessor.open_write(this, total_size, &md5, CACHE_FRAG_TYPE_FTP, 0, pin_in_cache);
}
-
+#endif
if ((action != ACTION_RESULT_DONE) && (gen->drandom() <= control->xcancel_probability)) {
cache_action = action;
timeout = eventProcessor.schedule_in(this, HRTIME_MSECONDS((int) (gen->drandom() * 50)), ET_CALL);
View
3 iocore/eventsystem/I_Event.h
@@ -60,7 +60,6 @@
#define CLUSTER_EVENT_EVENTS_START 400
#define HOSTDB_EVENT_EVENTS_START 500
#define DNS_EVENT_EVENTS_START 600
-#define FTP_EVENT_EVENTS_START 700
#define CONFIG_EVENT_EVENTS_START 800
#define LOG_EVENT_EVENTS_START 900
#define MULTI_CACHE_EVENT_EVENTS_START 1000
@@ -103,7 +102,7 @@
/*
enum EventType { ET_SPAWN = 0, ET_CALL, ET_NET, ET_CLUSTER, ET_AUTH,
- ET_DNS, ET_FTP, ET_CACHE , ET_GC, ET_LOG, ET_ICP,
+ ET_DNS,ET_CACHE , ET_GC, ET_LOG, ET_ICP,
ET_UDP, ET_SSL, ET_NET_9x, ET_REMAP, ET_LAST};
const int N_EVENT_TYPES = ET_LAST;
*/
View
2 iocore/net/I_NetVConnection.h
@@ -237,7 +237,7 @@ class NetVConnection:public VConnection
/**
Sends out of band messages over the connection. This function
- is used to send out of band messages (Ctrl-C in ftp for instance).
+ is used to send out of band messages (is this still useful?).
cont is called back with VC_EVENT_OOB_COMPLETE - on successful
send or VC_EVENT_EOS - if the other side has shutdown the
connection. These callbacks could be re-entrant. Only one
View
17 libinktomi++/InkErrno.h
@@ -36,7 +36,6 @@
#define SOCK_ERRNO INK_START_ERRNO
#define NET_ERRNO INK_START_ERRNO+100
#define CLUSTER_ERRNO INK_START_ERRNO+200
-#define FTP_ERRNO INK_START_ERRNO+300
#define CACHE_ERRNO INK_START_ERRNO+400
#define HTTP_ERRNO INK_START_ERRNO+600
@@ -55,22 +54,6 @@
#define ECLUSTER_CHANNEL_INUSE (CLUSTER_ERRNO+5)
#define ECLUSTER_NOMORE_CHANNELS (CLUSTER_ERRNO+6)
-#define EFTP_ILL_REPLY_SYNTAX (FTP_ERRNO+0)
-#define EFTP_TIMEOUT (FTP_ERRNO+1)
-#define EFTP_CONNECTION_ERROR (FTP_ERRNO+2)
-#define EFTP_NO_CTRL_CONN (FTP_ERRNO+3)
-#define EFTP_SEND_CMD (FTP_ERRNO+4)
-#define EFTP_ILL_REPLY_CODE (FTP_ERRNO+5)
-#define EFTP_NO_PASV_CONN (FTP_ERRNO+6)
-#define EFTP_NO_ACCEPT (FTP_ERRNO+7)
-#define EFTP_LOGIN_INCORRECT (FTP_ERRNO+8)
-#define EFTP_FILE_UNAVAILABLE (FTP_ERRNO+9)
-#define EFTP_FTP_PROTOCOL_ERROR (FTP_ERRNO+10)
-#define EFTP_SERVICE_UNAVAILABLE (FTP_ERRNO+11)
-#define EFTP_NAME_TOO_LONG (FTP_ERRNO+12)
-#define EFTP_INTERNAL (FTP_ERRNO+13)
-#define EFTP_ERROR (FTP_ERRNO+14)
-
#define ECACHE_NO_DOC (CACHE_ERRNO+0)
#define ECACHE_DOC_BUSY (CACHE_ERRNO+1)
#define ECACHE_DIR_BAD (CACHE_ERRNO+2)
View
1 libinktomi++/TestHttpHeader.cc
@@ -135,7 +135,6 @@ test_url()
test_url_parse("http://charm.inktomi.com ");
test_url_parse
("http://webchat16.wbs.net:6666?private=herbalessences&color=4&volume=0&tagline=&picture=&home_page=hi@there.&ignore=edheldinruth+taz0069+speezman&back=&Room=Hot_Tub&handle=cagou67&mu=893e159ef7fe0ddb022c655cc1c30abd33d4ae6d90d22f8a&last_read_para=&npo=&fsection=input&chatmode=push&reqtype=input&InputText=Sweetie%2C+do+you+have+time+to+go+to+a+private+room..if+not+I%27m+just+going+to+have+to+change+to+normal+mode...let+me+know%3F%3F/");
- test_url_parse("ftp://ivry@inkdev.inktomi.com");
return;
}
View
1 libinktomi++/mkdfa.c
@@ -155,6 +155,7 @@ info_t schemes[] = {
{"https", "URL_SCHEME_HTTPS", 0},
{"mailto", "URL_SCHEME_MAILTO", 0},
{"news", "URL_SCHEME_NEWS", 0},
+ {"nntp", "URL_SCHEME_NNTP", 0},
{"prospero", "URL_SCHEME_PROSPERO", 0},
{"telnet", "URL_SCHEME_TELNET", 0},
{"wais", "URL_SCHEME_WAIS", 0},
View
1 librecords/I_RecAlarms.h
@@ -46,7 +46,6 @@
#define REC_ALARM_PROXY_LOG_SPACE_ROLLED 19
#define REC_ALARM_PROXY_HTTP_CONGESTED_SERVER 20
#define REC_ALARM_PROXY_HTTP_ALLEVIATED_SERVER 21
-#define REC_ALARM_PROXY_FTP_ERROR 22
#define REC_ALARM_WDA_BILLING_CONNECTION_DIED 100
#define REC_ALARM_WDA_BILLING_CORRUPTED_DATA 101
View
1 librecords/I_RecSignals.h
@@ -44,7 +44,6 @@
#define REC_SIGNAL_LIBRECORDS 16
#define REC_SIGNAL_HTTP_CONGESTED_SERVER 20
#define REC_SIGNAL_HTTP_ALLEVIATED_SERVER 21
-#define REC_SIGNAL_FTP_ERROR 22
#define REC_SIGNAL_WDA_BILLING_CONNECTION_DIED 100
#define REC_SIGNAL_WDA_BILLING_CORRUPTED_DATA 101
View
83 proxy/CoreUtils.cc
@@ -150,7 +150,6 @@ int program_counter = 0;
#include "WMT-Datapump.h"
#endif
-//#include "FtpSM.h"
#include "http2/HttpSM.h"
bool inTable;
@@ -163,7 +162,6 @@ char *event_int_to_string(int event, char buffer[32]);
const int HDR_HEAP_HDR_SIZE = ROUND(sizeof(HdrHeap), HDR_PTR_SIZE);
HTTPHdrImpl *global_http;
HttpSM *last_seen_http_sm = NULL;
-FtpSM *last_seen_ftp_sm = NULL;
#ifdef READ_CORE_WMT
WMT_ServerFileSM *last_seen_wmt_sfsm = NULL;
@@ -632,27 +630,6 @@ CoreUtils::test_HttpSM(void *arg)
}
-// test whether a given register is an FtpSM
-// if it is, call process_FtpSM on it
-void
-CoreUtils::test_FtpSM(void *arg)
-{
- /*
- FtpSM *fsm_test = (FtpSM *) arg;
-
- int *magic_ptr = &(fsm_test->magic);
- int magic = 0;
- if (read_from_core((intptr_t) magic_ptr, sizeof(int), (char *) &magic) != 0) {
- if (magic == FTP_SM_ALIVE || magic == FTP_SM_DEAD) {
- printf("test_FtpSM:******MATCH*****\n");
- process_FtpSM(fsm_test);
- }
- }
- */
- ink_release_assert(0);
-}
-
-
#ifdef READ_CORE_WMT
void
CoreUtils::test_wmtTop(void *arg)
@@ -1087,64 +1064,6 @@ CoreUtils::read_heap_header(intptr_t vaddr, intptr_t bytes, HdrHeap h)
return -1;
}
-
-void
-CoreUtils::process_FtpSM(FtpSM * core_ptr)
-{
-/*
-#if defined(sparc)
- intptr_t id = get_active_thread_Id();
-#endif
- // extracting the FtpSM from the core file
- if (last_seen_ftp_sm != core_ptr) {
- FtpSM *ftp_sm = (FtpSM *) malloc(sizeof(FtpSM));;
-
- if (read_from_core((intptr_t) core_ptr, sizeof(FtpSM), (char *) ftp_sm) < 0) {
- // This is most likely not 64-bit safe. /leif
- printf("ERROR: Failed to read FtpSM @ 0x%X from core\n", (unsigned int) core_ptr);
- free(ftp_sm);
- return;
- }
-
- if (ftp_sm->magic == FTP_SM_ALIVE) {
- last_seen_ftp_sm = core_ptr;
-
- if (is_debug_tag_set("magic")) {
-#if (HOST_OS == linux)
- printf("\n*****match-ALIVE*****\n");
-#endif
-#if defined(sparc)
- printf("\n*****match-ALIVE*****!! lwpid: %d\n", arrayLwp[id].lwpId);
-#endif
- }
- // This is probably not 64-bit correct. /leif
- printf("---- Found FtpSM --- id %lld ------ @ 0x%X -----\n\n", ftp_sm->sm_id, (unsigned int) ftp_sm);
- FtpSM::print_ftpsm(ftp_sm);
- printf("------------------------------------------------\n\n\n");
- } else if (ftp_sm->magic == FTP_SM_DEAD) {
- if (is_debug_tag_set("magic")) {
-#if (HOST_OS == linux)
- printf("\n*****match-DEAD*****\n");
-#endif
-#if defined(sparc)
- printf("\n*****match-DEAD*****!! lwpid: %d\n", arrayLwp[id].lwpId);
-#endif
- }
- } else {
- if (is_debug_tag_set("magic")) {
- // Nothing? /leif
- ;
- }
- }
-
- free(ftp_sm);
- } else
- printf("process_FtpSM : last_seen_http_sm == core_ptr\n");
- */
- ink_release_assert(0);
-}
-
-
void
CoreUtils::process_EThread(EThread * eth_test)
{
@@ -1695,7 +1614,6 @@ process_core(char *fname)
// Write your actual tests here
CoreUtils::find_stuff(&CoreUtils::test_HdrHeap);
CoreUtils::find_stuff(&CoreUtils::test_HttpSM);
- CoreUtils::find_stuff(&CoreUtils::test_FtpSM);
#ifdef READ_CORE_WMT
CoreUtils::find_stuff(&CoreUtils::test_wmtServerFile);
@@ -1878,7 +1796,6 @@ process_core(char *fname)
CoreUtils::find_stuff(&CoreUtils::test_HdrHeap);
CoreUtils::find_stuff(&CoreUtils::test_HttpSM);
- CoreUtils::find_stuff(&CoreUtils::test_FtpSM);
#ifdef READ_CORE_WMT
CoreUtils::find_stuff(&CoreUtils::test_wmtServerFile);
View
3 proxy/CoreUtils.h
@@ -118,7 +118,6 @@ class HdrHeap;
class EThread;
class UnixNetVConnection;
-class FtpSM;
#ifdef READ_CORE_WMT
class WMT_ServerFileSM;
@@ -228,7 +227,6 @@ class CoreUtils
**********************************************************************/
static void test_HttpSM(void *);
static void test_HttpSM_from_tunnel(void *);
- static void test_FtpSM(void *);
#ifdef READ_CORE_WMT
static void test_wmtServerFile(void *);
@@ -244,7 +242,6 @@ class CoreUtils
* outputs: none
**********************************************************************/
static void process_HttpSM(HttpSM * core_ptr);
- static void process_FtpSM(FtpSM * core_ptr);
static void process_EThread(EThread * eth_test);
static void process_NetVC(UnixNetVConnection * eth_test);
View
5 proxy/EventName.cc
@@ -28,7 +28,6 @@
#include "P_EventSystem.h"
// #include "I_Disk.h" unused
-// #include "I_FTP.h" unavailable
#include "I_Cache.h"
#include "I_Net.h"
#include "P_Cluster.h"
@@ -84,10 +83,6 @@ event_int_to_string(int event, char buffer[32])
case DNS_EVENT_EVENTS_START: return "DNS_EVENT_EVENTS_START";
#if 0
- case FTP_EVENT_OPEN: return "FTP_EVENT_OPEN";
- case FTP_EVENT_ACCEPT: return "FTP_EVENT_ACCEPT";
- case FTP_EVENT_OPEN_FAILED: return "FTP_EVENT_OPEN_FAILED";
-
case MANAGEMENT_EVENT: return "MANAGEMENT_EVENT";
case LOGIO_FINISHED: return "LOGIO_FINISHED";
View
7 proxy/InkAPI.cc
@@ -4634,9 +4634,6 @@ INKCacheKeyDataTypeSet(INKCacheKey key, INKCacheDataType type)
case INK_CACHE_DATA_TYPE_HTTP:
((CacheInfo *) key)->frag_type = CACHE_FRAG_TYPE_HTTP;
break;
- case INK_CACHE_DATA_TYPE_FTP:
- ((CacheInfo *) key)->frag_type = CACHE_FRAG_TYPE_FTP;
- break;
case INK_CACHE_DATA_TYPE_MIXT_RTSP: /* rtsp, wmt, qtime map to rtsp */
case INK_CACHE_DATA_TYPE_MIXT_WMT:
case INK_CACHE_DATA_TYPE_MIXT_QTIME:
@@ -5372,7 +5369,6 @@ INKHttpTxnCacheLookupStatusGet(INKHttpTxn txnp, int *lookup_status)
switch (sm->t_state.cache_lookup_result) {
case HttpTransact::CACHE_LOOKUP_MISS:
- case HttpTransact::CACHE_LOOKUP_HIT_FTP_NON_ANONYMOUS:
case HttpTransact::CACHE_LOOKUP_DOC_BUSY:
*lookup_status = INK_CACHE_LOOKUP_MISS;
break;
@@ -6959,9 +6955,6 @@ INKCacheDataTypeReady(INKCacheDataType type, int *is_ready)
case INK_CACHE_DATA_TYPE_HTTP:
frag_type = CACHE_FRAG_TYPE_HTTP;
break;
- case INK_CACHE_DATA_TYPE_FTP:
- frag_type = CACHE_FRAG_TYPE_FTP;
- break;
case INK_CACHE_DATA_TYPE_MIXT_RTSP: /* rtsp, wmt, qtime map to rtsp */
case INK_CACHE_DATA_TYPE_MIXT_WMT:
case INK_CACHE_DATA_TYPE_MIXT_QTIME:
View
8 proxy/InkAPITest.cc
@@ -3283,12 +3283,6 @@ REGRESSION_TEST(SDK_API_INKUrl) (RegressionTest * test, int atype, int *pstatus)
INKfree(url_string_from_print);
}
- // FTP Type
- if (INKUrlSchemeSet(bufp1, url_loc1, INK_URL_SCHEME_FTP, -1) != INK_SUCCESS) {
- SDK_RPRINT(test, "INKUrlSchemeSet", "TestCase2", TC_FAIL, "INKUrlSchemeSet Returned INK_ERROR");
- test_passed_scheme = false;
- }
-
if (INKUrlFtpTypeSet(bufp1, url_loc1, type) != INK_SUCCESS) {
SDK_RPRINT(test, "INKUrlFtpTypeSet", "TestCase1", TC_FAIL, "INKUrlFtpTypeSet Returned INK_ERROR");
} else {
@@ -6710,7 +6704,6 @@ typedef enum
ORIG_INK_CACHE_DATA_TYPE_MIXT_RTSP,
ORIG_INK_CACHE_DATA_TYPE_MIXT_WMT,
ORIG_INK_CACHE_DATA_TYPE_MIXT_QTIME,
- ORIG_INK_CACHE_DATA_TYPE_FTP,
ORIG_INK_CACHE_DATA_TYPE_OTHER
} ORIG_INKCacheDataType;
@@ -6879,7 +6872,6 @@ REGRESSION_TEST(SDK_API_INKConstant) (RegressionTest * test, int atype, int *pst
PRINT_DIFF(INK_CACHE_DATA_TYPE_MIXT_RTSP);
PRINT_DIFF(INK_CACHE_DATA_TYPE_MIXT_WMT);
PRINT_DIFF(INK_CACHE_DATA_TYPE_MIXT_QTIME);
- PRINT_DIFF(INK_CACHE_DATA_TYPE_FTP);
PRINT_DIFF(INK_CACHE_DATA_TYPE_OTHER);
PRINT_DIFF(INK_CACHE_ERROR_NO_DOC);
View
20 proxy/Main.cc
@@ -61,8 +61,6 @@ extern "C" int plock(int);
#include "Transform.h"
#include "ProcessManager.h"
#include "ProxyConfig.h"
-//#include "Ftp.h"
-//#include "FtpProxy.h"
#include "HttpProxyServerMain.h"
#include "HttpBodyFactory.h"
#include "logging/Log.h"
@@ -148,7 +146,6 @@ int run_test_hook = 0;
int http_accept_port_number = DEFAULT_HTTP_ACCEPT_PORT_NUMBER;
int http_accept_file_descriptor = NO_FD;
int ssl_accept_file_descriptor = NO_FD;
-int ftp_accept_file_descriptor = NO_FD;
int qt_accept_file_descriptor = NO_FD;
int dns_proxy_file_descriptor = NO_FD;
char accept_fd_list[1024] = "";
@@ -1016,9 +1013,6 @@ print_accept_fd(HttpPortEntry * e)
// If the SSL Accept fd is in the list, sets global
// ssl_accept_fd
//
-// If the FTP Accept fd is in the list, sets global
-// ftp_accept_file_descriptor
-//
// If there is no -A arg, returns NULL
//
// Otherwise returns an array of HttpPortEntry which
@@ -1069,11 +1063,6 @@ parse_accept_fd_list()
ink_assert(ssl_accept_file_descriptor == NO_FD);
ssl_accept_file_descriptor = fd;
continue;
- case 'F':
- // F is the special case of FTP
- ink_assert(ftp_accept_file_descriptor == NO_FD);
- ftp_accept_file_descriptor = fd;
- continue;
case 'Q':
// Q is the special case of QT port
ink_assert(qt_accept_file_descriptor == NO_FD);
@@ -1993,12 +1982,6 @@ main(int argc, char **argv)
//if (auto_clear_authdb_flag)
// acc.clear_cache();
//acc.start();
-#ifndef INK_NO_FTP
-#ifndef RNI_ONLY
- //ftpProcessor.start();
-#endif
-#endif
-
// pmgmt initialization moved up, needed by RecProcessInit
//pmgmt->start();
start_stats_snap();
@@ -2079,9 +2062,6 @@ main(int argc, char **argv)
cacheProcessor.hashtable_tracker.createHashTable();
}
}
-#ifndef INK_NO_FTP
- //ftpProxyProcessor.start();
-#endif
#ifndef INK_NO_ICP
icpProcessor.start();
#endif
View
1 proxy/Main.h
@@ -63,7 +63,6 @@ extern int accept_till_done;
//extern int ssl_enabled;
extern int http_accept_port_number;
extern int http_accept_file_descriptor;
-extern int ftp_accept_file_descriptor;
extern int command_flag;
extern int auto_clear_hostdb_flag;
extern int auto_clear_cache_flag;
View
1 proxy/ParentSelection.cc
@@ -1296,7 +1296,6 @@ EXCLUSIVE_REGRESSION_TEST(PARENTSELECTION) (RegressionTest * t, int intensity_le
T("url_regex=cyclops method=put parent=sandwich:80\n") /* L14 */
T("url_regex=cyclops method=trace parent=mayo:80\n") /* L15 */
T("dest_host=pluto scheme=HTTP parent=strategy:80\n") /* L16 */
- T("dest_host=jupiter scheme=FTP parent=accuracy:80\n") /* L17 */
REBUILD
// Test 3
ST(3) REINIT br(request, "numeric_host", IP(209, 131, 62, 14));
View
15 proxy/README-stats.otl
@@ -187,13 +187,6 @@ Types Of Stats:
** average time lag per event
** variance of time lag per event
-* ftp processor stats
- ** connections successful pasv
- ** connections failed pasv
- ** connections successful port
- ** connections failed port
- ** connections currently open
-
* socks processor stats
** connections unsuccessful
** connections successful
@@ -360,9 +353,6 @@ proxy.process.icp.invalid_icp_query_response
**** POSTs
**** DELETEs
**** CONNECTs
- *** number of FTP requests (needed only for ua->ts)
- **** PASV mode
- **** PORT mode
*** number of invalid requests
*** number of broken client connections
*** number of proxied requests
@@ -473,7 +463,7 @@ total/max active server connections
total/max active cache connections
total/max active parent proxy connections
average transaction rate
-total transaction count per protocol {dns, http, ftp, rtsp}
+total transaction count per protocol {dns, http, rtsp}
total bytes served to clients
total bytes from origin servers
total bytes from parent proxies
@@ -507,7 +497,7 @@ total/max active server connections
total/max active cache connections
number of active connections by connection status: ESTABLISHED, CLOSE_WAIT,
TIME_WAIT, ...
-total transaction count per protocol {dns, http, ftp, rtsp}
+total transaction count per protocol {dns, http, rtsp}
total/max active parent proxy connections
total bytes served to clients
total bytes from origin servers
@@ -614,7 +604,6 @@ Adam Beguelin wrote:
> o Server/Throttling of Network Connections
> o Protocols/HTTP timeouts (Leave anon and IP)
> o Protocols/SSL
-> o Protocols/FTP
> o Cache/Storage
> o Cache/Garbage Collection
> o Cache/Freshness
View
10 proxy/StatSystem.cc
@@ -1129,9 +1129,6 @@ TransactionMilestones::invariant()
((user_agent_begin <= raw_origin_server_connect_begin) ||
(raw_origin_server_connect_begin == 0)));
UIF(order_correct,
- ((user_agent_begin <= ftp_server_connect_begin) ||
- (ftp_server_connect_begin == 0)));
- UIF(order_correct,
((user_agent_begin <= cache_lookup_begin) || (cache_lookup_begin == 0)));
UIF(order_correct,
((user_agent_begin <= transform_open_begin) || (transform_open_begin == 0)));
@@ -1154,13 +1151,6 @@ TransactionMilestones::invariant()
UIF(order_correct, (raw_origin_server_connect_begin <= raw_origin_server_connect_end));
UIF(order_correct, (raw_origin_server_connect_end <= raw_origin_server_begin_read_write));
UIF(order_correct, (raw_origin_server_connect_end <= raw_origin_server_close));
- /////////////////
- // ftp server //
- /////////////////
- UIF(order_correct, (ftp_server_connect_begin <= ftp_server_connect_end));
- UIF(order_correct,
- ((ftp_server_connect_end <= ftp_server_read_begin) || (ftp_server_read_begin == 0)));
- UIF(order_correct, (ftp_server_read_begin <= ftp_server_read_end));
///////////
// cache //
///////////
View
2 proxy/StatSystem.h
@@ -64,7 +64,7 @@ class TransactionMilestones
ink_hrtime ua_close;
////////////////////////////////////////////////////////
- // server (origin_server , parent, ftp, blind tunnnel //
+ // server (origin_server , parent, blind tunnnel //
////////////////////////////////////////////////////////
ink_hrtime server_first_connect;
ink_hrtime server_connect;
View
3 proxy/TestPreProc.cc
@@ -136,9 +136,6 @@ dumpMessage(const HttpMessage & msg)
case HttpMessage::SCHEME_HTTP:
cout << "HTTP" << endl;
break;
- case HttpMessage::SCHEME_FTP:
- cout << "FTP" << endl;
- break;
}
cout << "Status code: " << msg.getStatusCode() << endl;
cout << "Request URI: " << msg.getRequestURI() << endl;
View
44 proxy/TestProxy.cc
@@ -30,7 +30,6 @@
#include <limits.h>
#include "Net.h"
#include "Disk.h"
-#include "Ftp.h"
#include "Main.h"
#include "HostDB.h"
#include "Cluster.h"
@@ -140,8 +139,7 @@ struct TestProxy:Continuation
SET_HANDLER(fileEvent);
diskProcessor.open_vc(this, url, O_RDONLY);
return EVENT_DONE;
- } else if (s[4] == 'f' || s[4] == 'F')
- thost = s + 10; // GET ftp
+ }
else
thost = s + 11; // GET http
url = strchr(thost, '/'); // done before portStr stompage */
@@ -233,33 +231,19 @@ struct TestProxy:Continuation
int dnsEvent(int event, HostDBInfo * info)
{
- char ftppath[1023];
if (!info) {
printf("TestProxy dnsEvent error %d\n", event);
return done();
}
- if (s[4] == 'f' || s[4] == 'F') {
- SET_HANDLER(ftpEvent);
- ftppath[0] = '/';
- ink_assert(url_end > url);
- memcpy((ftppath + 1), (url + 1), (url_end - url - 1));
- ftppath[url_end - url] = '\0';
- cout << "Ftp proxy: pathname<" << ftppath << ">\n";
- cout.flush();
- if (ftppath[url_end - url - 1] == '/')
- ftpProcessor.opendirectory(this, info->ip, ftppath, 0, "anonymous", "foo@inktomi.com", PASV);
- else
- ftpProcessor.openfile(this, info->ip, ftppath, 0, "anonymous", "foo@inktomi.com", PASV);
- } else {
- SET_HANDLER(cacheCheckEvent);
- url_struct = new URL((const char *) url_str, sizeof(url_str), true);
- hostdbinfo = info;
- cacheProcessor.lookup(this, url_struct);
- // SET_HANDLER(connectEvent);
- // netProcessor.connect(this,info->ip,port,host);
- }
+ SET_HANDLER(cacheCheckEvent);
+ url_struct = new URL((const char *) url_str, sizeof(url_str), true);
+ hostdbinfo = info;
+ cacheProcessor.lookup(this, url_struct);
+ // SET_HANDLER(connectEvent);
+ // netProcessor.connect(this,info->ip,port,host);
return EVENT_DONE;
}
+
int cacheCheckEvent(int event, void *data)
{
if (event == CACHE_EVENT_LOOKUP) {
@@ -366,18 +350,6 @@ struct TestProxy:Continuation
return EVENT_CONT;
}
- int ftpEvent(int event, FtpVConnection * aremote)
- {
- if (event != FTP_EVENT_OPEN) {
- printf("TestProxy ftpEvent error %d\n", event);
- return done();
- }
- remote = aremote;
- SET_HANDLER(tunnelEvent);
- tunnel = new OneWayTunnel(remote, vc, this, TUNNEL_TILL_DONE, true, true, true);
- return EVENT_CONT;
- }
-
int sendEvent(int event, VIO * vio)
{
if (event != VC_EVENT_WRITE_READY) {
View
989 proxy/Transform.cc
@@ -110,16 +110,6 @@ TransformProcessor::null_transform(ProxyMutex *mutex)
return NEW(new NullTransform(mutex));
}
-/*-------------------------------------------------------------------------
- -------------------------------------------------------------------------*/
-
-INKVConnInternal *
-TransformProcessor::ftp_list_transform(ProxyMutex *mutex,
- HTTPHdr *req, IOBufferReader *ftp_message, const char *currentdir)
-{
- return NEW(new FtpListTransform(mutex, req, ftp_message, currentdir));
-}
-
/*-------------------------------------------------------------------------
-------------------------------------------------------------------------*/
@@ -759,985 +749,6 @@ NullTransform::handle_event(int event, void *edata)
/*-------------------------------------------------------------------------
- Transforms incoming text formatted as an ftp directory listing into
- HTML. This transformation cannot actually be a plugin since a) it
- uses a non-standard method for getting prepended to the list of
- transformations, b) it is given a non-standard buffer containing a
- message to be inserted in the outgoing HTML and c) it uses the
- MimeTable for guessing the mime type given a filename in order to
- assign icons in a reasonable fashion. Reason c) could be eliminated
- by adding a mime guessing routine to the plugin, but reasons a) and
- b) are somewhat hard to overcome.
- -------------------------------------------------------------------------*/
-
-FtpListTransform::FtpListTransform(ProxyMutex *_mutex,
- HTTPHdr *req, IOBufferReader *ftp_message, const char *currentdir)
-:INKVConnInternal(NULL, _mutex),
-m_req(req),
-m_ftp_message(ftp_message),
-m_output_reader(NULL),
-m_output_buf(NULL),
-m_output_vio(NULL),
-m_url(NULL),
-m_url_length(0),
-m_done(0),
-m_header_needed(1), m_trailer_needed(1), m_icon_needed(0), m_current_dir(currentdir), parent_directory_added_flag(0)
-{
- const char *val;
- char *old_path = 0;
- int old_path_len = 0;
- int val_len;
-
- SET_HANDLER(&FtpListTransform::handle_event);
-
- mime_scanner_init(&m_scanner);
-
- // this is the place we hack the url to add in absolute path
- // INKqa 05662 & INKqa 06110
- val = m_req->url_get()->path_get(&val_len);
- if (val && val_len > 0) {
- old_path = xstrndup(val, val_len);
- old_path_len = val_len;
- }
-
-
- if (currentdir) {
- int currentdir_len = strlen(currentdir);
- if (currentdir_len > 1) {
- m_req->url_get()->path_set(currentdir + 1, currentdir_len - 1);
- }
- }
-
- m_url = m_req->url_get()->string_get(NULL, &m_url_length);
-
- if (m_current_dir == NULL) {
- if (old_path) {
- m_current_dir = (const char *) old_path;
- old_path = NULL;
- } else {
- char *temp = (char *) xmalloc(2);
- *temp = '/';
- *(temp + 1) = '\0';
- m_current_dir = (const char *) temp;
- }
- }
- // INKQA05662 & INKqa06110
- if (old_path) {
- m_req->url_get()->path_set(old_path, old_path_len);
- xfree(old_path);
- } else
- m_req->url_get()->path_set("", 0);
-
- val = req->value_get(MIME_FIELD_USER_AGENT, MIME_LEN_USER_AGENT, &val_len);
-
- // if the user agent field starts with "Mozilla/" we know
- // this is either a netscape or msie user agent
- const char *val_new;
- if (val && ptr_len_ncmp(val, val_len, "Mozilla/", 8) == 0) {
- // search for the word "compatible" in the remaining string.
- val += 8;
- val_len -= 8;
- for (;;) {
- val_new = ptr_len_pbrk(val, val_len, "Cc");
-
- if (val_new) {
- val_len -= val_new - val;
- ink_assert(val_len > 0);
- val = val_new;
- } else {
- // We're out of string
- break;
- }
-
- // Check for the word "compatible" now that we've
- // something starting with a 'c'
- if (ptr_len_ncasecmp(val, val_len, "compatible", 10) == 0) {
- break;
- }
-
- val += 1;
- val_len--;
- }
-
- // if we didn't find the word "compatible" then this is
- // a netscape user agent.
- if (!val_new) {
- // user agent is Netscape
- m_icon_needed = 1;
- } else {
- // if the string "MSIE" exists in the rest of the
- // user agent field we know we are dealing with an
- // MSIE user agent. otherwise the user agent is unknown.
- val += 10;
- val_len -= 10;
- for (;;) {
- val_new = ptr_len_pbrk(val, val_len, "Mm");
-
- if (val_new) {
- val_len -= val_new - val;
- ink_assert(val_len > 0);
- val = val_new;
- } else {
- // We're out of string
- break;
- }
-
- // Check for the word "msie" now that we've
- // something starting with a 'm'
- if (ptr_len_ncasecmp(val, val_len, "msie", 4) == 0) {
- break;
- }
- val += 1;
- val_len -= 1;
- }
-
- if (val_new) {
- // user agent is MS internet explorer
- }
- }
- }
-}
-
-/*-------------------------------------------------------------------------
- -------------------------------------------------------------------------*/
-
-FtpListTransform::~FtpListTransform()
-{
- if (m_output_buf) {
- free_MIOBuffer(m_output_buf);
- }
-
- if (m_ftp_message) {
- MIOBuffer *mbuf = m_ftp_message->mbuf;
- m_ftp_message->dealloc();
-
- // when we start up, Ftp give us
- // control of both the reader AND the buffer. We
- // need to free the buffer.
- free_MIOBuffer(mbuf);
- }
-
- if (m_url) {
- xfree(m_url);
- }
-
- mime_scanner_clear(&m_scanner);
-}
-
-/*-------------------------------------------------------------------------
- -------------------------------------------------------------------------*/
-
-int
-FtpListTransform::handle_event(int event, void *edata)
-{
- handle_event_count(event);
-
- if (m_closed) {
- if (m_deletable) {
- Debug("transform", "FtpListTransform destroy: %d", m_output_vio ? m_output_vio->ndone : 0);
- delete this;
- }
- } else {
- switch (event) {
- case VC_EVENT_ERROR:
- m_write_vio._cont->handleEvent(VC_EVENT_ERROR, &m_write_vio);
- break;
- case VC_EVENT_WRITE_COMPLETE:
- ink_assert(m_output_vio == (VIO *) edata);
-
- // The write to the output vconnection completed. This
- // could only be the case if the data being fed into us
- // has also completed.
- ink_assert(m_write_vio.ntodo() == 0);
-
- m_output_vc->do_io_shutdown(IO_SHUTDOWN_WRITE);
- break;
- case VC_EVENT_WRITE_READY:
- default:
- ink_assert(m_output_vc != NULL);
-
- if (!m_output_vio) {
- m_output_buf = new_empty_MIOBuffer();
- m_output_reader = m_output_buf->alloc_reader();
- m_output_vio = m_output_vc->do_io_write(this, INT_MAX, m_output_reader);
- add_header();
- }
-
- MUTEX_TRY_LOCK(trylock, m_write_vio.mutex, this_ethread());
- if (!trylock) {
- retry(10);
- return 0;
- }
-
- if (m_closed) {
- return 0;
- }
-
- if (m_write_vio.op == VIO::NONE) {
- add_trailer();
- m_output_vio->nbytes = m_done;
- m_output_vio->reenable();
- return 0;
- }
-
- add_entries();
- break;
- }
- }
-
- return 0;
-}
-
-/*-------------------------------------------------------------------------
- -------------------------------------------------------------------------*/
-
-void
-FtpListTransform::add_header()
-{
- static char l1[] = "<!-- HTML listing generated by Inktomi Traffic Server -->\n";
- static char l2s[] = "<!-- ";
- static char l2e[] = " -->\n";
-
- static char l3[] = "<HTML>\n<HEAD>\n<TITLE>\nFtp Directory\n";
- static char l4[] = "\n</TITLE>\n</HEAD>\n<BODY>\n";
- static char l5[] = "<HR><PRE>\n";
- static char l6[] = "</PRE><HR>\n";
-
- static char h1[] = "<H2>\nCurrent Directory ";
- static char h2[] = "\n</H2>\n";
- static char h3[] = "<PRE>\n";
-
- int avail;
-
- if (m_header_needed) {
- char buf[33];
- int l;
-
- m_header_needed = 0;
-
- m_done = m_output_buf->write(l1, sizeof(l1) - 1);
-
- m_done += m_output_buf->write(l2s, sizeof(l2s) - 1);
- l = mime_format_date(buf, time(0));
- m_done += m_output_buf->write(buf, l - 1);
- m_done += m_output_buf->write(l2e, sizeof(l2e) - 1);
-
- m_done += m_output_buf->write(l3, sizeof(l3) - 1);
- m_done += m_output_buf->write(m_url, m_url_length);
- m_done += m_output_buf->write(l4, sizeof(l4) - 1);
-
- m_done += m_output_buf->write(h1, sizeof(h1) - 1);
- if (m_current_dir != NULL)
- m_done += m_output_buf->write(m_current_dir, strlen(m_current_dir));
- m_done += m_output_buf->write(h2, sizeof(h2) - 1);
-
- if (m_ftp_message && (avail = m_ftp_message->read_avail()) > 0) {
- m_done += m_output_buf->write(l5, sizeof(l5) - 1);
- m_done += m_output_buf->write(m_ftp_message, avail);
- m_done += m_output_buf->write(l6, sizeof(l6) - 1);
- }
-
- m_done += m_output_buf->write(h3, sizeof(h3) - 1);
- }
-}
-
-/*-------------------------------------------------------------------------
- -------------------------------------------------------------------------*/
-
-void
-FtpListTransform::add_trailer()
-{
- static char l1[] = "</PRE>\n</BODY>\n</HTML>\n";
-
- if (m_trailer_needed) {
- m_trailer_needed = 0;
- m_done += m_output_buf->write(l1, sizeof(l1) - 1);
- }
-}
-
-/*-------------------------------------------------------------------------
- -------------------------------------------------------------------------*/
-
-void
-FtpListTransform::add_date(struct tm *tp)
-{
- static const char *months[] = { "Jan ", "Feb ", "Mar ", "Apr ", "May ", "Jun ",
- "Jul ", "Aug ", "Sep ", "Oct ", "Nov ", "Dec "
- };
- static const char *digitstrs[] = {
- "00", "01", "02", "03", "04", "05", "06", "07", "08", "09",
- "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
- "20", "21", "22", "23", "24", "25", "26", "27", "28", "29",
- "30", "31", "32", "33", "34", "35", "36", "37", "38", "39",
- "40", "41", "42", "43", "44", "45", "46", "47", "48", "49",
- "50", "51", "52", "53", "54", "55", "56", "57", "58", "59",
- "60", "61", "62", "63", "64", "65", "66", "67", "68", "69",
- "70", "71", "72", "73", "74", "75", "76", "77", "78", "79",
- "80", "81", "82", "83", "84", "85", "86", "87", "88", "89",
- "90", "91", "92", "93", "94", "95", "96", "97", "98", "99",
- };
-
- m_done += m_output_buf->write(months[tp->tm_mon], 4);
-
- int day = tp->tm_mday;
- if ((day<0) || (day> 31)) {
- day = 0;
- }
- m_done += m_output_buf->write(digitstrs[day], 2);
- m_done += m_output_buf->write(" ", 1);
-
- if (tp->tm_year > 0) {
- int year = tp->tm_year;
- if (year < 200) {
- if (year < 100) {
- m_done += m_output_buf->write(digitstrs[19], 2);
- } else {
- m_done += m_output_buf->write(digitstrs[20], 2);
- year -= 100;
- }
- m_done += m_output_buf->write(digitstrs[year], 2);
- } else {
- // this should not happen, just to get rid of coverity complain.
- m_done += m_output_buf->write("????", 4);
- }
- m_done += m_output_buf->write(" ", 3);
- } else {
- int hour = tp->tm_hour;
- int min = tp->tm_min;
-
- if ((hour<0) || (hour>= 24)) {
- hour = 0;
- }
- if ((min<0) || (min>= 60)) {
- min = 0;
- }
-
- m_done += m_output_buf->write(digitstrs[hour], 2);
- m_done += m_output_buf->write(":", 1);
- m_done += m_output_buf->write(digitstrs[min], 2);
- m_done += m_output_buf->write(" ", 2);
- }
-}
-
-/*-------------------------------------------------------------------------
- <size> <month> <day> <year> <name ...>
- <size> <month> <day> <hh:mm> <name ...>
- -------------------------------------------------------------------------*/
-void
-FtpListTransform::add_entry(const char *s, const char *e)
-{
- const char *cur = s;
- const char *end = e;
-
- while ((cur != end) && ParseRules::is_ws(*cur)) {
- cur += 1;
- }
- if (cur == end) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
-
- if (ParseRules::is_digit(*cur)) {
- // listing is starting with a number
- // assume that its ms.
- parse_ms_listing(s, e, cur);
- return;
- }
- // otherwise assume its a unix listing
- parse_unix_listing(s, e, cur);
-}
-
-void
-FtpListTransform::parse_ms_listing(const char *s, const char *e, const char *cur)
-{
- const char *end = e;
- const char *te;
- const char *ne;
- const char *ns;
- const char *nm;
- int type = -1;
- struct tm tp;
- int size = -1;
-
-
- tp.tm_year = 0;
- tp.tm_mon = 0;
- tp.tm_mday = 0;
- tp.tm_hour = 0;
- tp.tm_min = 0;
- tp.tm_sec = 0;
-
- // parse month
- te = cur;
- while ((te != end) && (*te != '-')) {
- te += 1;
- }
- if (te == end) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- if (!mime_parse_integer(cur, te, &tp.tm_mon)) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
-
-
- // parse day
- cur = te + 1;
- te = cur;
- while ((te != end) && (*te != '-')) {
- te += 1;
- }
- if (te == end) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- if (!mime_parse_integer(cur, te, &tp.tm_mday)) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- // need to -1 to get the correct month
- // to adjust to the months table in add_date function
- tp.tm_mon--;
-
- // parse year
- cur = te + 1;
- te = cur;
- while ((te != end) && !ParseRules::is_ws(*te)) {
- te += 1;
- }
- if (te == end) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- if (!mime_parse_integer(cur, te, &tp.tm_year)) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- // skip the whitespaces
- cur = te + 1;
- while ((cur != end) && ParseRules::is_ws(*cur)) {
- cur += 1;
- }
- if (cur == end) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- // parse time - first the hour
- te = cur;
- while ((te != end) && (*te != ':') && !ParseRules::is_ws(*te)) {
- te += 1;
- }
- if (te == end) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- if (!mime_parse_integer(cur, te, &tp.tm_hour)) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- // now the minutes
- cur = te + 1;
- te = cur;
-
- // should keep AM/PM
- while ((te != end) && ParseRules::is_digit(*te)) {
- te += 1;
- }
- if (te == end) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- if (!mime_parse_integer(cur, te, &tp.tm_min)) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- // am or pm?
- // now te should be 'A' or 'P'
- cur = te;
-
- if (ParseRules::is_alpha(*cur)) {
- if (*cur == 'P')
- if (tp.tm_hour < 12)
- tp.tm_hour += 12;
- cur += 2;
- }
- // skip the whitespaces
- while ((cur != end) && ParseRules::is_ws(*cur)) {
- cur += 1;
- }
- if (cur == end) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- // ok, now the puppy could be a directory,
- // or it could be the size of the file.
- if (ParseRules::is_digit(*cur)) {
- // looks like a size to me, amigo
- if (!mime_parse_integer(cur, end, &size)) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- // regular file
- type = S_IFREG;
- } else {
- if (*cur != '<') {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- cur += 1;
- while ((cur != end) && ParseRules::is_alpha(*cur)) {
- cur += 1;
- }
- if (cur == end) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- if (*cur != '>') {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- cur += 1;
- // directory
- type = S_IFDIR;
- }
-
- // skip whitespaces
- while ((cur != end) && ParseRules::is_ws(*cur)) {
- cur += 1;
- }
- if (cur == end) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- //parse name
- ns = cur;
- ne = ns;
- nm = ns;
-
- // for MS FTP server, directory and file names could have
- // white spaces in it
- if (!ParseRules::is_ws(*ne)) {
- while ((ne != end) && (*ne != '\r') && (*ne != '\n')) {
- if (!ParseRules::is_ws(*ne)) {
- // nm to keep track of the last non-ws char
- // using nm in case there are redundant trailing ws
- nm = ne;
- }
-
- ne += 1;
- }
- }
- // done
- if (ns == ne) {
- return;
- }
- // ignoring trailing white spaces
- ne = nm + 1;
- // . or ..
- if ((ns[0] == '.') && ((&ns[1] == ne) || ((ns[1] == '.') && (&ns[2] == ne)))) {
- return;
- }
-
- write_html_link(s, e, cur, type, ne, ns, &tp, size);
-}
-
-void
-FtpListTransform::parse_unix_listing(const char *s, const char *e, const char *cur)
-{
- const char *end = e;
-
- const char *ss = NULL;
- const char *ns = NULL;
- const char *ne = NULL;
- const char *nm = NULL;
- const char *ts = NULL;
- const char *te = NULL;
- int type = -1;
- int size = -1;
- struct tm tp;
-
-
- // parse file type
- switch (*cur) {
- case 'd':
- type = S_IFDIR;
- break;
- case 'l':
- type = S_IFLNK;
- break;
- case 'b':
- case 'c':
- case 'p':
- case '-':
- case '|':
- type = S_IFREG;
- break;
- default:
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
-
- tp.tm_year = 0;
- tp.tm_mon = 0;
- tp.tm_mday = 0;
- tp.tm_hour = 0;
- tp.tm_min = 0;
- tp.tm_sec = 0;
-
- // parse month
- for (;;) {
- while ((cur != end) && !ParseRules::is_alpha(*cur)) {
- cur += 1;
- }
- if (cur == end) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
-
- if (mime_parse_month(cur, end, &tp.tm_mon)) {
- break;
- }
-
- while ((cur != end) && !ParseRules::is_ws(*cur)) {
- cur += 1;
- }
- if (cur == end) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- }
-
- // parse size
- ss = cur;
- while ((ss != s) && !ParseRules::is_digit(*ss)) {
- ss -= 1;
- }
- if (ss == s) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- while ((ss != s) && ParseRules::is_digit(*ss)) {
- ss -= 1;
- }
- ss += 1;
- if (!mime_parse_integer(ss, cur, &size)) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- // parse day
- if (!mime_parse_mday(cur, end, &tp.tm_mday)) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
-
- while ((cur != end) && ParseRules::is_ws(*cur)) {
- cur += 1;
- }
- if (cur == end) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- // parse time
- ts = cur;
- te = ts;
-
- while ((te != end) && (*te != ':') && !ParseRules::is_ws(*te)) {
- te += 1;
- }
-
- if ((te == end) || (*te != ':')) {
- // parse year
- if (!mime_parse_year(ts, te, &tp.tm_year)) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- } else {
- // parse hours and minutes
- if (!mime_parse_integer(ts, te, &tp.tm_hour)) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- te += 1;
- if (!mime_parse_integer(te, end, &tp.tm_min)) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- }
-
- cur = te;
-
- // parse name
- while ((cur != end) && ParseRules::is_ws(*cur)) {
- cur += 1;
- }
- if (cur == end) {
- FtpListTransform::send_error_message(s, e, cur);
- return;
- }
- // same thing for Unix based Ftp server!
- ns = cur;
- nm = ne = ns;
-
- // ftp.microsoft.com sends back Unix format containing MS file names!
- if (!ParseRules::is_ws(*ne)) {
- while ((ne != end) && (*ne != '\r') && (*ne != '\n')) {
- if (!ParseRules::is_ws(*ne)) {
- // nm to keep track of the last non-ws char
- // using nm in case there are redundant trailing ws
- nm = ne;
- }
-
- ne += 1;
- }
- }
- // done
- if (ns == ne) {
- return;
- }
- //ignoring trailing white spaces
- ne = nm + 1;
- // . or ..
- if ((ns[0] == '.') && ((&ns[1] == ne) || ((ns[1] == '.') && (&ns[2] == ne)))) {
- return;
- }
-
- write_html_link(s, e, cur, type, ne, ns, &tp, size);
-}
-
-void
-FtpListTransform::write_html_link(const char *s,
- const char *e,
- const char *cur, int type, const char *ne, const char *ns, struct tm *tp, int size)
-{
- static char icon_fmt[] = "<IMG ALIGN=absbottom BORDER=0 SRC=\"internal-gopher-%s\" ALT=\"[%s] \">";
- static char directory[] = "Directory";
- static char symbolic_link[] = "Symbolic link";
- static char href_start[] = "<A HREF=\"";
- static char href_end[] = "\">";
- static const int entry_type_length = sizeof(symbolic_link) - 1;
- static const int size_length = 12;
- static const int date_length = 14;
- static const int name_length = 80 - (entry_type_length + size_length + date_length + 1);
- char tmp_buf[256];
- const char *ne_real, *ne_real_forward; // handle symbolic link
-
- // write the html link
- m_done += m_output_buf->write(href_start, sizeof(href_start) - 1);
- m_done += m_output_buf->write(m_url, m_url_length);
- if (m_url[m_url_length - 1] != '/') {
- m_done += m_output_buf->write("/", 1);
- }
- ne_real = ns;
- for (ne_real = ns, ne_real_forward = ns + 1; ne_real != ne; ne_real++, ne_real_forward++) {
- if (ne_real_forward == ne) {
- ne_real = ne;
- break;
- }
- // symbolic link
- if (*ne_real == '-' && *ne_real_forward == '>') {
- // look for the last non white space char
- ne_real--;
- for (; ne_real != ns; ne_real--) {
- if (*ne_real != ' ') {
- ne_real++;
- break;
- }
- }
- break;
- }
- }
- m_done += m_output_buf->write(ns, ne_real - ns);
- if (S_ISDIR(type) && (ne[-1] != '/')) {
- m_done += m_output_buf->write("/", 1);
- }
- m_done += m_output_buf->write(href_end, sizeof(href_end) - 1);
-
- if (m_icon_needed) {
- const char *icon;
- const char *alt;
-
- if (S_ISDIR(type) || S_ISLNK(type)) {
- icon = "menu";
- alt = "DIR";
- } else {
- if ((ne - ns) > (int) (sizeof(tmp_buf) - 1)) {
- icon = "unknown";
- } else {
- MimeTableEntry *entry;
- memcpy(tmp_buf, ns, ne - ns);