You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bn...@apache.org on 2021/09/09 16:32:59 UTC
[trafficserver] branch 10-Dev updated: Revert "Remove incompatible
changes for 9.2.0 (#8316)"
This is an automated email from the ASF dual-hosted git repository.
bneradt pushed a commit to branch 10-Dev
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/10-Dev by this push:
new 4deeb25 Revert "Remove incompatible changes for 9.2.0 (#8316)"
4deeb25 is described below
commit 4deeb251b5fef241c40ff5b168125bd6059d865b
Author: Brian Neradt <br...@gmail.com>
AuthorDate: Thu Sep 9 16:30:02 2021 +0000
Revert "Remove incompatible changes for 9.2.0 (#8316)"
This reverts commit 4208ecb8719add76aa46ab2005ff9424531e2e73.
Reverting the removal of the incompatible changes that we took out of
master so that those incompatible changes will be in our 10-Dev branch.
---
configs/records.config.default.in | 2 -
doc/.tx/config | 6 +-
doc/admin-guide/files/records.config.en.rst | 47 +---
doc/admin-guide/files/sni.yaml.en.rst | 3 -
doc/admin-guide/performance/index.en.rst | 19 --
doc/admin-guide/plugins/lua.en.rst | 1 -
.../api/functions/TSContScheduleEvery.en.rst | 58 ----
...ule.en.rst => TSContScheduleEveryOnPool.en.rst} | 28 +-
.../api/functions/TSContScheduleOnPool.en.rst | 25 +-
.../api/functions/TSContScheduleOnThread.en.rst | 17 +-
.../api/functions/TSContThreadAffinitySet.en.rst | 4 +-
.../api/functions/TSHttpOverridableConfig.en.rst | 2 -
.../api/functions/TSHttpTxnAborted.en.rst | 6 +-
.../api/types/TSOverridableConfigKey.en.rst | 1 -
.../continuations/activating-continuations.en.rst | 2 +-
.../plugins/continuations/index.en.rst | 2 +-
.../continuations/writing-handler-functions.en.rst | 5 +-
...ntSchedule.en.po => TSContScheduleOnPool.en.po} | 10 +-
.../api/functions/TSHttpOverridableConfig.en.po | 4 -
.../continuations/activating-continuations.en.po | 4 +-
.../plugins/continuations/index.en.po | 4 +-
.../continuations/writing-handler-functions.en.po | 8 +-
doc/release-notes/whats-new.en.rst | 6 +
.../plugins/c-api/request_buffer/request_buffer.c | 2 +-
include/ts/apidefs.h.in | 297 +++++++++++----------
include/ts/ts.h | 5 +-
iocore/net/YamlSNIConfig.cc | 4 -
iocore/net/YamlSNIConfig.h | 1 -
lib/perl/lib/Apache/TS/AdminClient.pm | 2 -
mgmt/RecordsConfig.cc | 14 +-
plugins/esi/esi.cc | 3 +-
plugins/lua/ts_lua_http.c | 4 +-
plugins/lua/ts_lua_http_config.c | 6 -
proxy/ProxySession.cc | 2 +-
proxy/http/HttpConfig.cc | 21 +-
proxy/http/HttpConfig.h | 6 +-
proxy/http/HttpConnectionCount.cc | 59 ++--
proxy/http/HttpConnectionCount.h | 15 +-
proxy/http/HttpDebugNames.cc | 4 +-
proxy/http/HttpSM.cc | 59 ++--
proxy/http/HttpTransact.cc | 9 +-
src/shared/overridable_txn_vars.cc | 5 -
src/traffic_server/InkAPI.cc | 79 +-----
src/traffic_server/InkAPITest.cc | 7 +-
tests/gold_tests/cont_schedule/gold/schedule.gold | 4 -
tests/gold_tests/cont_schedule/schedule.test.py | 49 ----
tests/gold_tests/pluginTest/test_hooks/200.gold | 28 ++
.../pluginTest/test_hooks/body_buffer.test.py | 121 +++++++++
tests/gold_tests/timeout/tls_conn_timeout.test.py | 1 -
tests/gold_tests/tls/tls_verify_base.test.py | 3 +-
.../tls/tls_verify_override_base.test.py | 3 +-
tests/tools/plugins/cont_schedule.cc | 87 +-----
52 files changed, 459 insertions(+), 705 deletions(-)
diff --git a/configs/records.config.default.in b/configs/records.config.default.in
index 2f2b617..dc22bf7 100644
--- a/configs/records.config.default.in
+++ b/configs/records.config.default.in
@@ -35,7 +35,6 @@ CONFIG proxy.config.http.insert_response_via_str INT 0
# https://docs.trafficserver.apache.org/en/latest/admin-guide/files/parent.config.en.html
##############################################################################
CONFIG proxy.config.http.parent_proxy.retry_time INT 300
-CONFIG proxy.config.http.parent_proxy.connect_attempts_timeout INT 30
CONFIG proxy.config.http.forward.proxy_auth_to_parent INT 0
CONFIG proxy.config.http.uncacheable_requests_bypass_parent INT 1
@@ -60,7 +59,6 @@ CONFIG proxy.config.http.connect_attempts_max_retries INT 3
CONFIG proxy.config.http.connect_attempts_max_retries_dead_server INT 1
CONFIG proxy.config.http.connect_attempts_rr_retries INT 3
CONFIG proxy.config.http.connect_attempts_timeout INT 30
-CONFIG proxy.config.http.post_connect_attempts_timeout INT 1800
CONFIG proxy.config.http.down_server.cache_time INT 60
##############################################################################
diff --git a/doc/.tx/config b/doc/.tx/config
index 317fba5..b3e1f73 100644
--- a/doc/.tx/config
+++ b/doc/.tx/config
@@ -697,9 +697,9 @@ file_filter = locale/<lang>/LC_MESSAGES/developer-guide/api/functions/TSContMute
source_file = _build/locale/pot/developer-guide/api/functions/TSContMutexGet.en.pot
source_lang = en
-[apache-traffic-server-6x.developer-guide--api--functions--TSContSchedule_en]
-file_filter = locale/<lang>/LC_MESSAGES/developer-guide/api/functions/TSContSchedule.en.po
-source_file = _build/locale/pot/developer-guide/api/functions/TSContSchedule.en.pot
+[apache-traffic-server-6x.developer-guide--api--functions--TSContScheduleOnPool_en]
+file_filter = locale/<lang>/LC_MESSAGES/developer-guide/api/functions/TSContScheduleOnPool.en.po
+source_file = _build/locale/pot/developer-guide/api/functions/TSContScheduleOnPool.en.pot
source_lang = en
[apache-traffic-server-6x.developer-guide--api--functions--TSDebug_en]
diff --git a/doc/admin-guide/files/records.config.en.rst b/doc/admin-guide/files/records.config.en.rst
index 62504b4..114fd38 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -1296,14 +1296,6 @@ Parent Proxy Configuration
The total number of connection attempts allowed per parent for a specific
transaction, if multiple parents are used.
-.. ts:cv:: CONFIG proxy.config.http.parent_proxy.connect_attempts_timeout INT 30
- :reloadable:
- :overridable:
-
- The timeout value (in seconds) for parent cache connection attempts.
-
- See :ref:`admin-performance-timeouts` for more discussion on |TS| timeouts.
-
.. ts:cv:: CONFIG proxy.config.http.parent_proxy.mark_down_hostdb INT 0
:reloadable:
:overridable:
@@ -1573,15 +1565,9 @@ Origin Server Connect Attempts
Set a limit for the number of concurrent connections to an upstream server group. A value of
``0`` disables checking. If a transaction attempts to connect to a group which already has the
- maximum number of concurrent connections the transaction either rechecks after a delay or a 503
+ maximum number of concurrent connections a 503
(``HTTP_STATUS_SERVICE_UNAVAILABLE``) error response is sent to the user agent. To configure
- Number of transactions that can be delayed concurrently
- See :ts:cv:`proxy.config.http.per_server.connection.queue_size`.
-
- How long to delay before rechecking
- See :ts:cv:`proxy.config.http.per_server.connection.queue_delay`.
-
Upstream server group definition
See :ts:cv:`proxy.config.http.per_server.connection.match`.
@@ -1615,26 +1601,6 @@ Origin Server Connect Attempts
This setting is independent of the :ts:cv:`setting for upstream session sharing matching
<proxy.config.http.server_session_sharing.match>`.
-.. ts:cv:: CONFIG proxy.config.http.per_server.connection.queue_size INT 0
- :reloadable:
-
- Controls the number of transactions that can be waiting on an upstream server group.
-
- ``-1``
- Unlimited.
-
- ``0``
- Never wait. If the connection maximum has been reached immediately respond with an error.
-
- A positive number
- If there are less than this many waiting transactions, delay this transaction and try again. Otherwise respond immediately with an error.
-
-.. ts:cv:: CONFIG proxy.config.http.per_server.connection.queue_delay INT 100
- :reloadable:
- :units: milliseconds
-
- If a transaction is delayed due to too many connections in an upstream server group, delay this amount of time before checking again.
-
.. ts:cv:: CONFIG proxy.config.http.per_server.connection.alert_delay INT 60
:reloadable:
:units: seconds
@@ -1668,15 +1634,6 @@ Origin Server Connect Attempts
See :ref:`admin-performance-timeouts` for more discussion on |TS| timeouts.
-.. ts:cv:: CONFIG proxy.config.http.post_connect_attempts_timeout INT 1800
- :reloadable:
- :overridable:
-
- The timeout value (in seconds) for an origin server connection when the client request is a ``POST`` or ``PUT``
- request.
-
- See :ref:`admin-performance-timeouts` for more discussion on |TS| timeouts.
-
.. ts:cv:: CONFIG proxy.config.http.post.check.content_length.enabled INT 1
Enables (``1``) or disables (``0``) checking the Content-Length: Header for a POST request.
@@ -3773,7 +3730,7 @@ SSL Termination
Client-Related Configuration
----------------------------
-.. ts:cv:: CONFIG proxy.config.ssl.client.verify.server.policy STRING PERMISSIVE
+.. ts:cv:: CONFIG proxy.config.ssl.client.verify.server.policy STRING ENFORCED
:reloadable:
:overridable:
diff --git a/doc/admin-guide/files/sni.yaml.en.rst b/doc/admin-guide/files/sni.yaml.en.rst
index 5577671..2ee7f19 100644
--- a/doc/admin-guide/files/sni.yaml.en.rst
+++ b/doc/admin-guide/files/sni.yaml.en.rst
@@ -121,9 +121,6 @@ client_sni_policy Outbound Policy of SNI on outbound connection.
http2 Inbound Indicates whether the H2 protocol should be added to or removed from the
protocol negotiation list. The valid values are :code:`on` or :code:`off`.
-disable_h2 Inbound Deprecated for the more general h2 setting. Setting disable_h2
- to :code:`true` is the same as setting http2 to :code:`on`.
-
tunnel_route Inbound Destination as an FQDN and port, separated by a colon ``:``.
Match group number can be specified by ``$N`` where N should refer to a specified group
in the FQDN, ``tunnel_route: $1.domain``.
diff --git a/doc/admin-guide/performance/index.en.rst b/doc/admin-guide/performance/index.en.rst
index 639c2af..6730544 100644
--- a/doc/admin-guide/performance/index.en.rst
+++ b/doc/admin-guide/performance/index.en.rst
@@ -331,28 +331,9 @@ connection attempt until the origin fully establishes a connection (the connecti
After the connection is established the value of
:ts:cv:`proxy.config.http.transaction_no_activity_timeout_out` is used to established timeouts on the data over the connection.
-In the case where you wish to have a different (generally longer) timeout for
-``POST`` and ``PUT`` connections to an origin server, you may also adjust
-:ts:cv:`proxy.config.http.post_connect_attempts_timeout` which applies only to
-origin connections using those HTTP verbs.
-
::
CONFIG proxy.config.http.connect_attempts_timeout INT 30
- CONFIG proxy.config.http.post_connect_attempts_timeout INT 1800
-
-Parent Proxy Timeout
-~~~~~~~~~~~~~~~~~~~~
-
-In hierarchical caching configurations, the :ts:cv:`proxy.config.http.parent_proxy.connect_attempts_timeout`
-setting is used for all connection attempts to parent caches. It may be useful,
-in cases where you wish to have |TS| fall back to an alternate parent cache
-(in configurations where you have multiple parents for the same cache) more
-quickly, to lower this timeout.
-
-::
-
- CONFIG proxy.config.http.parent_proxy.connect_attempts_timeout INT 30
Polling Timeout
~~~~~~~~~~~~~~~
diff --git a/doc/admin-guide/plugins/lua.en.rst b/doc/admin-guide/plugins/lua.en.rst
index 6c598da..28eef1b 100644
--- a/doc/admin-guide/plugins/lua.en.rst
+++ b/doc/admin-guide/plugins/lua.en.rst
@@ -3941,7 +3941,6 @@ Http config constants
TS_LUA_CONFIG_HTTP_CONNECT_ATTEMPTS_RR_RETRIES
TS_LUA_CONFIG_HTTP_CONNECT_ATTEMPTS_TIMEOUT
TS_LUA_CONFIG_HTTP_DOWN_SERVER_CACHE_TIME
- TS_LUA_CONFIG_HTTP_DOWN_SERVER_ABORT_THRESHOLD
TS_LUA_CONFIG_HTTP_DOC_IN_CACHE_SKIP_DNS
TS_LUA_CONFIG_HTTP_BACKGROUND_FILL_ACTIVE_TIMEOUT
TS_LUA_CONFIG_HTTP_RESPONSE_SERVER_STR
diff --git a/doc/developer-guide/api/functions/TSContScheduleEvery.en.rst b/doc/developer-guide/api/functions/TSContScheduleEvery.en.rst
deleted file mode 100644
index bc61392..0000000
--- a/doc/developer-guide/api/functions/TSContScheduleEvery.en.rst
+++ /dev/null
@@ -1,58 +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.
-
-.. include:: ../../../common.defs
-
-.. default-domain:: c
-
-TSContScheduleEvery
-*******************
-
-Synopsis
-========
-
-.. code-block:: cpp
-
- #include <ts/ts.h>
-
-.. function:: TSAction TSContScheduleEvery(TSCont contp, TSHRTime every)
-
-Description
-===========
-
-Schedules :arg:`contp` to periodically run every :arg:`delay` milliseconds in the future.
-This is approximate. The delay will be at least :arg:`delay` but possibly more.
-Resolutions finer than roughly 5 milliseconds will not be effective. :arg:`contp` is
-required to have a mutex, which is provided to :func:`TSContCreate`.
-
-The return value can be used to cancel the scheduled event via :func:`TSActionCancel`. This is
-effective until the continuation :arg:`contp` is being dispatched. However, if it is scheduled on
-another thread this can be problematic to be correctly timed. The return value can be checked with
-:func:`TSActionDone` to see if the continuation ran before the return, which is possible if
-:arg:`timeout` is `0`. Returns ``nullptr`` if thread affinity was cleared.
-
-TSContSchedule() or TSContScheduleEvery() will default to set the thread affinity to the calling thread
-when no affinity is already set for example, using :func:`TSContThreadAffinitySet`
-
-Note that the TSContSchedule() family of API shall only be called from an ATS EThread.
-Calling it from raw non-EThreads can result in unpredictable behavior.
-
-See Also
-========
-
-:doc:`TSContSchedule.en`
-:doc:`TSContScheduleOnPool.en`
-:doc:`TSContScheduleOnThread.en`
diff --git a/doc/developer-guide/api/functions/TSContSchedule.en.rst b/doc/developer-guide/api/functions/TSContScheduleEveryOnPool.en.rst
similarity index 56%
rename from doc/developer-guide/api/functions/TSContSchedule.en.rst
rename to doc/developer-guide/api/functions/TSContScheduleEveryOnPool.en.rst
index 4dbb9f6..0116395 100644
--- a/doc/developer-guide/api/functions/TSContSchedule.en.rst
+++ b/doc/developer-guide/api/functions/TSContScheduleEveryOnPool.en.rst
@@ -18,8 +18,8 @@
.. default-domain:: c
-TSContSchedule
-**************
+TSContScheduleEveryOnPool
+*************************
Synopsis
========
@@ -28,24 +28,25 @@ Synopsis
#include <ts/ts.h>
-.. function:: TSAction TSContSchedule(TSCont contp, TSHRTime timeout)
+.. function:: TSAction TSContScheduleEveryOnPool(TSCont contp, TSHRTime every)
Description
===========
-Schedules :arg:`contp` to run :arg:`delay` milliseconds in the future. This is approximate. The delay
-will be at least :arg:`delay` but possibly more. Resolutions finer than roughly 5 milliseconds will
-not be effective. :arg:`contp` is required to have a mutex, which is provided to
+Schedules :arg:`contp` to run :arg:`every` milliseconds, on a random thread that belongs to
+:arg:`tp`. The :arg:`every` is an approximation, meaning it will be at least :arg:`every`
+milliseconds but possibly more. Resolutions finer than roughly 5 milliseconds will not be
+effective. Note that :arg:`contp` is required to have a mutex, which is provided to
:func:`TSContCreate`.
-The return value can be used to cancel the scheduled event via :func:`TSActionCancel`. This is
-effective until the continuation :arg:`contp` is being dispatched. However, if it is scheduled on
-another thread this can be problematic to be correctly timed. The return value can be checked with
-:func:`TSActionDone` to see if the continuation ran before the return, which is possible if
-:arg:`timeout` is `0`. Returns ``nullptr`` if thread affinity was cleared.
+The return value can be used to cancel the scheduled event via :func:`TSActionCancel`. This
+is effective until the continuation :arg:`contp` is being dispatched. However, if it is
+scheduled on another thread this can be problematic to be correctly timed. The return value
+can be checked with :func:`TSActionDone` to see if the continuation ran before the return,
+which is possible if :arg:`timeout` is `0`.
-TSContSchedule() or TSContScheduleEvery() will default to set the thread affinity to the calling thread
-when no affinity is already set for example, using :func:`TSContThreadAffinitySet`
+If :arg:`contp` has no thread affinity set, the thread it is now scheduled on will be set
+as its thread affinity thread.
Note that the TSContSchedule() family of API shall only be called from an ATS EThread.
Calling it from raw non-EThreads can result in unpredictable behavior.
@@ -53,6 +54,5 @@ Calling it from raw non-EThreads can result in unpredictable behavior.
See Also
========
-:doc:`TSContScheduleEvery.en`
:doc:`TSContScheduleOnPool.en`
:doc:`TSContScheduleOnThread.en`
diff --git a/doc/developer-guide/api/functions/TSContScheduleOnPool.en.rst b/doc/developer-guide/api/functions/TSContScheduleOnPool.en.rst
index 1517f87..3acf484 100644
--- a/doc/developer-guide/api/functions/TSContScheduleOnPool.en.rst
+++ b/doc/developer-guide/api/functions/TSContScheduleOnPool.en.rst
@@ -33,11 +33,16 @@ Synopsis
Description
===========
-Mostly the same as :func:`TSContSchedule`. Schedules :arg:`contp` on a random thread that belongs to :arg:`tp`.
-If thread type of the thread specified by thread affinity is the same as :arg:`tp`, the :arg:`contp` will
-be scheduled on the thread specified by thread affinity.
+Schedules :arg:`contp` to run :arg:`timeout` milliseconds in the future, on a random thread that
+belongs to :arg:`tp`. The :arg:`timeout` is an approximation, meaning it will be at least
+:arg:`timeout` milliseconds but possibly more. Resolutions finer than roughly 5 milliseconds will
+not be effective. Note that :arg:`contp` is required to have a mutex, which is provided to
+:func:`TSContCreate`.
-The continuation is scheduled for a particular thread selected from a group of similar threads, as indicated by :arg:`tp`.
+The continuation is scheduled for a particular thread selected from a group of similar threads,
+as indicated by :arg:`tp`. If :arg:`contp` already has an thread affinity set, and the thread
+type of thread affinity is the same as :arg:`tp`, then :arg:`contp` will be scheduled on the
+thread specified by thread affinity.
=========================== =======================================================================================
Pool Properties
@@ -54,6 +59,15 @@ called and continuations that use them have the same restrictions. ``TS_THREAD_P
are threads that exist to perform long or blocking actions, although sufficiently long operation can
impact system performance by blocking other continuations on the threads.
+The return value can be used to cancel the scheduled event via :func:`TSActionCancel`. This is
+effective until the continuation :arg:`contp` is being dispatched. However, if it is scheduled on
+another thread this can be problematic to be correctly timed. The return value can be checked with
+:func:`TSActionDone` to see if the continuation ran before the return, which is possible if
+:arg:`timeout` is `0`.
+
+If :arg:`contp` has no thread affinity set, the thread it is now scheduled on will be set
+as its thread affinity thread.
+
Note that the TSContSchedule() family of API shall only be called from an ATS EThread.
Calling it from raw non-EThreads can result in unpredictable behavior.
@@ -124,6 +138,5 @@ the same continuation on two different threads of the same type.
See Also
========
-:doc:`TSContSchedule.en`
-:doc:`TSContScheduleEvery.en`
+:doc:`TSContScheduleEveryOnPool.en`
:doc:`TSContScheduleOnThread.en`
diff --git a/doc/developer-guide/api/functions/TSContScheduleOnThread.en.rst b/doc/developer-guide/api/functions/TSContScheduleOnThread.en.rst
index 0f91166..41148a9 100644
--- a/doc/developer-guide/api/functions/TSContScheduleOnThread.en.rst
+++ b/doc/developer-guide/api/functions/TSContScheduleOnThread.en.rst
@@ -33,7 +33,19 @@ Synopsis
Description
===========
-Mostly the same as :func:`TSContSchedule`. Schedules :arg:`contp` on :arg:`ethread`.
+Schedules :arg:`contp` to run :arg:`timeout` milliseconds in the future, on the thread specified by
+:arg:`ethread`. The :arg:`timeout` is an approximation, meaning it will be at least :arg:`timeout`
+milliseconds but possibly more. Resolutions finer than roughly 5 milliseconds will not be effective.
+Note that :arg:`contp` is required to have a mutex, which is provided to :func:`TSContCreate`.
+
+The return value can be used to cancel the scheduled event via :func:`TSActionCancel`. This is
+effective until the continuation :arg:`contp` is being dispatched. However, if it is scheduled on
+another thread this can be problematic to be correctly timed. The return value can be checked with
+:func:`TSActionDone` to see if the continuation ran before the return, which is possible if
+:arg:`timeout` is `0`.
+
+If :arg:`contp` has no thread affinity set, the thread it is now scheduled on will be set
+as its thread affinity thread.
Note that the TSContSchedule() family of API shall only be called from an ATS EThread.
Calling it from raw non-EThreads can result in unpredictable behavior.
@@ -41,6 +53,5 @@ Calling it from raw non-EThreads can result in unpredictable behavior.
See Also
========
-:doc:`TSContSchedule.en`
-:doc:`TSContScheduleEvery.en`
:doc:`TSContScheduleOnPool.en`
+:doc:`TSContScheduleEveryOnPool.en`
diff --git a/doc/developer-guide/api/functions/TSContThreadAffinitySet.en.rst b/doc/developer-guide/api/functions/TSContThreadAffinitySet.en.rst
index 10465e0..64417de 100644
--- a/doc/developer-guide/api/functions/TSContThreadAffinitySet.en.rst
+++ b/doc/developer-guide/api/functions/TSContThreadAffinitySet.en.rst
@@ -34,10 +34,10 @@ Description
===========
Set the thread affinity of continuation :arg:`contp` to :arg:`ethread`. Future calls to
-:func:`TSContSchedule`, and :func:`TSContScheduleOnPool` that has the same type as :arg:`ethread`
+:func:`TSContScheduleOnPool`, and :func:`TSContScheduleOnPool` that has the same type as :arg:`ethread`
will schedule the continuation on :arg:`ethread`, rather than an arbitrary thread of that type.
-:func:`TSContSchedule` and :func:`TSContScheduleEvery` will default the affinity to calling thread
+:func:`TSContScheduleOnPool` and :func:`TSContScheduleEveryOnPool` will default the affinity to calling thread
when invoked without explicitly setting the thread affinity.
Return Values
diff --git a/doc/developer-guide/api/functions/TSHttpOverridableConfig.en.rst b/doc/developer-guide/api/functions/TSHttpOverridableConfig.en.rst
index 8ad3ae5..5319933 100644
--- a/doc/developer-guide/api/functions/TSHttpOverridableConfig.en.rst
+++ b/doc/developer-guide/api/functions/TSHttpOverridableConfig.en.rst
@@ -141,7 +141,6 @@ TSOverridableConfigKey Value Config
:c:enumerator:`TS_CONFIG_HTTP_NEGATIVE_REVALIDATING_LIFETIME` :ts:cv:`proxy.config.http.negative_revalidating_lifetime`
:c:enumerator:`TS_CONFIG_HTTP_NORMALIZE_AE` :ts:cv:`proxy.config.http.normalize_ae`
:c:enumerator:`TS_CONFIG_HTTP_NUMBER_OF_REDIRECTIONS` :ts:cv:`proxy.config.http.number_of_redirections`
-:c:enumerator:`TS_CONFIG_HTTP_PARENT_CONNECT_ATTEMPT_TIMEOUT` :ts:cv:`proxy.config.http.parent_proxy.connect_attempts_timeout`
:c:enumerator:`TS_CONFIG_HTTP_PARENT_PROXY_FAIL_THRESHOLD` :ts:cv:`proxy.config.http.parent_proxy.fail_threshold`
:c:enumerator:`TS_CONFIG_HTTP_PARENT_PROXY_RETRY_TIME` :ts:cv:`proxy.config.http.parent_proxy.retry_time`
:c:enumerator:`TS_CONFIG_HTTP_PARENT_PROXY_TOTAL_CONNECT_ATTEMPTS` :ts:cv:`proxy.config.http.parent_proxy.total_connect_attempts`
@@ -149,7 +148,6 @@ TSOverridableConfigKey Value Config
:c:enumerator:`TS_CONFIG_HTTP_PER_SERVER_CONNECTION_MATCH` :ts:cv:`proxy.config.http.per_server.connection.match`
:c:enumerator:`TS_CONFIG_HTTP_PER_SERVER_CONNECTION_MAX` :ts:cv:`proxy.config.http.per_server.connection.max`
:c:enumerator:`TS_CONFIG_HTTP_POST_CHECK_CONTENT_LENGTH_ENABLED` :ts:cv:`proxy.config.http.post.check.content_length.enabled`
-:c:enumerator:`TS_CONFIG_HTTP_POST_CONNECT_ATTEMPTS_TIMEOUT` :ts:cv:`proxy.config.http.post_connect_attempts_timeout`
:c:enumerator:`TS_CONFIG_HTTP_REDIRECT_USE_ORIG_CACHE_KEY` :ts:cv:`proxy.config.http.redirect_use_orig_cache_key`
:c:enumerator:`TS_CONFIG_HTTP_REQUEST_BUFFER_ENABLED` :ts:cv:`proxy.config.http.request_buffer_enabled`
:c:enumerator:`TS_CONFIG_HTTP_REQUEST_HEADER_MAX_SIZE` :ts:cv:`proxy.config.http.request_header_max_size`
diff --git a/doc/developer-guide/api/functions/TSHttpTxnAborted.en.rst b/doc/developer-guide/api/functions/TSHttpTxnAborted.en.rst
index afa0658..e5cef85 100644
--- a/doc/developer-guide/api/functions/TSHttpTxnAborted.en.rst
+++ b/doc/developer-guide/api/functions/TSHttpTxnAborted.en.rst
@@ -28,7 +28,7 @@ Synopsis
#include <ts/ts.h>
-.. c:function:: TSReturnCode TSHttpTxnAborted(TSHttpTxn txnp)
+.. c:function:: TSReturnCode TSHttpTxnAborted(TSHttpTxn txnp, bool *client_abort)
Description
-----------
@@ -37,6 +37,10 @@ Description
transaction is aborted. This function should be used to determine whether
a transaction has been aborted before attempting to cache the results.
+Broadly, transaction aborts can be classified into either client side aborts or
+server side. To distinguish between these, we have another boolean parameter
+which gets set to TRUE in case of client side aborts.
+
Return values
-------------
diff --git a/doc/developer-guide/api/types/TSOverridableConfigKey.en.rst b/doc/developer-guide/api/types/TSOverridableConfigKey.en.rst
index 8e1a919..7843faf 100644
--- a/doc/developer-guide/api/types/TSOverridableConfigKey.en.rst
+++ b/doc/developer-guide/api/types/TSOverridableConfigKey.en.rst
@@ -81,7 +81,6 @@ Enumeration Members
.. c:enumerator:: TS_CONFIG_HTTP_CONNECT_ATTEMPTS_TIMEOUT
.. c:enumerator:: TS_CONFIG_HTTP_POST_CONNECT_ATTEMPTS_TIMEOUT
.. c:enumerator:: TS_CONFIG_HTTP_DOWN_SERVER_CACHE_TIME
-.. c:enumerator:: TS_CONFIG_HTTP_DOWN_SERVER_ABORT_THRESHOLD
.. c:enumerator:: TS_CONFIG_HTTP_DOC_IN_CACHE_SKIP_DNS
.. c:enumerator:: TS_CONFIG_HTTP_BACKGROUND_FILL_ACTIVE_TIMEOUT
.. c:enumerator:: TS_CONFIG_HTTP_RESPONSE_SERVER_STR
diff --git a/doc/developer-guide/plugins/continuations/activating-continuations.en.rst b/doc/developer-guide/plugins/continuations/activating-continuations.en.rst
index 6b4135f..8ff2448 100644
--- a/doc/developer-guide/plugins/continuations/activating-continuations.en.rst
+++ b/doc/developer-guide/plugins/continuations/activating-continuations.en.rst
@@ -23,7 +23,7 @@ Activating Continuations
************************
Continuations are activated when they receive an event or by
-``TSContSchedule`` (which schedules a continuation to receive an event).
+``TSContScheduleOnPool`` (which schedules a continuation to receive an event).
Continuations might receive an event because:
- Your plugin calls ``TSContCall``
diff --git a/doc/developer-guide/plugins/continuations/index.en.rst b/doc/developer-guide/plugins/continuations/index.en.rst
index 94bd132..41722b1 100644
--- a/doc/developer-guide/plugins/continuations/index.en.rst
+++ b/doc/developer-guide/plugins/continuations/index.en.rst
@@ -54,7 +54,7 @@ one of the following:
transactions uses ``TSContDataSet/Get``
- uses ``TSCacheXXX``, ``TSNetXXX``, ``TSHostLookup``, or
- ``TSContSchedule`` APIs
+ ``TSContScheduleOnPool`` APIs
Before being activated, a caller must grab the continuation's mutex.
This requirement makes it possible for a continuation's handler function
diff --git a/doc/developer-guide/plugins/continuations/writing-handler-functions.en.rst b/doc/developer-guide/plugins/continuations/writing-handler-functions.en.rst
index f081ff7..7fec877 100644
--- a/doc/developer-guide/plugins/continuations/writing-handler-functions.en.rst
+++ b/doc/developer-guide/plugins/continuations/writing-handler-functions.en.rst
@@ -95,7 +95,6 @@ Event Event Sender
:macro:`TS_EVENT_CACHE_LOOKUP_COMPLETE` :macro:`TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK` :type:`TSHttpTxn`
:macro:`TS_EVENT_IMMEDIATE` :func:`TSVConnClose`
:func:`TSVIOReenable`
- :func:`TSContSchedule`
:func:`TSContScheduleOnPool`
:func:`TSContScheduleOnThread`
:macro:`TS_EVENT_IMMEDIATE` :macro:`TS_HTTP_REQUEST_TRANSFORM_HOOK`
@@ -113,8 +112,7 @@ Event Event Sender
:func:`TSHttpTxnServerIntercept`
:func:`TSHttpTxnIntercept`
:macro:`TS_EVENT_HOST_LOOKUP` :func:`TSHostLookup` :type:`TSHostLookupResult`
-:macro:`TS_EVENT_TIMEOUT` :func:`TSContSchedule`
- :func:`TSContScheduleOnPool`
+:macro:`TS_EVENT_TIMEOUT` :func:`TSContScheduleOnPool`
:func:`TSContScheduleOnThread`
:macro:`TS_EVENT_ERROR`
:macro:`TS_EVENT_VCONN_READ_READY` :func:`TSVConnRead` :type:`TSVIO`
@@ -137,6 +135,5 @@ The continuation functions are listed below:
- :func:`TSContDataSet`
- :func:`TSContDestroy`
- :func:`TSContMutexGet`
-- :func:`TSContSchedule`
- :func:`TSContScheduleOnPool`
- :func:`TSContScheduleOnThread`
diff --git a/doc/locale/ja/LC_MESSAGES/developer-guide/api/functions/TSContSchedule.en.po b/doc/locale/ja/LC_MESSAGES/developer-guide/api/functions/TSContScheduleOnPool.en.po
similarity index 81%
rename from doc/locale/ja/LC_MESSAGES/developer-guide/api/functions/TSContSchedule.en.po
rename to doc/locale/ja/LC_MESSAGES/developer-guide/api/functions/TSContScheduleOnPool.en.po
index e35760b..d41276f 100644
--- a/doc/locale/ja/LC_MESSAGES/developer-guide/api/functions/TSContSchedule.en.po
+++ b/doc/locale/ja/LC_MESSAGES/developer-guide/api/functions/TSContScheduleOnPool.en.po
@@ -29,18 +29,18 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.1.1\n"
-#: ../../developer-guide/api/functions/TSContSchedule.en.rst:32
+#: ../../developer-guide/api/functions/TSContScheduleOnPool.en.rst:32
msgid "Description"
msgstr "解説"
-#: ../../developer-guide/api/functions/TSContSchedule.en.rst:25
+#: ../../developer-guide/api/functions/TSContScheduleOnPool.en.rst:25
msgid "Synopsis"
msgstr "概要"
-#: ../../developer-guide/api/functions/TSContSchedule.en.rst:22
-msgid "TSContSchedule"
+#: ../../developer-guide/api/functions/TSContScheduleOnPool.en.rst:22
+msgid "TSContScheduleOnPool"
msgstr ""
-#: ../../developer-guide/api/functions/TSContSchedule.en.rst:27
+#: ../../developer-guide/api/functions/TSContScheduleOnPool.en.rst:27
msgid "`#include <ts/ts.h>`"
msgstr "`#include <ts/ts.h>`"
diff --git a/doc/locale/ja/LC_MESSAGES/developer-guide/api/functions/TSHttpOverridableConfig.en.po b/doc/locale/ja/LC_MESSAGES/developer-guide/api/functions/TSHttpOverridableConfig.en.po
index dc1ec75..c6a6187 100644
--- a/doc/locale/ja/LC_MESSAGES/developer-guide/api/functions/TSHttpOverridableConfig.en.po
+++ b/doc/locale/ja/LC_MESSAGES/developer-guide/api/functions/TSHttpOverridableConfig.en.po
@@ -290,10 +290,6 @@ msgstr ""
msgid ":ts:cv:`proxy.config.http.down_server.cache_time`"
msgstr ""
-#: ../../../developer-guide/api/functions/TSHttpOverridableConfig.en.rst:119
-msgid ":ts:cv:`proxy.config.http.down_server.abort_threshold`"
-msgstr ""
-
#: ../../../developer-guide/api/functions/TSHttpOverridableConfig.en.rst:120
msgid ":ts:cv:`proxy.config.http.cache.fuzz.time`"
msgstr ""
diff --git a/doc/locale/ja/LC_MESSAGES/developer-guide/plugins/continuations/activating-continuations.en.po b/doc/locale/ja/LC_MESSAGES/developer-guide/plugins/continuations/activating-continuations.en.po
index 5e8bbaa..928db61 100644
--- a/doc/locale/ja/LC_MESSAGES/developer-guide/plugins/continuations/activating-continuations.en.po
+++ b/doc/locale/ja/LC_MESSAGES/developer-guide/plugins/continuations/activating-continuations.en.po
@@ -48,10 +48,10 @@ msgstr ""
#: ../../developer-guide/plugins/continuations/activating-continuations.en.rst:25
msgid ""
"Continuations are activated when they receive an event or by "
-"``TSContSchedule`` (which schedules a continuation to receive an event). "
+"``TSContScheduleOnPool`` (which schedules a continuation to receive an event). "
"Continuations might receive an event because:"
msgstr ""
-"継続は、イベントを受け取った際か ``TSContSchedule`` (イベントを受け取るため"
+"継続は、イベントを受け取った際か ``TSContScheduleOnPool`` (イベントを受け取るため"
"継続をスケジュールする関数)によってアクティベートされます。下記の理由により"
"継続がイベントを受け取る可能性があります。 :"
diff --git a/doc/locale/ja/LC_MESSAGES/developer-guide/plugins/continuations/index.en.po b/doc/locale/ja/LC_MESSAGES/developer-guide/plugins/continuations/index.en.po
index b2595d9..b51a939 100644
--- a/doc/locale/ja/LC_MESSAGES/developer-guide/plugins/continuations/index.en.po
+++ b/doc/locale/ja/LC_MESSAGES/developer-guide/plugins/continuations/index.en.po
@@ -220,8 +220,8 @@ msgstr ""
#: ../../developer-guide/plugins/continuations/index.en.rst:56
msgid ""
-"uses ``TSCacheXXX``, ``TSNetXXX``, ``TSHostLookup``, or ``TSContSchedule`` "
+"uses ``TSCacheXXX``, ``TSNetXXX``, ``TSHostLookup``, or ``TSContScheduleOnPool`` "
"APIs"
msgstr ""
-"``TSCacheXXX``, ``TSNetXXX``, ``TSHostLookup``, もしくは ``TSContSchedule`` "
+"``TSCacheXXX``, ``TSNetXXX``, ``TSHostLookup``, もしくは ``TSContScheduleOnPool`` "
"API を使用する。"
diff --git a/doc/locale/ja/LC_MESSAGES/developer-guide/plugins/continuations/writing-handler-functions.en.po b/doc/locale/ja/LC_MESSAGES/developer-guide/plugins/continuations/writing-handler-functions.en.po
index bdc58ce..df4b712 100644
--- a/doc/locale/ja/LC_MESSAGES/developer-guide/plugins/continuations/writing-handler-functions.en.po
+++ b/doc/locale/ja/LC_MESSAGES/developer-guide/plugins/continuations/writing-handler-functions.en.po
@@ -229,8 +229,8 @@ msgid ":data:`TS_EVENT_IMMEDIATE`"
msgstr ":data:`TS_EVENT_IMMEDIATE`"
#: ../../../developer-guide/plugins/continuations/writing-handler-functions.en.rst:90
-msgid ":func:`TSVConnClose` :func:`TSVIOReenable` :func:`TSContSchedule`"
-msgstr ":func:`TSVConnClose` :func:`TSVIOReenable` :func:`TSContSchedule`"
+msgid ":func:`TSVConnClose` :func:`TSVIOReenable` :func:`TSContScheduleOnPool`"
+msgstr ":func:`TSVConnClose` :func:`TSVIOReenable` :func:`TSContScheduleOnPool`"
#: ../../../developer-guide/plugins/continuations/writing-handler-functions.en.rst:93
msgid ":data:`TS_HTTP_REQUEST_TRANSFORM_HOOK`"
@@ -329,8 +329,8 @@ msgstr ":data:`TS_EVENT_TIMEOUT`"
#: ../../../developer-guide/plugins/continuations/writing-handler-functions.en.rst:108
#: ../../../developer-guide/plugins/continuations/writing-handler-functions.en.rst:130
-msgid ":func:`TSContSchedule`"
-msgstr ":func:`TSContSchedule`"
+msgid ":func:`TSContScheduleOnPool`"
+msgstr ":func:`TSContScheduleOnPool`"
#: ../../../developer-guide/plugins/continuations/writing-handler-functions.en.rst:109
msgid ":data:`TS_EVENT_ERROR`"
diff --git a/doc/release-notes/whats-new.en.rst b/doc/release-notes/whats-new.en.rst
index 0500df4..eb641e6 100644
--- a/doc/release-notes/whats-new.en.rst
+++ b/doc/release-notes/whats-new.en.rst
@@ -35,6 +35,12 @@ New Features
New or modified Configurations
------------------------------
+Combined Connect Timeouts
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The configuration settings :ts:cv: `proxy.config.http.parent_proxy.connect_attempts_timeout` and :ts:cv: `proxy.config.http.post_connect_attempts_timeout` have been removed.
+All connect timeouts are controlled by :ts:cv: `proxy.config.http.connect_attempts_timeout`.
+
Logging and Metrics
-------------------
diff --git a/example/plugins/c-api/request_buffer/request_buffer.c b/example/plugins/c-api/request_buffer/request_buffer.c
index 69ab0c6..2214cda 100644
--- a/example/plugins/c-api/request_buffer/request_buffer.c
+++ b/example/plugins/c-api/request_buffer/request_buffer.c
@@ -67,7 +67,7 @@ request_buffer_plugin(TSCont contp, TSEvent event, void *edata)
{
TSDebug(PLUGIN_NAME, "request_buffer_plugin starting, event[%d]", event);
TSHttpTxn txnp = (TSHttpTxn)(edata);
- if (event == TS_EVENT_HTTP_REQUEST_BUFFER_COMPLETE) {
+ if (event == TS_EVENT_HTTP_REQUEST_BUFFER_READ_COMPLETE) {
int len = 0;
char *body = request_body_get(txnp, &len);
TSDebug(PLUGIN_NAME, "request_buffer_plugin gets the request body with length[%d]", len);
diff --git a/include/ts/apidefs.h.in b/include/ts/apidefs.h.in
index ee65fab..9321dfe 100644
--- a/include/ts/apidefs.h.in
+++ b/include/ts/apidefs.h.in
@@ -265,6 +265,122 @@ typedef enum {
} TSHttpStatus;
/**
+ TSEvents are sent to continuations when they are called back.
+ The TSEvent provides the continuation's handler function with
+ information about the callback. Based on the event it receives,
+ the handler function can decide what to do.
+ */
+typedef enum {
+ TS_EVENT_NONE = 0,
+ TS_EVENT_IMMEDIATE = 1,
+ TS_EVENT_TIMEOUT = 2,
+ TS_EVENT_ERROR = 3,
+ TS_EVENT_CONTINUE = 4,
+
+ TS_EVENT_VCONN_READ_READY = 100,
+ TS_EVENT_VCONN_WRITE_READY = 101,
+ TS_EVENT_VCONN_READ_COMPLETE = 102,
+ TS_EVENT_VCONN_WRITE_COMPLETE = 103,
+ TS_EVENT_VCONN_EOS = 104,
+ TS_EVENT_VCONN_INACTIVITY_TIMEOUT = 105,
+ TS_EVENT_VCONN_ACTIVE_TIMEOUT = 106,
+ TS_EVENT_VCONN_START = 107,
+ TS_EVENT_VCONN_CLOSE = 108,
+ TS_EVENT_VCONN_OUTBOUND_START = 109,
+ TS_EVENT_VCONN_OUTBOUND_CLOSE = 110,
+ TS_EVENT_VCONN_PRE_ACCEPT = TS_EVENT_VCONN_START, // Deprecated but still compatible
+
+ TS_EVENT_NET_CONNECT = 200,
+ TS_EVENT_NET_CONNECT_FAILED = 201,
+ TS_EVENT_NET_ACCEPT = 202,
+ TS_EVENT_NET_ACCEPT_FAILED = 204,
+
+ TS_EVENT_INTERNAL_206 = 206,
+ TS_EVENT_INTERNAL_207 = 207,
+ TS_EVENT_INTERNAL_208 = 208,
+ TS_EVENT_INTERNAL_209 = 209,
+ TS_EVENT_INTERNAL_210 = 210,
+ TS_EVENT_INTERNAL_211 = 211,
+ TS_EVENT_INTERNAL_212 = 212,
+
+ TS_EVENT_HOST_LOOKUP = 500,
+
+ TS_EVENT_CACHE_OPEN_READ = 1102,
+ TS_EVENT_CACHE_OPEN_READ_FAILED = 1103,
+ TS_EVENT_CACHE_OPEN_WRITE = 1108,
+ TS_EVENT_CACHE_OPEN_WRITE_FAILED = 1109,
+ TS_EVENT_CACHE_REMOVE = 1112,
+ TS_EVENT_CACHE_REMOVE_FAILED = 1113,
+ TS_EVENT_CACHE_SCAN = 1120,
+ TS_EVENT_CACHE_SCAN_FAILED = 1121,
+ TS_EVENT_CACHE_SCAN_OBJECT = 1122,
+ TS_EVENT_CACHE_SCAN_OPERATION_BLOCKED = 1123,
+ TS_EVENT_CACHE_SCAN_OPERATION_FAILED = 1124,
+ TS_EVENT_CACHE_SCAN_DONE = 1125,
+ TS_EVENT_CACHE_LOOKUP = 1126,
+ TS_EVENT_CACHE_READ = 1127,
+ TS_EVENT_CACHE_DELETE = 1128,
+ TS_EVENT_CACHE_WRITE = 1129,
+ TS_EVENT_CACHE_WRITE_HEADER = 1130,
+ TS_EVENT_CACHE_CLOSE = 1131,
+ TS_EVENT_CACHE_LOOKUP_READY = 1132,
+ TS_EVENT_CACHE_LOOKUP_COMPLETE = 1133,
+ TS_EVENT_CACHE_READ_READY = 1134,
+ TS_EVENT_CACHE_READ_COMPLETE = 1135,
+
+ TS_EVENT_INTERNAL_1200 = 1200,
+
+ TS_EVENT_SSL_SESSION_GET = 2000,
+ TS_EVENT_SSL_SESSION_NEW = 2001,
+ TS_EVENT_SSL_SESSION_REMOVE = 2002,
+
+ TS_EVENT_AIO_DONE = 3900,
+
+ TS_EVENT_HTTP_CONTINUE = 60000,
+ TS_EVENT_HTTP_ERROR = 60001,
+ TS_EVENT_HTTP_READ_REQUEST_HDR = 60002,
+ TS_EVENT_HTTP_OS_DNS = 60003,
+ TS_EVENT_HTTP_SEND_REQUEST_HDR = 60004,
+ TS_EVENT_HTTP_READ_CACHE_HDR = 60005,
+ TS_EVENT_HTTP_READ_RESPONSE_HDR = 60006,
+ TS_EVENT_HTTP_SEND_RESPONSE_HDR = 60007,
+ TS_EVENT_HTTP_REQUEST_TRANSFORM = 60008,
+ TS_EVENT_HTTP_RESPONSE_TRANSFORM = 60009,
+ TS_EVENT_HTTP_SELECT_ALT = 60010,
+ TS_EVENT_HTTP_TXN_START = 60011,
+ TS_EVENT_HTTP_TXN_CLOSE = 60012,
+ TS_EVENT_HTTP_SSN_START = 60013,
+ TS_EVENT_HTTP_SSN_CLOSE = 60014,
+ TS_EVENT_HTTP_CACHE_LOOKUP_COMPLETE = 60015,
+ TS_EVENT_HTTP_PRE_REMAP = 60016,
+ TS_EVENT_HTTP_POST_REMAP = 60017,
+ TS_EVENT_HTTP_REQUEST_BUFFER_READ_COMPLETE = 60018,
+ TS_EVENT_HTTP_RESPONSE_CLIENT = 60019,
+
+ TS_EVENT_LIFECYCLE_PORTS_INITIALIZED = 60100,
+ TS_EVENT_LIFECYCLE_PORTS_READY = 60101,
+ TS_EVENT_LIFECYCLE_CACHE_READY = 60102,
+ TS_EVENT_LIFECYCLE_SERVER_SSL_CTX_INITIALIZED = 60103,
+ TS_EVENT_LIFECYCLE_CLIENT_SSL_CTX_INITIALIZED = 60104,
+ TS_EVENT_LIFECYCLE_MSG = 60105,
+ TS_EVENT_LIFECYCLE_TASK_THREADS_READY = 60106,
+ TS_EVENT_LIFECYCLE_SHUTDOWN = 60107,
+
+ TS_EVENT_INTERNAL_60200 = 60200,
+ TS_EVENT_INTERNAL_60201 = 60201,
+ TS_EVENT_INTERNAL_60202 = 60202,
+ TS_EVENT_SSL_CERT = 60203,
+ TS_EVENT_SSL_SERVERNAME = 60204,
+ TS_EVENT_SSL_VERIFY_SERVER = 60205,
+ TS_EVENT_SSL_VERIFY_CLIENT = 60206,
+ TS_EVENT_SSL_CLIENT_HELLO = 60207,
+ TS_EVENT_SSL_SECRET = 60208,
+
+ TS_EVENT_MGMT_UPDATE = 60300
+} TSEvent;
+#define TS_EVENT_HTTP_READ_REQUEST_PRE_REMAP TS_EVENT_HTTP_PRE_REMAP /* backwards compat */
+
+/**
This set of enums represents the possible hooks where you can
set up continuation callbacks. The functions used to register a
continuation for a particular hook are:
@@ -316,28 +432,52 @@ typedef enum {
TS_HTTP_LAST_HOOK _must_ be the last element. Only right place
to insert a new element is just before TS_HTTP_LAST_HOOK.
+
+ @note The TS_HTTP hooks below have to be in the same order as their
+ corresponding TS_EVENT counterparts. We use this in calculating the
+ corresponding event from a hook ID by summing
+ TS_EVENT_HTTP_READ_REQUEST_HDR with the hook ID (see the invoke call in
+ HttpSM::state_api_callout). For example, the following expression must be
+ true:
+
+ TS_EVENT_HTTP_TXN_CLOSE == TS_EVENT_HTTP_READ_REQUEST_HDR + TS_HTTP_TXN_CLOSE_HOOK
+
*/
typedef enum {
- TS_HTTP_READ_REQUEST_HDR_HOOK,
- TS_HTTP_OS_DNS_HOOK,
- TS_HTTP_SEND_REQUEST_HDR_HOOK,
- TS_HTTP_READ_CACHE_HDR_HOOK,
- TS_HTTP_READ_RESPONSE_HDR_HOOK,
- TS_HTTP_SEND_RESPONSE_HDR_HOOK,
- TS_HTTP_REQUEST_TRANSFORM_HOOK,
- TS_HTTP_RESPONSE_TRANSFORM_HOOK,
- TS_HTTP_SELECT_ALT_HOOK,
- TS_HTTP_TXN_START_HOOK,
- TS_HTTP_TXN_CLOSE_HOOK,
- TS_HTTP_SSN_START_HOOK,
- TS_HTTP_SSN_CLOSE_HOOK,
- TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK,
- TS_HTTP_PRE_REMAP_HOOK,
- TS_HTTP_POST_REMAP_HOOK,
- TS_HTTP_RESPONSE_CLIENT_HOOK,
+/*
+ The following macro helps maintain the relationship between the TS_HTTP
+ hooks and their TS_EVENT_HTTP counterparts as described in the above
+ doxygen comment.
+ */
+#define DERIVE_HOOK_VALUE_FROM_EVENT(COMMON) TS_HTTP_##COMMON##_HOOK = TS_EVENT_HTTP_##COMMON - TS_EVENT_HTTP_READ_REQUEST_HDR
+ DERIVE_HOOK_VALUE_FROM_EVENT(READ_REQUEST_HDR), // TS_HTTP_READ_REQUEST_HDR_HOOK
+ DERIVE_HOOK_VALUE_FROM_EVENT(OS_DNS), // TS_HTTP_OS_DNS_HOOK
+ DERIVE_HOOK_VALUE_FROM_EVENT(SEND_REQUEST_HDR), // TS_HTTP_SEND_REQUEST_HDR_HOOK
+ DERIVE_HOOK_VALUE_FROM_EVENT(READ_CACHE_HDR), // TS_HTTP_READ_CACHE_HDR_HOOK
+ DERIVE_HOOK_VALUE_FROM_EVENT(READ_RESPONSE_HDR), // TS_HTTP_READ_RESPONSE_HDR_HOOK
+ DERIVE_HOOK_VALUE_FROM_EVENT(SEND_RESPONSE_HDR), // TS_HTTP_SEND_RESPONSE_HDR_HOOK
+ DERIVE_HOOK_VALUE_FROM_EVENT(REQUEST_TRANSFORM), // TS_HTTP_REQUEST_TRANSFORM_HOOK
+ DERIVE_HOOK_VALUE_FROM_EVENT(RESPONSE_TRANSFORM), // TS_HTTP_RESPONSE_TRANSFORM_HOOK
+ DERIVE_HOOK_VALUE_FROM_EVENT(SELECT_ALT), // TS_HTTP_SELECT_ALT_HOOK
+ DERIVE_HOOK_VALUE_FROM_EVENT(TXN_START), // TS_HTTP_TXN_START_HOOK
+ DERIVE_HOOK_VALUE_FROM_EVENT(TXN_CLOSE), // TS_HTTP_TXN_CLOSE_HOOK
+ DERIVE_HOOK_VALUE_FROM_EVENT(SSN_START), // TS_HTTP_SSN_START_HOOK
+ DERIVE_HOOK_VALUE_FROM_EVENT(SSN_CLOSE), // TS_HTTP_SSN_CLOSE_HOOK
+ DERIVE_HOOK_VALUE_FROM_EVENT(CACHE_LOOKUP_COMPLETE), // TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK
+ DERIVE_HOOK_VALUE_FROM_EVENT(PRE_REMAP), // TS_HTTP_PRE_REMAP_HOOK
+ DERIVE_HOOK_VALUE_FROM_EVENT(POST_REMAP), // TS_HTTP_POST_REMAP_HOOK
+ DERIVE_HOOK_VALUE_FROM_EVENT(REQUEST_BUFFER_READ_COMPLETE), // TS_HTTP_REQUEST_BUFFER_READ_COMPLETE_HOOK
+ DERIVE_HOOK_VALUE_FROM_EVENT(RESPONSE_CLIENT), // TS_HTTP_RESPONSE_CLIENT_HOOK
+
+// NOTE:
+// If adding any TS_HTTP hooks, be sure to understand the note above in the
+// doxygen comment about the ordering of these enum values with respect to
+// their corresponding TS_EVENT values.
+#undef DERIVE_HOOK_VALUE_FROM_EVENT
+
// Putting the SSL hooks in the same enum space
// So both sets of hooks can be set by the same Hook function
- TS_SSL_FIRST_HOOK,
+ TS_SSL_FIRST_HOOK = 201,
TS_VCONN_START_HOOK = TS_SSL_FIRST_HOOK,
TS_VCONN_PRE_ACCEPT_HOOK = TS_VCONN_START_HOOK, // Deprecated but compatible for now.
TS_VCONN_CLOSE_HOOK,
@@ -352,7 +492,6 @@ typedef enum {
TS_VCONN_OUTBOUND_START_HOOK,
TS_VCONN_OUTBOUND_CLOSE_HOOK,
TS_SSL_LAST_HOOK = TS_VCONN_OUTBOUND_CLOSE_HOOK,
- TS_HTTP_REQUEST_BUFFER_READ_COMPLETE_HOOK,
TS_HTTP_LAST_HOOK
} TSHttpHookID;
@@ -442,122 +581,6 @@ typedef enum {
TS_LIFECYCLE_LAST_HOOK
} TSLifecycleHookID;
-/**
- TSEvents are sent to continuations when they are called back.
- The TSEvent provides the continuation's handler function with
- information about the callback. Based on the event it receives,
- the handler function can decide what to do.
-
- */
-typedef enum {
- TS_EVENT_NONE = 0,
- TS_EVENT_IMMEDIATE = 1,
- TS_EVENT_TIMEOUT = 2,
- TS_EVENT_ERROR = 3,
- TS_EVENT_CONTINUE = 4,
-
- TS_EVENT_VCONN_READ_READY = 100,
- TS_EVENT_VCONN_WRITE_READY = 101,
- TS_EVENT_VCONN_READ_COMPLETE = 102,
- TS_EVENT_VCONN_WRITE_COMPLETE = 103,
- TS_EVENT_VCONN_EOS = 104,
- TS_EVENT_VCONN_INACTIVITY_TIMEOUT = 105,
- TS_EVENT_VCONN_ACTIVE_TIMEOUT = 106,
- TS_EVENT_VCONN_START = 107,
- TS_EVENT_VCONN_CLOSE = 108,
- TS_EVENT_VCONN_OUTBOUND_START = 109,
- TS_EVENT_VCONN_OUTBOUND_CLOSE = 110,
- TS_EVENT_VCONN_PRE_ACCEPT = TS_EVENT_VCONN_START, // Deprecated but still compatible
-
- TS_EVENT_NET_CONNECT = 200,
- TS_EVENT_NET_CONNECT_FAILED = 201,
- TS_EVENT_NET_ACCEPT = 202,
- TS_EVENT_NET_ACCEPT_FAILED = 204,
-
- TS_EVENT_INTERNAL_206 = 206,
- TS_EVENT_INTERNAL_207 = 207,
- TS_EVENT_INTERNAL_208 = 208,
- TS_EVENT_INTERNAL_209 = 209,
- TS_EVENT_INTERNAL_210 = 210,
- TS_EVENT_INTERNAL_211 = 211,
- TS_EVENT_INTERNAL_212 = 212,
-
- TS_EVENT_HOST_LOOKUP = 500,
-
- TS_EVENT_CACHE_OPEN_READ = 1102,
- TS_EVENT_CACHE_OPEN_READ_FAILED = 1103,
- TS_EVENT_CACHE_OPEN_WRITE = 1108,
- TS_EVENT_CACHE_OPEN_WRITE_FAILED = 1109,
- TS_EVENT_CACHE_REMOVE = 1112,
- TS_EVENT_CACHE_REMOVE_FAILED = 1113,
- TS_EVENT_CACHE_SCAN = 1120,
- TS_EVENT_CACHE_SCAN_FAILED = 1121,
- TS_EVENT_CACHE_SCAN_OBJECT = 1122,
- TS_EVENT_CACHE_SCAN_OPERATION_BLOCKED = 1123,
- TS_EVENT_CACHE_SCAN_OPERATION_FAILED = 1124,
- TS_EVENT_CACHE_SCAN_DONE = 1125,
- TS_EVENT_CACHE_LOOKUP = 1126,
- TS_EVENT_CACHE_READ = 1127,
- TS_EVENT_CACHE_DELETE = 1128,
- TS_EVENT_CACHE_WRITE = 1129,
- TS_EVENT_CACHE_WRITE_HEADER = 1130,
- TS_EVENT_CACHE_CLOSE = 1131,
- TS_EVENT_CACHE_LOOKUP_READY = 1132,
- TS_EVENT_CACHE_LOOKUP_COMPLETE = 1133,
- TS_EVENT_CACHE_READ_READY = 1134,
- TS_EVENT_CACHE_READ_COMPLETE = 1135,
-
- TS_EVENT_INTERNAL_1200 = 1200,
-
- TS_EVENT_SSL_SESSION_GET = 2000,
- TS_EVENT_SSL_SESSION_NEW = 2001,
- TS_EVENT_SSL_SESSION_REMOVE = 2002,
-
- TS_EVENT_AIO_DONE = 3900,
-
- TS_EVENT_HTTP_CONTINUE = 60000,
- TS_EVENT_HTTP_ERROR = 60001,
- TS_EVENT_HTTP_READ_REQUEST_HDR = 60002,
- TS_EVENT_HTTP_OS_DNS = 60003,
- TS_EVENT_HTTP_SEND_REQUEST_HDR = 60004,
- TS_EVENT_HTTP_READ_CACHE_HDR = 60005,
- TS_EVENT_HTTP_READ_RESPONSE_HDR = 60006,
- TS_EVENT_HTTP_SEND_RESPONSE_HDR = 60007,
- TS_EVENT_HTTP_REQUEST_TRANSFORM = 60008,
- TS_EVENT_HTTP_RESPONSE_TRANSFORM = 60009,
- TS_EVENT_HTTP_SELECT_ALT = 60010,
- TS_EVENT_HTTP_TXN_START = 60011,
- TS_EVENT_HTTP_TXN_CLOSE = 60012,
- TS_EVENT_HTTP_SSN_START = 60013,
- TS_EVENT_HTTP_SSN_CLOSE = 60014,
- TS_EVENT_HTTP_CACHE_LOOKUP_COMPLETE = 60015,
- TS_EVENT_HTTP_PRE_REMAP = 60016,
- TS_EVENT_HTTP_POST_REMAP = 60017,
- TS_EVENT_HTTP_REQUEST_BUFFER_COMPLETE = 60018,
-
- TS_EVENT_LIFECYCLE_PORTS_INITIALIZED = 60100,
- TS_EVENT_LIFECYCLE_PORTS_READY = 60101,
- TS_EVENT_LIFECYCLE_CACHE_READY = 60102,
- TS_EVENT_LIFECYCLE_SERVER_SSL_CTX_INITIALIZED = 60103,
- TS_EVENT_LIFECYCLE_CLIENT_SSL_CTX_INITIALIZED = 60104,
- TS_EVENT_LIFECYCLE_MSG = 60105,
- TS_EVENT_LIFECYCLE_TASK_THREADS_READY = 60106,
- TS_EVENT_LIFECYCLE_SHUTDOWN = 60107,
-
- TS_EVENT_INTERNAL_60200 = 60200,
- TS_EVENT_INTERNAL_60201 = 60201,
- TS_EVENT_INTERNAL_60202 = 60202,
- TS_EVENT_SSL_CERT = 60203,
- TS_EVENT_SSL_SERVERNAME = 60204,
- TS_EVENT_SSL_VERIFY_SERVER = 60205,
- TS_EVENT_SSL_VERIFY_CLIENT = 60206,
- TS_EVENT_SSL_CLIENT_HELLO = 60207,
- TS_EVENT_SSL_SECRET = 60208,
-
- TS_EVENT_MGMT_UPDATE = 60300
-} TSEvent;
-#define TS_EVENT_HTTP_READ_REQUEST_PRE_REMAP TS_EVENT_HTTP_PRE_REMAP /* backwards compat */
-
typedef enum {
TS_SRVSTATE_STATE_UNDEFINED = 0,
TS_SRVSTATE_ACTIVE_TIMEOUT,
@@ -788,10 +811,7 @@ typedef enum {
TS_CONFIG_HTTP_CONNECT_ATTEMPTS_MAX_RETRIES_DEAD_SERVER,
TS_CONFIG_HTTP_CONNECT_ATTEMPTS_RR_RETRIES,
TS_CONFIG_HTTP_CONNECT_ATTEMPTS_TIMEOUT,
- TS_CONFIG_HTTP_POST_CONNECT_ATTEMPTS_TIMEOUT,
TS_CONFIG_HTTP_DOWN_SERVER_CACHE_TIME,
- // Should be removed for 10.0
- TS_CONFIG_HTTP_DOWN_SERVER_ABORT_THRESHOLD,
TS_CONFIG_HTTP_DOC_IN_CACHE_SKIP_DNS,
TS_CONFIG_HTTP_BACKGROUND_FILL_ACTIVE_TIMEOUT,
TS_CONFIG_HTTP_RESPONSE_SERVER_STR,
@@ -846,7 +866,6 @@ typedef enum {
TS_CONFIG_HTTP_PARENT_PROXY_FAIL_THRESHOLD,
TS_CONFIG_HTTP_PARENT_PROXY_RETRY_TIME,
TS_CONFIG_HTTP_PER_PARENT_CONNECT_ATTEMPTS,
- TS_CONFIG_HTTP_PARENT_CONNECT_ATTEMPT_TIMEOUT,
TS_CONFIG_HTTP_NORMALIZE_AE,
TS_CONFIG_HTTP_INSERT_FORWARDED,
TS_CONFIG_HTTP_PROXY_PROTOCOL_OUT,
diff --git a/include/ts/ts.h b/include/ts/ts.h
index d2d216b..1dc9bec 100644
--- a/include/ts/ts.h
+++ b/include/ts/ts.h
@@ -1246,10 +1246,8 @@ tsapi TSCont TSContCreate(TSEventFunc funcp, TSMutex mutexp);
tsapi void TSContDestroy(TSCont contp);
tsapi void TSContDataSet(TSCont contp, void *data);
tsapi void *TSContDataGet(TSCont contp);
-tsapi TSAction TSContSchedule(TSCont contp, TSHRTime timeout);
tsapi TSAction TSContScheduleOnPool(TSCont contp, TSHRTime timeout, TSThreadPool tp);
tsapi TSAction TSContScheduleOnThread(TSCont contp, TSHRTime timeout, TSEventThread ethread);
-tsapi TSAction TSContScheduleEvery(TSCont contp, TSHRTime every /* millisecs */);
tsapi TSAction TSContScheduleEveryOnPool(TSCont contp, TSHRTime every /* millisecs */, TSThreadPool tp);
tsapi TSAction TSContScheduleEveryOnThread(TSCont contp, TSHRTime every /* millisecs */, TSEventThread ethread);
tsapi TSReturnCode TSContThreadAffinitySet(TSCont contp, TSEventThread ethread);
@@ -2387,10 +2385,11 @@ tsapi TSReturnCode TSAIOThreadNumSet(int thread_num);
/**
Check if transaction was aborted (due client/server errors etc.)
+ Client_abort is set as True, in case the abort was caused by the Client.
@return 1 if transaction was aborted
*/
-tsapi TSReturnCode TSHttpTxnAborted(TSHttpTxn txnp);
+tsapi TSReturnCode TSHttpTxnAborted(TSHttpTxn txnp, bool *client_abort);
tsapi TSVConn TSVConnCreate(TSEventFunc event_funcp, TSMutex mutexp);
tsapi TSVConn TSVConnFdCreate(int fd);
diff --git a/iocore/net/YamlSNIConfig.cc b/iocore/net/YamlSNIConfig.cc
index 2142e84..e38231f 100644
--- a/iocore/net/YamlSNIConfig.cc
+++ b/iocore/net/YamlSNIConfig.cc
@@ -123,7 +123,6 @@ TsEnumDescriptor PROPERTIES_DESCRIPTOR = {{{"NONE", 0}, {"SIGNATURE", 0x1}, {
TsEnumDescriptor TLS_PROTOCOLS_DESCRIPTOR = {{{"TLSv1", 0}, {"TLSv1_1", 1}, {"TLSv1_2", 2}, {"TLSv1_3", 3}}};
std::set<std::string> valid_sni_config_keys = {TS_fqdn,
- TS_disable_h2,
TS_verify_client,
TS_verify_client_ca_certs,
TS_tunnel_route,
@@ -160,9 +159,6 @@ template <> struct convert<YamlSNIConfig::Item> {
} else {
return false; // servername must be present
}
- if (node[TS_disable_h2]) {
- item.offer_h2 = false;
- }
if (node[TS_http2]) {
item.offer_h2 = node[TS_http2].as<bool>();
}
diff --git a/iocore/net/YamlSNIConfig.h b/iocore/net/YamlSNIConfig.h
index 5b10ff3..f1c4b61 100644
--- a/iocore/net/YamlSNIConfig.h
+++ b/iocore/net/YamlSNIConfig.h
@@ -32,7 +32,6 @@
#define TSDECL(id) constexpr char TS_##id[] = #id
TSDECL(fqdn);
-TSDECL(disable_h2);
TSDECL(verify_client);
TSDECL(verify_client_ca_certs);
TSDECL(tunnel_route);
diff --git a/lib/perl/lib/Apache/TS/AdminClient.pm b/lib/perl/lib/Apache/TS/AdminClient.pm
index 258c592..35c7aa5 100644
--- a/lib/perl/lib/Apache/TS/AdminClient.pm
+++ b/lib/perl/lib/Apache/TS/AdminClient.pm
@@ -474,13 +474,11 @@ The Apache Traffic Server Administration Manual will explain what these strings
proxy.config.http.per_server.connection.max
proxy.config.http.origin_min_keep_alive_connections
proxy.config.http.parent_proxies
- proxy.config.http.parent_proxy.connect_attempts_timeout
proxy.config.http.parent_proxy.fail_threshold
proxy.config.http.parent_proxy.file
proxy.config.http.parent_proxy.per_parent_connect_attempts
proxy.config.http.parent_proxy.retry_time
proxy.config.http.parent_proxy.total_connect_attempts
- proxy.config.http.post_connect_attempts_timeout
proxy.config.http.post_copy_size
proxy.config.http.push_method_enabled
proxy.config.http.quick_filter.mask
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index e3429bb..60233fe 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -400,10 +400,6 @@ static const RecordElement RecordsConfig[] =
,
{RECT_CONFIG, "proxy.config.http.per_server.connection.alert_delay", RECD_INT, "60", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
- {RECT_CONFIG, "proxy.config.http.per_server.connection.queue_size", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
- ,
- {RECT_CONFIG, "proxy.config.http.per_server.connection.queue_delay", RECD_INT, "100", RECU_DYNAMIC, RR_NULL, RECC_STR, "^-?[0-9]+$", RECA_NULL}
- ,
{RECT_CONFIG, "proxy.config.http.per_server.connection.min", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.attach_server_session_to_client", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
@@ -447,8 +443,6 @@ static const RecordElement RecordsConfig[] =
,
{RECT_CONFIG, "proxy.config.http.parent_proxy.per_parent_connect_attempts", RECD_INT, "2", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
- {RECT_CONFIG, "proxy.config.http.parent_proxy.connect_attempts_timeout", RECD_INT, "30", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
- ,
{RECT_CONFIG, "proxy.config.http.parent_proxy.mark_down_hostdb", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.parent_proxy.self_detect", RECD_INT, "2", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
@@ -503,8 +497,6 @@ static const RecordElement RecordsConfig[] =
,
{RECT_CONFIG, "proxy.config.http.connect_attempts_timeout", RECD_INT, "30", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
- {RECT_CONFIG, "proxy.config.http.post_connect_attempts_timeout", RECD_INT, "1800", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
- ,
{RECT_CONFIG, "proxy.config.http.connect.dead.policy", RECD_INT, "2", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.down_server.cache_time", RECD_INT, "60", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
@@ -1138,7 +1130,7 @@ static const RecordElement RecordsConfig[] =
,
{RECT_CONFIG, "proxy.config.ssl.CA.cert.path", RECD_STRING, TS_BUILD_SYSCONFDIR, RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
- {RECT_CONFIG, "proxy.config.ssl.client.verify.server.policy", RECD_STRING, "PERMISSIVE", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
+ {RECT_CONFIG, "proxy.config.ssl.client.verify.server.policy", RECD_STRING, "ENFORCED", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.ssl.client.verify.server.properties", RECD_STRING, "ALL", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
@@ -1243,10 +1235,6 @@ static const RecordElement RecordsConfig[] =
{RECT_CONFIG, "proxy.config.plugin.load_elevated", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1]", RECA_READ_ONLY}
,
- // Interim configuration setting for obeying keepalive requests on internal
- // (PluginVC) sessions. See TS-4960 and friends.
- {RECT_LOCAL, "proxy.config.http.keepalive_internal_vc", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL},
-
//##############################################################################
//#
//# Local Manager Specific Records File
diff --git a/plugins/esi/esi.cc b/plugins/esi/esi.cc
index 9d223b5..67b6fe9 100644
--- a/plugins/esi/esi.cc
+++ b/plugins/esi/esi.cc
@@ -578,7 +578,8 @@ removeCacheKey(TSHttpTxn txnp)
static void
cacheNodeList(ContData *cont_data)
{
- if (TSHttpTxnAborted(cont_data->txnp) == TS_SUCCESS) {
+ bool client_abort;
+ if (TSHttpTxnAborted(cont_data->txnp, &client_abort) == TS_SUCCESS) {
TSDebug(cont_data->debug_tag, "[%s] Not caching node list as txn has been aborted", __FUNCTION__);
return;
}
diff --git a/plugins/lua/ts_lua_http.c b/plugins/lua/ts_lua_http.c
index 3cd4aec..8fd5a03 100644
--- a/plugins/lua/ts_lua_http.c
+++ b/plugins/lua/ts_lua_http.c
@@ -767,8 +767,8 @@ ts_lua_http_is_aborted(lua_State *L)
ts_lua_http_ctx *http_ctx;
GET_HTTP_CONTEXT(http_ctx, L);
-
- if (TSHttpTxnAborted(http_ctx->txnp)) {
+ bool client_abort = false;
+ if (TSHttpTxnAborted(http_ctx->txnp, &client_abort)) {
lua_pushnumber(L, 1);
} else {
lua_pushnumber(L, 0);
diff --git a/plugins/lua/ts_lua_http_config.c b/plugins/lua/ts_lua_http_config.c
index 24420fe..c17eb8d 100644
--- a/plugins/lua/ts_lua_http_config.c
+++ b/plugins/lua/ts_lua_http_config.c
@@ -72,9 +72,7 @@ typedef enum {
TS_LUA_CONFIG_HTTP_CONNECT_DEAD_POLICY = TS_CONFIG_HTTP_CONNECT_DEAD_POLICY,
TS_LUA_CONFIG_HTTP_CONNECT_ATTEMPTS_RR_RETRIES = TS_CONFIG_HTTP_CONNECT_ATTEMPTS_RR_RETRIES,
TS_LUA_CONFIG_HTTP_CONNECT_ATTEMPTS_TIMEOUT = TS_CONFIG_HTTP_CONNECT_ATTEMPTS_TIMEOUT,
- TS_LUA_CONFIG_HTTP_POST_CONNECT_ATTEMPTS_TIMEOUT = TS_CONFIG_HTTP_POST_CONNECT_ATTEMPTS_TIMEOUT,
TS_LUA_CONFIG_HTTP_DOWN_SERVER_CACHE_TIME = TS_CONFIG_HTTP_DOWN_SERVER_CACHE_TIME,
- TS_LUA_CONFIG_HTTP_DOWN_SERVER_ABORT_THRESHOLD = TS_CONFIG_HTTP_DOWN_SERVER_ABORT_THRESHOLD,
TS_LUA_CONFIG_HTTP_DOC_IN_CACHE_SKIP_DNS = TS_CONFIG_HTTP_DOC_IN_CACHE_SKIP_DNS,
TS_LUA_CONFIG_HTTP_BACKGROUND_FILL_ACTIVE_TIMEOUT = TS_CONFIG_HTTP_BACKGROUND_FILL_ACTIVE_TIMEOUT,
TS_LUA_CONFIG_HTTP_RESPONSE_SERVER_STR = TS_CONFIG_HTTP_RESPONSE_SERVER_STR,
@@ -129,7 +127,6 @@ typedef enum {
TS_LUA_CONFIG_HTTP_PARENT_PROXY_FAIL_THRESHOLD = TS_CONFIG_HTTP_PARENT_PROXY_FAIL_THRESHOLD,
TS_LUA_CONFIG_HTTP_PARENT_PROXY_RETRY_TIME = TS_CONFIG_HTTP_PARENT_PROXY_RETRY_TIME,
TS_LUA_CONFIG_HTTP_PER_PARENT_CONNECT_ATTEMPTS = TS_CONFIG_HTTP_PER_PARENT_CONNECT_ATTEMPTS,
- TS_LUA_CONFIG_HTTP_PARENT_CONNECT_ATTEMPT_TIMEOUT = TS_CONFIG_HTTP_PARENT_CONNECT_ATTEMPT_TIMEOUT,
TS_LUA_CONFIG_HTTP_ALLOW_MULTI_RANGE = TS_CONFIG_HTTP_ALLOW_MULTI_RANGE,
TS_LUA_CONFIG_HTTP_REQUEST_BUFFER_ENABLED = TS_CONFIG_HTTP_REQUEST_BUFFER_ENABLED,
TS_LUA_CONFIG_HTTP_ALLOW_HALF_OPEN = TS_CONFIG_HTTP_ALLOW_HALF_OPEN,
@@ -202,9 +199,7 @@ ts_lua_var_item ts_lua_http_config_vars[] = {
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CONNECT_DEAD_POLICY),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CONNECT_ATTEMPTS_RR_RETRIES),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CONNECT_ATTEMPTS_TIMEOUT),
- TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_POST_CONNECT_ATTEMPTS_TIMEOUT),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_DOWN_SERVER_CACHE_TIME),
- TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_DOWN_SERVER_ABORT_THRESHOLD),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_DOC_IN_CACHE_SKIP_DNS),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_BACKGROUND_FILL_ACTIVE_TIMEOUT),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_RESPONSE_SERVER_STR),
@@ -259,7 +254,6 @@ ts_lua_var_item ts_lua_http_config_vars[] = {
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_PARENT_PROXY_FAIL_THRESHOLD),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_PARENT_PROXY_RETRY_TIME),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_PER_PARENT_CONNECT_ATTEMPTS),
- TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_PARENT_CONNECT_ATTEMPT_TIMEOUT),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_ALLOW_MULTI_RANGE),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_REQUEST_BUFFER_ENABLED),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_ALLOW_HALF_OPEN),
diff --git a/proxy/ProxySession.cc b/proxy/ProxySession.cc
index f53d66b..332b468 100644
--- a/proxy/ProxySession.cc
+++ b/proxy/ProxySession.cc
@@ -77,7 +77,7 @@ static const TSEvent eventmap[TS_HTTP_LAST_HOOK + 1] = {
TS_EVENT_HTTP_CACHE_LOOKUP_COMPLETE, // TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK
TS_EVENT_HTTP_PRE_REMAP, // TS_HTTP_PRE_REMAP_HOOK
TS_EVENT_HTTP_POST_REMAP, // TS_HTTP_POST_REMAP_HOOK
- TS_EVENT_NONE, // TS_HTTP_RESPONSE_CLIENT_HOOK
+ TS_EVENT_HTTP_RESPONSE_CLIENT, // TS_HTTP_RESPONSE_CLIENT_HOOK
TS_EVENT_NONE, // TS_HTTP_LAST_HOOK
};
diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc
index 52674cb..79ba532 100644
--- a/proxy/http/HttpConfig.cc
+++ b/proxy/http/HttpConfig.cc
@@ -1234,13 +1234,11 @@ HttpConfig::startup()
HttpEstablishStaticConfigLongLong(c.oride.connect_attempts_rr_retries, "proxy.config.http.connect_attempts_rr_retries");
HttpEstablishStaticConfigLongLong(c.oride.connect_attempts_timeout, "proxy.config.http.connect_attempts_timeout");
- HttpEstablishStaticConfigLongLong(c.oride.post_connect_attempts_timeout, "proxy.config.http.post_connect_attempts_timeout");
HttpEstablishStaticConfigLongLong(c.oride.parent_connect_attempts, "proxy.config.http.parent_proxy.total_connect_attempts");
HttpEstablishStaticConfigLongLong(c.oride.parent_retry_time, "proxy.config.http.parent_proxy.retry_time");
HttpEstablishStaticConfigLongLong(c.oride.parent_fail_threshold, "proxy.config.http.parent_proxy.fail_threshold");
HttpEstablishStaticConfigLongLong(c.oride.per_parent_connect_attempts,
"proxy.config.http.parent_proxy.per_parent_connect_attempts");
- HttpEstablishStaticConfigLongLong(c.oride.parent_connect_timeout, "proxy.config.http.parent_proxy.connect_attempts_timeout");
HttpEstablishStaticConfigByte(c.oride.parent_failures_update_hostdb, "proxy.config.http.parent_proxy.mark_down_hostdb");
HttpEstablishStaticConfigLongLong(c.oride.sock_recv_buffer_size_out, "proxy.config.net.sock_recv_buffer_size_out");
@@ -1314,8 +1312,6 @@ HttpConfig::startup()
HttpEstablishStaticConfigByte(c.send_100_continue_response, "proxy.config.http.send_100_continue_response");
HttpEstablishStaticConfigByte(c.disallow_post_100_continue, "proxy.config.http.disallow_post_100_continue");
- HttpEstablishStaticConfigByte(c.keepalive_internal_vc, "proxy.config.http.keepalive_internal_vc");
-
HttpEstablishStaticConfigByte(c.oride.cache_open_write_fail_action, "proxy.config.http.cache.open_write_fail_action");
HttpEstablishStaticConfigByte(c.oride.cache_when_to_revalidate, "proxy.config.http.cache.when_to_revalidate");
@@ -1434,17 +1430,9 @@ HttpConfig::reconfigure()
params->disable_ssl_parenting = INT_TO_BOOL(m_master.disable_ssl_parenting);
params->oride.forward_connect_method = INT_TO_BOOL(m_master.oride.forward_connect_method);
- params->server_max_connections = m_master.server_max_connections;
- params->max_websocket_connections = m_master.max_websocket_connections;
- params->oride.outbound_conntrack = m_master.oride.outbound_conntrack;
- // If queuing for outbound connection tracking is enabled without enabling max connections, it is meaningless, so we'll warn
- if (params->outbound_conntrack.queue_size > 0 &&
- !(params->oride.outbound_conntrack.max > 0 || params->oride.outbound_conntrack.min > 0)) {
- Warning("'%s' is set, but neither '%s' nor '%s' are "
- "set, please correct your %s",
- OutboundConnTrack::CONFIG_VAR_QUEUE_SIZE.data(), OutboundConnTrack::CONFIG_VAR_MAX.data(),
- OutboundConnTrack::CONFIG_VAR_MIN.data(), ts::filename::RECORDS);
- }
+ params->server_max_connections = m_master.server_max_connections;
+ params->max_websocket_connections = m_master.max_websocket_connections;
+ params->oride.outbound_conntrack = m_master.oride.outbound_conntrack;
params->oride.attach_server_session_to_client = m_master.oride.attach_server_session_to_client;
params->oride.max_proxy_cycles = m_master.oride.max_proxy_cycles;
@@ -1523,12 +1511,10 @@ HttpConfig::reconfigure()
params->oride.connect_attempts_rr_retries = m_master.oride.connect_attempts_rr_retries;
params->oride.connect_attempts_timeout = m_master.oride.connect_attempts_timeout;
params->oride.connect_dead_policy = m_master.oride.connect_dead_policy;
- params->oride.post_connect_attempts_timeout = m_master.oride.post_connect_attempts_timeout;
params->oride.parent_connect_attempts = m_master.oride.parent_connect_attempts;
params->oride.parent_retry_time = m_master.oride.parent_retry_time;
params->oride.parent_fail_threshold = m_master.oride.parent_fail_threshold;
params->oride.per_parent_connect_attempts = m_master.oride.per_parent_connect_attempts;
- params->oride.parent_connect_timeout = m_master.oride.parent_connect_timeout;
params->oride.parent_failures_update_hostdb = m_master.oride.parent_failures_update_hostdb;
params->oride.sock_recv_buffer_size_out = m_master.oride.sock_recv_buffer_size_out;
@@ -1607,7 +1593,6 @@ HttpConfig::reconfigure()
params->send_100_continue_response = INT_TO_BOOL(m_master.send_100_continue_response);
params->disallow_post_100_continue = INT_TO_BOOL(m_master.disallow_post_100_continue);
- params->keepalive_internal_vc = INT_TO_BOOL(m_master.keepalive_internal_vc);
params->oride.cache_open_write_fail_action = m_master.oride.cache_open_write_fail_action;
if (params->oride.cache_open_write_fail_action == CACHE_WL_FAIL_ACTION_READ_RETRY) {
diff --git a/proxy/http/HttpConfig.h b/proxy/http/HttpConfig.h
index f977ea5..20b9079 100644
--- a/proxy/http/HttpConfig.h
+++ b/proxy/http/HttpConfig.h
@@ -663,7 +663,6 @@ struct OverridableHttpConfigParams {
MgmtInt connect_attempts_max_retries_dead_server = 3;
MgmtInt connect_attempts_rr_retries = 3;
MgmtInt connect_attempts_timeout = 30;
- MgmtInt post_connect_attempts_timeout = 1800;
MgmtInt connect_dead_policy = 2;
@@ -674,10 +673,8 @@ struct OverridableHttpConfigParams {
MgmtInt parent_retry_time = 300;
MgmtInt parent_fail_threshold = 10;
MgmtInt per_parent_connect_attempts = 2;
- MgmtInt parent_connect_timeout = 30;
- MgmtInt down_server_timeout = 300;
- MgmtInt client_abort_threshold = 1000;
+ MgmtInt down_server_timeout = 300;
// open read failure retries.
MgmtInt max_cache_open_read_retries = -1;
@@ -826,7 +823,6 @@ public:
MgmtByte send_100_continue_response = 0;
MgmtByte disallow_post_100_continue = 0;
- MgmtByte keepalive_internal_vc = 0;
MgmtByte server_session_sharing_pool = TS_SERVER_SESSION_SHARING_POOL_THREAD;
diff --git a/proxy/http/HttpConnectionCount.cc b/proxy/http/HttpConnectionCount.cc
index cd64e8d..15e6d1a 100644
--- a/proxy/http/HttpConnectionCount.cc
+++ b/proxy/http/HttpConnectionCount.cc
@@ -105,30 +105,6 @@ Config_Update_Conntrack_Max(const char *name, RecDataT dtype, RecData data, void
}
bool
-Config_Update_Conntrack_Queue_Size(const char *name, RecDataT dtype, RecData data, void *cookie)
-{
- auto config = static_cast<OutboundConnTrack::GlobalConfig *>(cookie);
-
- if (RECD_INT == dtype) {
- config->queue_size = data.rec_int;
- return true;
- }
- return false;
-}
-
-bool
-Config_Update_Conntrack_Queue_Delay(const char *name, RecDataT dtype, RecData data, void *cookie)
-{
- auto config = static_cast<OutboundConnTrack::GlobalConfig *>(cookie);
-
- if (RECD_INT == dtype && data.rec_int > 0) {
- config->queue_delay = std::chrono::milliseconds(data.rec_int);
- return true;
- }
- return false;
-}
-
-bool
Config_Update_Conntrack_Match(const char *name, RecDataT dtype, RecData data, void *cookie)
{
auto config = static_cast<OutboundConnTrack::TxnConfig *>(cookie);
@@ -171,8 +147,6 @@ OutboundConnTrack::config_init(GlobalConfig *global, TxnConfig *txn)
Enable_Config_Var(CONFIG_VAR_MIN, &Config_Update_Conntrack_Min, txn);
Enable_Config_Var(CONFIG_VAR_MAX, &Config_Update_Conntrack_Max, txn);
Enable_Config_Var(CONFIG_VAR_MATCH, &Config_Update_Conntrack_Match, txn);
- Enable_Config_Var(CONFIG_VAR_QUEUE_SIZE, &Config_Update_Conntrack_Queue_Size, global);
- Enable_Config_Var(CONFIG_VAR_QUEUE_DELAY, &Config_Update_Conntrack_Queue_Delay, global);
Enable_Config_Var(CONFIG_VAR_ALERT_DELAY, &Config_Update_Conntrack_Alert_Delay, global);
}
@@ -269,13 +243,13 @@ OutboundConnTrack::to_json_string()
static const ts::BWFormat header_fmt{R"({{"count": {}, "list": [
)"};
static const ts::BWFormat item_fmt{
- R"( {{"type": "{}", "ip": "{}", "fqdn": "{}", "current": {}, "max": {}, "blocked": {}, "queued": {}, "alert": {}}},
+ R"( {{"type": "{}", "ip": "{}", "fqdn": "{}", "current": {}, "max": {}, "blocked": {}, "alert": {}}},
)"};
static const std::string_view trailer{" \n]}"};
static const auto printer = [](ts::BufferWriter &w, Group const *g) -> ts::BufferWriter & {
w.print(item_fmt, g->_match_type, g->_addr, g->_fqdn, g->_count.load(), g->_count_max.load(), g->_blocked.load(),
- g->_rescheduled.load(), g->get_last_alert_epoch_time());
+ g->get_last_alert_epoch_time());
return w;
};
@@ -310,18 +284,17 @@ OutboundConnTrack::dump(FILE *f)
self_type::get(groups);
if (groups.size()) {
- fprintf(f, "\nUpstream Connection Tracking\n%7s | %5s | %10s | %24s | %33s | %8s |\n", "Current", "Block", "Queue", "Address",
- "Hostname Hash", "Match");
- fprintf(f, "------|-------|---------|--------------------------|-----------------------------------|----------|\n");
+ fprintf(f, "\nUpstream Connection Tracking\n%7s | %5s | %24s | %33s | %8s |\n", "Current", "Block", "Address", "Hostname Hash",
+ "Match");
+ fprintf(f, "------|-------|--------------------------|-----------------------------------|----------|\n");
for (Group const *g : groups) {
ts::LocalBufferWriter<128> w;
- w.print("{:7} | {:5} | {:5} | {:24} | {:33} | {:8} |\n", g->_count.load(), g->_blocked.load(), g->_rescheduled.load(),
- g->_addr, g->_hash, g->_match_type);
+ w.print("{:7} | {:5} | {:24} | {:33} | {:8} |\n", g->_count.load(), g->_blocked.load(), g->_addr, g->_hash, g->_match_type);
fwrite(w.data(), w.size(), 1, f);
}
- fprintf(f, "------|-------|-------|--------------------------|-----------------------------------|----------|\n");
+ fprintf(f, "------|-------|--------------------------|-----------------------------------|----------|\n");
}
}
@@ -376,12 +349,11 @@ OutboundConnTrack::TxnState::Note_Unblocked(const TxnConfig *config, int count,
{
time_t lat; // last alert time (epoch seconds)
- if ((_g->_blocked > 0 || _g->_rescheduled > 0) && _g->should_alert(&lat)) {
- auto blocked = _g->_blocked.exchange(0);
- auto rescheduled = _g->_rescheduled.exchange(0);
+ if (_g->_blocked > 0 && _g->should_alert(&lat)) {
+ auto blocked = _g->_blocked.exchange(0);
ts::LocalBufferWriter<256> w;
- w.print("upstream unblocked: [{}] count={} limit={} group=({}) blocked={} queued={} upstream={}\0",
- ts::bwf::Date(lat, "%b %d %H:%M:%S"sv), count, config->max, *_g, blocked, rescheduled, addr);
+ w.print("upstream unblocked: [{}] count={} limit={} group=({}) blocked={} upstream={}\0",
+ ts::bwf::Date(lat, "%b %d %H:%M:%S"sv), count, config->max, *_g, blocked, addr);
Debug(DEBUG_TAG, "%s", w.data());
Note("%s", w.data());
}
@@ -391,14 +363,13 @@ void
OutboundConnTrack::TxnState::Warn_Blocked(const TxnConfig *config, int64_t sm_id, int count, sockaddr const *addr,
char const *debug_tag)
{
- bool alert_p = _g->should_alert();
- auto blocked = alert_p ? _g->_blocked.exchange(0) : _g->_blocked.load();
- auto rescheduled = alert_p ? _g->_rescheduled.exchange(0) : _g->_rescheduled.load();
+ bool alert_p = _g->should_alert();
+ auto blocked = alert_p ? _g->_blocked.exchange(0) : _g->_blocked.load();
if (alert_p || debug_tag) {
ts::LocalBufferWriter<256> w;
- w.print("[{}] too many connections: count={} limit={} group=({}) blocked={} queued={} upstream={}\0", sm_id, count, config->max,
- *_g, blocked, rescheduled, addr);
+ w.print("[{}] too many connections: count={} limit={} group=({}) blocked={} upstream={}\0", sm_id, count, config->max, *_g,
+ blocked, addr);
if (debug_tag) {
Debug(debug_tag, "%s", w.data());
diff --git a/proxy/http/HttpConnectionCount.h b/proxy/http/HttpConnectionCount.h
index 494d2ca..19a3075 100644
--- a/proxy/http/HttpConnectionCount.h
+++ b/proxy/http/HttpConnectionCount.h
@@ -77,9 +77,7 @@ public:
/** Static configuration values. */
struct GlobalConfig {
- int queue_size{0}; ///< Maximum delayed transactions.
- std::chrono::milliseconds queue_delay{100}; ///< Reschedule / queue delay in ms.
- std::chrono::seconds alert_delay{60}; ///< Alert delay in seconds.
+ std::chrono::seconds alert_delay{60}; ///< Alert delay in seconds.
};
// The names of the configuration values.
@@ -88,8 +86,6 @@ public:
static constexpr std::string_view CONFIG_VAR_MAX{"proxy.config.http.per_server.connection.max"_sv};
static constexpr std::string_view CONFIG_VAR_MIN{"proxy.config.http.per_server.connection.min"_sv};
static constexpr std::string_view CONFIG_VAR_MATCH{"proxy.config.http.per_server.connection.match"_sv};
- static constexpr std::string_view CONFIG_VAR_QUEUE_SIZE{"proxy.config.http.per_server.connection.queue_size"_sv};
- static constexpr std::string_view CONFIG_VAR_QUEUE_DELAY{"proxy.config.http.per_server.connection.queue_delay"_sv};
static constexpr std::string_view CONFIG_VAR_ALERT_DELAY{"proxy.config.http.per_server.connection.alert_delay"_sv};
/// A record for the outbound connection count.
@@ -122,7 +118,6 @@ public:
std::atomic<int> _count{0}; ///< Number of outbound connections.
std::atomic<int> _count_max{0}; ///< largest observed @a count value.
std::atomic<int> _blocked{0}; ///< Number of outbound connections blocked since last alert.
- std::atomic<int> _rescheduled{0}; ///< # of connection reschedules.
std::atomic<int> _in_queue{0}; ///< # of connections queued, waiting for a connection.
std::atomic<Ticker> _last_alert{0}; ///< Absolute time of the last alert.
@@ -168,8 +163,6 @@ public:
void dequeue();
/// Note blocking a transaction.
void blocked();
- /// Note a rescheduling
- void rescheduled();
/// Clear all reservations.
void clear();
/// Drop the reservation - assume it will be cleaned up elsewhere.
@@ -392,12 +385,6 @@ OutboundConnTrack::TxnState::blocked()
++_g->_blocked;
}
-inline void
-OutboundConnTrack::TxnState::rescheduled()
-{
- ++_g->_rescheduled;
-}
-
/* === Linkage === */
inline auto
OutboundConnTrack::Linkage::next_ptr(value_type *value) -> value_type *&
diff --git a/proxy/http/HttpDebugNames.cc b/proxy/http/HttpDebugNames.cc
index 2eb03f8..3138913 100644
--- a/proxy/http/HttpDebugNames.cc
+++ b/proxy/http/HttpDebugNames.cc
@@ -338,8 +338,8 @@ HttpDebugNames::get_event_name(int event)
return "TS_EVENT_VCONN_CLOSE";
case TS_EVENT_LIFECYCLE_MSG:
return "TS_EVENT_LIFECYCLE_MSG";
- case TS_EVENT_HTTP_REQUEST_BUFFER_COMPLETE:
- return "TS_EVENT_HTTP_REQUEST_BUFFER_COMPLETE";
+ case TS_EVENT_HTTP_REQUEST_BUFFER_READ_COMPLETE:
+ return "TS_EVENT_HTTP_REQUEST_BUFFER_READ_COMPLETE";
case TS_EVENT_MGMT_UPDATE:
return "TS_EVENT_MGMT_UPDATE";
case TS_EVENT_INTERNAL_60200:
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index c9a6c25..81ed57e 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -346,15 +346,7 @@ HttpSM::get_server_connect_timeout()
if (t_state.api_txn_connect_timeout_value != -1) {
retval = HRTIME_MSECONDS(t_state.api_txn_connect_timeout_value);
} else {
- int connect_timeout;
- if (t_state.method == HTTP_WKSIDX_POST || t_state.method == HTTP_WKSIDX_PUT) {
- connect_timeout = t_state.txn_conf->post_connect_attempts_timeout;
- } else if (t_state.current.server == &t_state.parent_info) {
- connect_timeout = t_state.txn_conf->parent_connect_timeout;
- } else {
- connect_timeout = t_state.txn_conf->connect_attempts_timeout;
- }
- retval = HRTIME_SECONDS(connect_timeout);
+ retval = HRTIME_SECONDS(t_state.txn_conf->connect_attempts_timeout);
}
return retval;
}
@@ -1670,7 +1662,7 @@ plugins required to work with sni_routing.
// void HttpSM::handle_api_return()
//
// Figures out what to do after calling api callouts
-// have finished. This messy and I would like
+// have finished. This is messy and I would like
// to come up with a cleaner way to handle the api
// return. The way we are doing things also makes a
// mess of set_next_state()
@@ -3736,7 +3728,14 @@ HttpSM::tunnel_handler_post_server(int event, HttpTunnelConsumer *c)
{
STATE_ENTER(&HttpSM::tunnel_handler_post_server, event);
- server_request_body_bytes = c->bytes_written;
+ // If is_using_post_buffer has been used, then this handler gets called
+ // twice, once with the buffered request body bytes and a second time with
+ // the (now) zero length user agent buffer. See wait_for_full_body where
+ // these bytes are read. Don't clobber the server_request_body_bytes with
+ // zero on that second read.
+ if (server_request_body_bytes == 0) {
+ server_request_body_bytes = c->bytes_written;
+ }
switch (event) {
case VC_EVENT_EOS:
@@ -5228,31 +5227,8 @@ HttpSM::do_http_server_open(bool raw)
ink_assert(pending_action.is_empty()); // in case of reschedule must not have already pending.
- // If the queue is disabled, reschedule.
- if (t_state.http_config_param->outbound_conntrack.queue_size < 0) {
- ct_state.enqueue();
- ct_state.rescheduled();
- pending_action =
- eventProcessor.schedule_in(this, HRTIME_MSECONDS(t_state.http_config_param->outbound_conntrack.queue_delay.count()));
- } else if (t_state.http_config_param->outbound_conntrack.queue_size > 0) { // queue enabled, check for a slot
- auto wcount = ct_state.enqueue();
- if (wcount < t_state.http_config_param->outbound_conntrack.queue_size) {
- ct_state.rescheduled();
- SMDebug("http", "%s", lbw().print("[{}] queued for {}\0", sm_id, t_state.current.server->dst_addr).data());
- pending_action =
- eventProcessor.schedule_in(this, HRTIME_MSECONDS(t_state.http_config_param->outbound_conntrack.queue_delay.count()));
- } else { // the queue is full
- ct_state.dequeue(); // release the queue slot
- ct_state.blocked(); // note the blockage.
- HTTP_INCREMENT_DYN_STAT(http_origin_connections_throttled_stat);
- send_origin_throttled_response();
- }
- } else { // queue size is 0, always block.
- ct_state.blocked();
- HTTP_INCREMENT_DYN_STAT(http_origin_connections_throttled_stat);
- send_origin_throttled_response();
- }
-
+ ct_state.blocked();
+ HTTP_INCREMENT_DYN_STAT(http_origin_connections_throttled_stat);
ct_state.Warn_Blocked(&t_state.txn_conf->outbound_conntrack, sm_id, ccount - 1, &t_state.current.server->dst_addr.sa,
debug_on && is_debug_tag_set("http") ? "http" : nullptr);
send_origin_throttled_response();
@@ -5956,10 +5932,17 @@ HttpSM::do_setup_post_tunnel(HttpVC_t to_vc_type)
// Next order of business if copy the remaining data from the
// header buffer into new buffer
- client_request_body_bytes =
+ int64_t num_body_bytes =
post_buffer->write(ua_txn->get_remote_reader(), chunked ? ua_txn->get_remote_reader()->read_avail() : post_bytes);
- ua_txn->get_remote_reader()->consume(client_request_body_bytes);
+ // If is_using_post_buffer has been used, then client_request_body_bytes
+ // will have already been set in wait_for_full_body and there will be
+ // zero bytes in this user agent buffer. We don't want to clobber
+ // client_request_body_bytes with a zero value here in those cases.
+ if (client_request_body_bytes == 0) {
+ client_request_body_bytes = num_body_bytes;
+ }
+ ua_txn->get_remote_reader()->consume(num_body_bytes);
p = tunnel.add_producer(ua_entry->vc, post_bytes - transfered_bytes, buf_start, &HttpSM::tunnel_handler_post_ua, HT_HTTP_CLIENT,
"user agent post");
}
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index a7866cc..2eb1c89 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -5760,15 +5760,8 @@ HttpTransact::initialize_state_variables_from_request(State *s, HTTPHdr *obsolet
}
// If this is an internal request, never keep alive
- if (!s->txn_conf->keep_alive_enabled_in) {
+ if (!s->txn_conf->keep_alive_enabled_in || (vc && vc->get_is_internal_request())) {
s->client_info.keep_alive = HTTP_NO_KEEPALIVE;
- } else if (vc && vc->get_is_internal_request()) {
- // Following the trail of JIRAs back from TS-4960, there can be issues with
- // EOS event delivery when using keepalive on internal PluginVC session. As
- // an interim measure, if proxy.config.http.keepalive_internal_vc is set,
- // we will obey the incoming transaction's keepalive request.
- s->client_info.keep_alive =
- s->http_config_param->keepalive_internal_vc ? incoming_request->keep_alive_get() : HTTP_NO_KEEPALIVE;
} else {
s->client_info.keep_alive = incoming_request->keep_alive_get();
}
diff --git a/src/shared/overridable_txn_vars.cc b/src/shared/overridable_txn_vars.cc
index 7c2f398..ac8baa5 100644
--- a/src/shared/overridable_txn_vars.cc
+++ b/src/shared/overridable_txn_vars.cc
@@ -89,8 +89,6 @@ const std::unordered_map<std::string_view, std::tuple<const TSOverridableConfigK
{OutboundConnTrack::CONFIG_VAR_MIN, {TS_CONFIG_HTTP_SERVER_MIN_KEEP_ALIVE_CONNS, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.anonymize_remove_client_ip", {TS_CONFIG_HTTP_ANONYMIZE_REMOVE_CLIENT_IP, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.cache.open_read_retry_time", {TS_CONFIG_HTTP_CACHE_OPEN_READ_RETRY_TIME, TS_RECORDDATATYPE_INT}},
- // TODO: Remove for 10. Leaving for now to keep enums consistent
- {"proxy.config.http.down_server.abort_threshold", {TS_CONFIG_HTTP_DOWN_SERVER_ABORT_THRESHOLD, TS_RECORDDATATYPE_INT}},
{OutboundConnTrack::CONFIG_VAR_MATCH, {TS_CONFIG_HTTP_PER_SERVER_CONNECTION_MATCH, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.parent_proxy.fail_threshold", {TS_CONFIG_HTTP_PARENT_PROXY_FAIL_THRESHOLD, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.cache.ignore_authentication", {TS_CONFIG_HTTP_CACHE_IGNORE_AUTHENTICATION, TS_RECORDDATATYPE_INT}},
@@ -116,7 +114,6 @@ const std::unordered_map<std::string_view, std::tuple<const TSOverridableConfigK
{"proxy.config.http.cache.guaranteed_min_lifetime", {TS_CONFIG_HTTP_CACHE_GUARANTEED_MIN_LIFETIME, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.cache.guaranteed_max_lifetime", {TS_CONFIG_HTTP_CACHE_GUARANTEED_MAX_LIFETIME, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.transaction_active_timeout_in", {TS_CONFIG_HTTP_TRANSACTION_ACTIVE_TIMEOUT_IN, TS_RECORDDATATYPE_INT}},
- {"proxy.config.http.post_connect_attempts_timeout", {TS_CONFIG_HTTP_POST_CONNECT_ATTEMPTS_TIMEOUT, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.cache.ignore_client_cc_max_age", {TS_CONFIG_HTTP_CACHE_IGNORE_CLIENT_CC_MAX_AGE, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.negative_revalidating_lifetime", {TS_CONFIG_HTTP_NEGATIVE_REVALIDATING_LIFETIME, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.transaction_active_timeout_out", {TS_CONFIG_HTTP_TRANSACTION_ACTIVE_TIMEOUT_OUT, TS_RECORDDATATYPE_INT}},
@@ -149,8 +146,6 @@ const std::unordered_map<std::string_view, std::tuple<const TSOverridableConfigK
{TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_LANGUAGE_MISMATCH, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.cache.ignore_accept_encoding_mismatch",
{TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_ENCODING_MISMATCH, TS_RECORDDATATYPE_INT}},
- {"proxy.config.http.parent_proxy.connect_attempts_timeout",
- {TS_CONFIG_HTTP_PARENT_CONNECT_ATTEMPT_TIMEOUT, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.connect_attempts_max_retries_dead_server",
{TS_CONFIG_HTTP_CONNECT_ATTEMPTS_MAX_RETRIES_DEAD_SERVER, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.parent_proxy.per_parent_connect_attempts",
diff --git a/src/traffic_server/InkAPI.cc b/src/traffic_server/InkAPI.cc
index 3edf1c3..d056f29 100644
--- a/src/traffic_server/InkAPI.cc
+++ b/src/traffic_server/InkAPI.cc
@@ -4640,40 +4640,6 @@ TSContDataGet(TSCont contp)
}
TSAction
-TSContSchedule(TSCont contp, TSHRTime timeout)
-{
- sdk_assert(sdk_sanity_check_iocore_structure(contp) == TS_SUCCESS);
-
- /* ensure we are on a EThread */
- sdk_assert(sdk_sanity_check_null_ptr((void *)this_ethread()) == TS_SUCCESS);
-
- FORCE_PLUGIN_SCOPED_MUTEX(contp);
-
- INKContInternal *i = reinterpret_cast<INKContInternal *>(contp);
-
- if (ink_atomic_increment(static_cast<int *>(&i->m_event_count), 1) < 0) {
- ink_assert(!"not reached");
- }
-
- EThread *eth = i->getThreadAffinity();
- if (eth == nullptr) {
- eth = this_ethread();
- i->setThreadAffinity(eth);
- }
-
- TSAction action;
- if (timeout == 0) {
- action = reinterpret_cast<TSAction>(eth->schedule_imm(i));
- } else {
- action = reinterpret_cast<TSAction>(eth->schedule_in(i, HRTIME_MSECONDS(timeout)));
- }
-
- /* This is a hack. Should be handled in ink_types */
- action = (TSAction)((uintptr_t)action | 0x1);
- return action;
-}
-
-TSAction
TSContScheduleOnPool(TSCont contp, TSHRTime timeout, TSThreadPool tp)
{
sdk_assert(sdk_sanity_check_iocore_structure(contp) == TS_SUCCESS);
@@ -4754,35 +4720,6 @@ TSContScheduleOnThread(TSCont contp, TSHRTime timeout, TSEventThread ethread)
}
TSAction
-TSContScheduleEvery(TSCont contp, TSHRTime every /* millisecs */)
-{
- sdk_assert(sdk_sanity_check_iocore_structure(contp) == TS_SUCCESS);
-
- /* ensure we are on a EThread */
- sdk_assert(sdk_sanity_check_null_ptr((void *)this_ethread()) == TS_SUCCESS);
-
- FORCE_PLUGIN_SCOPED_MUTEX(contp);
-
- INKContInternal *i = reinterpret_cast<INKContInternal *>(contp);
-
- if (ink_atomic_increment(static_cast<int *>(&i->m_event_count), 1) < 0) {
- ink_assert(!"not reached");
- }
-
- EThread *eth = i->getThreadAffinity();
- if (eth == nullptr) {
- eth = this_ethread();
- i->setThreadAffinity(eth);
- }
-
- TSAction action = reinterpret_cast<TSAction>(eth->schedule_every(i, HRTIME_MSECONDS(every)));
-
- /* This is a hack. Should be handled in ink_types */
- action = (TSAction)((uintptr_t)action | 0x1);
- return action;
-}
-
-TSAction
TSContScheduleEveryOnPool(TSCont contp, TSHRTime every, TSThreadPool tp)
{
sdk_assert(sdk_sanity_check_iocore_structure(contp) == TS_SUCCESS);
@@ -5739,16 +5676,19 @@ TSHttpTxnShutDown(TSHttpTxn txnp, TSEvent event)
}
TSReturnCode
-TSHttpTxnAborted(TSHttpTxn txnp)
+TSHttpTxnAborted(TSHttpTxn txnp, bool *client_abort)
{
sdk_assert(sdk_sanity_check_txn(txnp) == TS_SUCCESS);
+ sdk_assert(client_abort != nullptr);
- HttpSM *sm = (HttpSM *)txnp;
+ *client_abort = false;
+ HttpSM *sm = (HttpSM *)txnp;
switch (sm->t_state.squid_codes.log_code) {
case SQUID_LOG_ERR_CLIENT_ABORT:
case SQUID_LOG_ERR_CLIENT_READ_ERROR:
case SQUID_LOG_TCP_SWAPFAIL:
// check for client abort and cache read error
+ *client_abort = true;
return TS_SUCCESS;
default:
break;
@@ -8736,15 +8676,9 @@ _conf_to_memberp(TSOverridableConfigKey conf, OverridableHttpConfigParams *overr
case TS_CONFIG_HTTP_CONNECT_ATTEMPTS_TIMEOUT:
ret = _memberp_to_generic(&overridableHttpConfig->connect_attempts_timeout, conv);
break;
- case TS_CONFIG_HTTP_POST_CONNECT_ATTEMPTS_TIMEOUT:
- ret = _memberp_to_generic(&overridableHttpConfig->post_connect_attempts_timeout, conv);
- break;
case TS_CONFIG_HTTP_DOWN_SERVER_CACHE_TIME:
ret = _memberp_to_generic(&overridableHttpConfig->down_server_timeout, conv);
break;
- case TS_CONFIG_HTTP_DOWN_SERVER_ABORT_THRESHOLD:
- ret = _memberp_to_generic(&overridableHttpConfig->client_abort_threshold, conv);
- break;
case TS_CONFIG_HTTP_DOC_IN_CACHE_SKIP_DNS:
ret = _memberp_to_generic(&overridableHttpConfig->doc_in_cache_skip_dns, conv);
break;
@@ -8913,9 +8847,6 @@ _conf_to_memberp(TSOverridableConfigKey conf, OverridableHttpConfigParams *overr
case TS_CONFIG_HTTP_PER_PARENT_CONNECT_ATTEMPTS:
ret = _memberp_to_generic(&overridableHttpConfig->per_parent_connect_attempts, conv);
break;
- case TS_CONFIG_HTTP_PARENT_CONNECT_ATTEMPT_TIMEOUT:
- ret = _memberp_to_generic(&overridableHttpConfig->parent_connect_timeout, conv);
- break;
case TS_CONFIG_HTTP_ALLOW_MULTI_RANGE:
ret = _memberp_to_generic(&overridableHttpConfig->allow_multi_range, conv);
break;
diff --git a/src/traffic_server/InkAPITest.cc b/src/traffic_server/InkAPITest.cc
index 783c1c7..a8f27d2 100644
--- a/src/traffic_server/InkAPITest.cc
+++ b/src/traffic_server/InkAPITest.cc
@@ -6636,8 +6636,9 @@ enum ORIG_TSHttpHookID {
ORIG_TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK,
ORIG_TS_HTTP_PRE_REMAP_HOOK,
ORIG_TS_HTTP_POST_REMAP_HOOK,
+ ORIG_TS_HTTP_REQUEST_BUFFER_READ_COMPLETE_HOOK,
ORIG_TS_HTTP_RESPONSE_CLIENT_HOOK,
- ORIG_TS_SSL_FIRST_HOOK,
+ ORIG_TS_SSL_FIRST_HOOK = 201,
ORIG_TS_VCONN_START_HOOK = ORIG_TS_SSL_FIRST_HOOK,
ORIG_TS_VCONN_CLOSE_HOOK,
ORIG_TS_SSL_CLIENT_HELLO_HOOK,
@@ -6649,7 +6650,6 @@ enum ORIG_TSHttpHookID {
ORIG_TS_VCONN_OUTBOUND_START_HOOK,
ORIG_TS_VCONN_OUTBOUND_CLOSE_HOOK,
ORIG_TS_SSL_LAST_HOOK = ORIG_TS_VCONN_OUTBOUND_CLOSE_HOOK,
- ORIG_TS_HTTP_REQUEST_BUFFER_READ_COMPLETE_HOOK,
ORIG_TS_HTTP_LAST_HOOK
};
@@ -8624,9 +8624,7 @@ std::array<std::string_view, TS_CONFIG_LAST_ENTRY> SDK_Overridable_Configs = {
"proxy.config.http.connect_attempts_max_retries_dead_server",
"proxy.config.http.connect_attempts_rr_retries",
"proxy.config.http.connect_attempts_timeout",
- "proxy.config.http.post_connect_attempts_timeout",
"proxy.config.http.down_server.cache_time",
- "proxy.config.http.down_server.abort_threshold",
"proxy.config.http.doc_in_cache_skip_dns",
"proxy.config.http.background_fill_active_timeout",
"proxy.config.http.response_server_str",
@@ -8680,7 +8678,6 @@ std::array<std::string_view, TS_CONFIG_LAST_ENTRY> SDK_Overridable_Configs = {
"proxy.config.http.parent_proxy.fail_threshold",
"proxy.config.http.parent_proxy.retry_time",
"proxy.config.http.parent_proxy.per_parent_connect_attempts",
- "proxy.config.http.parent_proxy.connect_attempts_timeout",
"proxy.config.http.normalize_ae",
"proxy.config.http.insert_forwarded",
"proxy.config.http.proxy_protocol_out",
diff --git a/tests/gold_tests/cont_schedule/gold/schedule.gold b/tests/gold_tests/cont_schedule/gold/schedule.gold
deleted file mode 100644
index 7b5d1f6..0000000
--- a/tests/gold_tests/cont_schedule/gold/schedule.gold
+++ /dev/null
@@ -1,4 +0,0 @@
-``
-``(TSContSchedule_test.check) pass [should be the same thread]
-``(TSContSchedule_test.check) pass [should not be the same thread]
-``
diff --git a/tests/gold_tests/cont_schedule/schedule.test.py b/tests/gold_tests/cont_schedule/schedule.test.py
deleted file mode 100644
index d5e58ec..0000000
--- a/tests/gold_tests/cont_schedule/schedule.test.py
+++ /dev/null
@@ -1,49 +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.
-
-
-import os
-
-Test.Summary = 'Test TSContSchedule API'
-Test.ContinueOnFail = True
-
-# Define default ATS
-ts = Test.MakeATSProcess('ts')
-
-Test.testName = 'Test TSContSchedule API'
-
-ts.Disk.records_config.update({
- 'proxy.config.exec_thread.autoconfig': 0,
- 'proxy.config.exec_thread.autoconfig.scale': 1.5,
- 'proxy.config.exec_thread.limit': 32,
- 'proxy.config.accept_threads': 1,
- 'proxy.config.task_threads': 2,
- 'proxy.config.diags.debug.enabled': 1,
- 'proxy.config.diags.debug.tags': 'TSContSchedule_test'
-})
-
-# Load plugin
-Test.PrepareTestPlugin(os.path.join(Test.Variables.AtsTestPluginsDir, 'cont_schedule.so'), ts, 'thread')
-
-# www.example.com Host
-tr = Test.AddTestRun()
-tr.Processes.Default.Command = 'printf "Test TSContSchedule API"'
-tr.Processes.Default.ReturnCode = 0
-tr.Processes.Default.StartBefore(ts)
-ts.Streams.All = "gold/schedule.gold"
-ts.Streams.All += Testers.ExcludesExpression('fail', 'should not contain "fail"')
diff --git a/tests/gold_tests/pluginTest/test_hooks/200.gold b/tests/gold_tests/pluginTest/test_hooks/200.gold
new file mode 100644
index 0000000..a887573
--- /dev/null
+++ b/tests/gold_tests/pluginTest/test_hooks/200.gold
@@ -0,0 +1,28 @@
+``
+> POST /contentlength HTTP/1.1``
+> Host:``
+> User-Agent: curl/``
+> Accept: */*``
+> Content-Length: 22``
+> Content-Type: application/``
+``
+< HTTP/1.1 200 OK``
+< Server: ATS/``
+< Content-Length: 23``
+< Date:``
+< Age:``
+``
+> POST /chunked``
+> Host:``
+> User-Agent: curl/``
+> Accept: */*``
+> Transfer-Encoding: chunked``
+> Content-Type: application/``
+``
+< HTTP/1.1 200 OK``
+< Server: ATS/``
+< Date: ``
+< Age: 0``
+< Transfer-Encoding: chunked``
+< Connection: keep-alive``
+``
diff --git a/tests/gold_tests/pluginTest/test_hooks/body_buffer.test.py b/tests/gold_tests/pluginTest/test_hooks/body_buffer.test.py
new file mode 100644
index 0000000..674274f
--- /dev/null
+++ b/tests/gold_tests/pluginTest/test_hooks/body_buffer.test.py
@@ -0,0 +1,121 @@
+'''
+Verify HTTP body buffering.
+'''
+# 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.
+
+import os
+
+
+def int_to_hex_string(int_value):
+ '''
+ Convert the given int value to a hex string with no '0x' prefix.
+
+ >>> int_to_hex_string(0)
+ '0'
+ >>> int_to_hex_string(1)
+ '1'
+ >>> int_to_hex_string(10)
+ 'a'
+ >>> int_to_hex_string(16)
+ '10'
+ >>> int_to_hex_string(17)
+ 'f1'
+ '''
+ if not isinstance(int_value, int):
+ raise ValueError("Input should be an int type.")
+ return hex(int_value).split('x')[1]
+
+
+class BodyBufferTest:
+ def __init__(cls, description):
+ Test.Summary = description
+ cls._origin_max_connections = 3
+ cls.setupOriginServer()
+ cls.setupTS()
+
+ def setupOriginServer(self):
+ self._server = Test.MakeOriginServer("server")
+ self.content_length_request_body = "content-length request"
+ self.content_length_size = len(self.content_length_request_body)
+ request_header = {"headers": "POST /contentlength HTTP/1.1\r\n"
+ "Host: www.example.com\r\n"
+ f"Content-Length: {self.content_length_size}\r\n\r\n",
+ "timestamp": "1469733493.993",
+ "body": self.content_length_request_body}
+ content_length_response_body = "content-length response"
+ content_length_response_size = len(content_length_response_body)
+ response_header = {"headers": "HTTP/1.1 200 OK\r\n"
+ "Server: microserver\r\n"
+ f"Content-Length: {content_length_response_size}\r\n\r\n"
+ "Connection: close\r\n\r\n",
+ "timestamp": "1469733493.993",
+ "body": content_length_response_body}
+ self._server.addResponse("sessionlog.json", request_header, response_header)
+
+ self.chunked_request_body = "chunked request"
+ hex_size = int_to_hex_string(len(self.chunked_request_body))
+ self.encoded_chunked_request = f"{hex_size}\r\n{self.chunked_request_body}\r\n0\r\n\r\n"
+ self.encoded_chunked_size = len(self.content_length_request_body)
+ request_header2 = {"headers": "POST /chunked HTTP/1.1\r\n"
+ "Transfer-Encoding: chunked\r\n"
+ "Host: www.example.com\r\n"
+ "Connection: keep-alive\r\n\r\n",
+ "timestamp": "1469733493.993",
+ "body": self.encoded_chunked_request}
+ self.chunked_response_body = "chunked response"
+ hex_size = int_to_hex_string(len(self.chunked_response_body))
+ self.encoded_chunked_response = f"{hex_size}\r\n{self.chunked_response_body}\r\n0\r\n\r\n"
+ response_header2 = {"headers": "HTTP/1.1 200 OK\r\n"
+ "Transfer-Encoding: chunked\r\n"
+ "Server: microserver\r\n"
+ "Connection: close\r\n\r\n",
+ "timestamp": "1469733493.993",
+ "body": self.encoded_chunked_response}
+ self._server.addResponse("sessionlog.json", request_header2, response_header2)
+
+ def setupTS(self):
+ self._ts = Test.MakeATSProcess("ts", select_ports=False)
+ self._ts.Disk.remap_config.AddLine(
+ f'map / http://127.0.0.1:{self._server.Variables.Port}'
+ )
+ Test.PrepareInstalledPlugin('request_buffer.so', self._ts)
+ self._ts.Disk.records_config.update({
+ 'proxy.config.diags.debug.enabled': 1,
+ 'proxy.config.diags.debug.tags': 'request_buffer',
+ })
+
+ self._ts.Streams.stderr = Testers.ContainsExpression(
+ rf"request_buffer_plugin gets the request body with length\[{self.content_length_size}\]",
+ "Verify that the plugin parsed the content-length request body data.")
+ self._ts.Streams.stderr += Testers.ContainsExpression(
+ rf"request_buffer_plugin gets the request body with length\[{self.encoded_chunked_size}\]",
+ "Verify that the plugin parsed the chunked request body.")
+
+ def run(self):
+ tr = Test.AddTestRun()
+ # Send both a Content-Length request and a chunked-encoded request.
+ tr.Processes.Default.Command = (
+ f'curl -v http://127.0.0.1:{self._ts.Variables.port}/contentlength -d "{self.content_length_request_body}" --next '
+ f'-v http://127.0.0.1:{self._ts.Variables.port}/chunked -H "Transfer-Encoding: chunked" -d "{self.chunked_request_body}"')
+ tr.Processes.Default.ReturnCode = 0
+ tr.Processes.Default.StartBefore(self._server)
+ tr.Processes.Default.StartBefore(Test.Processes.ts)
+ tr.Processes.Default.Streams.stderr = "200.gold"
+
+
+bodyBufferTest = BodyBufferTest("Test request body buffering.")
+bodyBufferTest.run()
diff --git a/tests/gold_tests/timeout/tls_conn_timeout.test.py b/tests/gold_tests/timeout/tls_conn_timeout.test.py
index 5a635b1..86da7ec 100644
--- a/tests/gold_tests/timeout/tls_conn_timeout.test.py
+++ b/tests/gold_tests/timeout/tls_conn_timeout.test.py
@@ -43,7 +43,6 @@ delay_get_ttfb = Test.Processes.Process(
ts.Disk.records_config.update({
'proxy.config.url_remap.remap_required': 1,
'proxy.config.http.connect_attempts_timeout': 1,
- 'proxy.config.http.post_connect_attempts_timeout': 1,
'proxy.config.http.connect_attempts_max_retries': 1,
'proxy.config.http.transaction_no_activity_timeout_out': 4,
'proxy.config.diags.debug.enabled': 0,
diff --git a/tests/gold_tests/tls/tls_verify_base.test.py b/tests/gold_tests/tls/tls_verify_base.test.py
index bcb0318..884f905 100644
--- a/tests/gold_tests/tls/tls_verify_base.test.py
+++ b/tests/gold_tests/tls/tls_verify_base.test.py
@@ -76,7 +76,8 @@ ts.Disk.records_config.update({
'proxy.config.ssl.client.CA.cert.filename': 'signer.pem',
'proxy.config.url_remap.pristine_host_hdr': 1,
'proxy.config.exec_thread.autoconfig.scale': 1.0,
- 'proxy.config.ssl.client.sni_policy': 'host'
+ 'proxy.config.ssl.client.sni_policy': 'host',
+ 'proxy.config.ssl.client.verify.server.policy': 'PERMISSIVE'
})
ts.Disk.sni_yaml.AddLines([
diff --git a/tests/gold_tests/tls/tls_verify_override_base.test.py b/tests/gold_tests/tls/tls_verify_override_base.test.py
index 0495ec5..1274185 100644
--- a/tests/gold_tests/tls/tls_verify_override_base.test.py
+++ b/tests/gold_tests/tls/tls_verify_override_base.test.py
@@ -113,7 +113,8 @@ ts.Disk.records_config.update({
'proxy.config.url_remap.pristine_host_hdr': 1,
'proxy.config.exec_thread.autoconfig.scale': 1.0,
'proxy.config.dns.nameservers': '127.0.0.1:{0}'.format(dns.Variables.Port),
- 'proxy.config.dns.resolv_conf': 'NULL'
+ 'proxy.config.dns.resolv_conf': 'NULL',
+ 'proxy.config.ssl.client.verify.server.policy': 'PERMISSIVE'
})
dns.addRecords(records={"foo.com.": ["127.0.0.1"]})
diff --git a/tests/tools/plugins/cont_schedule.cc b/tests/tools/plugins/cont_schedule.cc
index 4b8aa31..7706d89 100644
--- a/tests/tools/plugins/cont_schedule.cc
+++ b/tests/tools/plugins/cont_schedule.cc
@@ -42,8 +42,6 @@ static TSEventThread thread_2 = nullptr;
static TSCont contp_1 = nullptr;
static TSCont contp_2 = nullptr;
-static int TSContSchedule_handler_1(TSCont contp, TSEvent event, void *edata);
-static int TSContSchedule_handler_2(TSCont contp, TSEvent event, void *edata);
static int TSContScheduleOnPool_handler_1(TSCont contp, TSEvent event, void *edata);
static int TSContScheduleOnPool_handler_2(TSCont contp, TSEvent event, void *edata);
static int TSContScheduleOnThread_handler_1(TSCont contp, TSEvent event, void *edata);
@@ -51,71 +49,6 @@ static int TSContScheduleOnThread_handler_2(TSCont contp, TSEvent event, void *e
static int TSContThreadAffinity_handler(TSCont contp, TSEvent event, void *edata);
static int
-TSContSchedule_handler_1(TSCont contp, TSEvent event, void *edata)
-{
- TSDebug(DEBUG_TAG_HDL, "TSContSchedule handler 1 thread [%p]", TSThreadSelf());
- if (thread_1 == nullptr) {
- // First time entering this handler, before everything else starts.
- thread_1 = TSEventThreadSelf();
-
- // Set the affinity of contp_2 to thread_1, and schedule it twice.
- // Since it's on the same thread, we don't need a delay.
- TSDebug(DEBUG_TAG_HDL, "[%s] scheduling continuation", plugin_name);
- TSContThreadAffinitySet(contp_2, thread_1);
- TSContSchedule(contp_2, 0);
- TSContSchedule(contp_2, 0);
- } else if (thread_2 == nullptr) {
- TSDebug(DEBUG_TAG_CHK, "fail [schedule delay not applied]");
- } else {
- // Second time in here, should be after the two scheduled handler_2 runs.
- // Since handler_1 has no affinity set, we should be on a different thread now.
- // Also, thread_2 should be the same as thread_1, since thread_1 was set as
- // affinity for handler_2.
- if (thread_2 != TSEventThreadSelf() && thread_2 == thread_1) {
- TSDebug(DEBUG_TAG_CHK, "pass [should not be the same thread]");
- } else {
- TSDebug(DEBUG_TAG_CHK, "fail [on the same thread]");
- }
- }
- return 0;
-}
-
-static int
-TSContSchedule_handler_2(TSCont contp, TSEvent event, void *edata)
-{
- TSDebug(DEBUG_TAG_HDL, "TSContSchedule handler 2 thread [%p]", TSThreadSelf());
- if (thread_2 == nullptr) {
- // First time in this handler, should get here after handler_1,
- // and also record the thread id.
- thread_2 = TSEventThreadSelf();
- } else if (thread_2 == TSEventThreadSelf()) {
- // Second time in here, since the affinity is set to thread_1, we should be
- // on the same thread as last time.
- TSDebug(DEBUG_TAG_CHK, "pass [should be the same thread]");
- } else {
- TSDebug(DEBUG_TAG_CHK, "fail [not the same thread]");
- }
- return 0;
-}
-
-void
-TSContSchedule_test()
-{
- contp_1 = TSContCreate(TSContSchedule_handler_1, TSMutexCreate());
- contp_2 = TSContCreate(TSContSchedule_handler_2, TSMutexCreate());
-
- if (contp_1 == nullptr || contp_2 == nullptr) {
- TSDebug(DEBUG_TAG_SCHD, "[%s] could not create continuation", plugin_name);
- abort();
- } else {
- TSDebug(DEBUG_TAG_SCHD, "[%s] scheduling continuation", plugin_name);
- TSContScheduleOnPool(contp_1, 0, TS_THREAD_POOL_NET);
- TSContThreadAffinityClear(contp_1);
- TSContScheduleOnPool(contp_1, 200, TS_THREAD_POOL_NET);
- }
-}
-
-static int
TSContScheduleOnPool_handler_1(TSCont contp, TSEvent event, void *edata)
{
// This runs on ET_NET threads.
@@ -180,7 +113,7 @@ TSContScheduleOnPool_test()
static int
TSContScheduleOnThread_handler_1(TSCont contp, TSEvent event, void *edata)
{
- // Mostly same as TSContSchedule_handler_1, no need to set affinity
+ // Mostly same as TSContScheduleOnPool_handler_1, no need to set affinity
// since we are scheduling directly on to a thread.
TSDebug(DEBUG_TAG_HDL, "TSContScheduleOnThread handler 1 thread [%p]", TSThreadSelf());
if (thread_1 == nullptr) {
@@ -280,15 +213,12 @@ LifecycleHookTracer(TSCont contp, TSEvent event, void *edata)
if (event == TS_EVENT_LIFECYCLE_TASK_THREADS_READY) {
switch (test_flag) {
case 1:
- TSContSchedule_test();
- break;
- case 2:
TSContScheduleOnPool_test();
break;
- case 3:
+ case 2:
TSContScheduleOnThread_test();
break;
- case 4:
+ case 3:
TSContThreadAffinity_test();
break;
default:
@@ -301,20 +231,17 @@ LifecycleHookTracer(TSCont contp, TSEvent event, void *edata)
void
TSPluginInit(int argc, const char *argv[])
{
- if (argc == 1) {
- TSDebug(DEBUG_TAG_INIT, "initializing plugin for testing TSContSchedule");
- test_flag = 1;
- } else if (argc == 2) {
+ if (argc == 2) {
int len = strlen(argv[1]);
if (len == 4 && strncmp(argv[1], "pool", 4) == 0) {
TSDebug(DEBUG_TAG_INIT, "initializing plugin for testing TSContScheduleOnPool");
- test_flag = 2;
+ test_flag = 1;
} else if (len == 6 && strncmp(argv[1], "thread", 6) == 0) {
TSDebug(DEBUG_TAG_INIT, "initializing plugin for testing TSContScheduleOnThread");
- test_flag = 3;
+ test_flag = 2;
} else if (len == 8 && strncmp(argv[1], "affinity", 8) == 0) {
TSDebug(DEBUG_TAG_INIT, "initializing plugin for testing TSContThreadAffinity");
- test_flag = 4;
+ test_flag = 3;
} else {
goto Lerror;
}