(trafficserver) branch master updated: delete simple_server_retry_responses (#11044)
This is an automated email from the ASF dual-hosted git repository. wkaras pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new f6489da399 delete simple_server_retry_responses (#11044) f6489da399 is described below commit f6489da399bc2b7a5395f622902be6ab80da50f2 Author: Jasmine Emanouel <40879549+jasmine-nahr...@users.noreply.github.com> AuthorDate: Thu Feb 8 11:53:54 2024 +1100 delete simple_server_retry_responses (#11044) --- src/proxy/ParentSelection.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/proxy/ParentSelection.cc b/src/proxy/ParentSelection.cc index f7ab689511..849c2b2490 100644 --- a/src/proxy/ParentSelection.cc +++ b/src/proxy/ParentSelection.cc @@ -867,6 +867,7 @@ ParentRecord::~ParentRecord() ats_free(secondary_parents); delete selection_strategy; delete unavailable_server_retry_responses; + delete simple_server_retry_responses; } void
(trafficserver) branch master updated: move ts/parentselectdef.h contents into ts/apidefs.h (#11047)
This is an automated email from the ASF dual-hosted git repository. bnolsen pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 23781107c8 move ts/parentselectdef.h contents into ts/apidefs.h (#11047) 23781107c8 is described below commit 23781107c8c08c563c4cb2d1beba1da176497c80 Author: Brian Olsen AuthorDate: Wed Feb 7 17:53:27 2024 -0700 move ts/parentselectdef.h contents into ts/apidefs.h (#11047) --- .../functions/TSHttpTxnResponseActionGet.en.rst| 44 ++ .../functions/TSHttpTxnResponseActionSet.en.rst| 48 +++ include/proxy/http/HttpTransact.h | 2 +- .../proxy/http/remap/NextHopSelectionStrategy.h| 2 +- include/ts/apidefs.h.in| 24 include/ts/parentselectdefs.h | 71 -- include/ts/ts.h| 1 - src/api/CMakeLists.txt | 6 +- src/proxy/http/HttpTransact.cc | 1 - 9 files changed, 120 insertions(+), 79 deletions(-) diff --git a/doc/developer-guide/api/functions/TSHttpTxnResponseActionGet.en.rst b/doc/developer-guide/api/functions/TSHttpTxnResponseActionGet.en.rst new file mode 100644 index 00..ca8d94a943 --- /dev/null +++ b/doc/developer-guide/api/functions/TSHttpTxnResponseActionGet.en.rst @@ -0,0 +1,44 @@ +.. 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 + +TSHttpTxnResponseActionGet +** + +Synopsis + + +.. code-block:: cpp + +#include + +.. function:: void TSHttpTxnResponseActionGet(TSHttpTxn txnp, TSResponseAction *action) + +Description +=== + +Gets the ResponseAction set by a plugin. + +The action is an out-param and must point to a valid location + +The returned action.hostname must not be modified, and is owned by some plugi +n if not null. + +The action members will always be zero, if no plugin has called TSHttpTxnResp +onseActionSet. diff --git a/doc/developer-guide/api/functions/TSHttpTxnResponseActionSet.en.rst b/doc/developer-guide/api/functions/TSHttpTxnResponseActionSet.en.rst new file mode 100644 index 00..e7d426ea52 --- /dev/null +++ b/doc/developer-guide/api/functions/TSHttpTxnResponseActionSet.en.rst @@ -0,0 +1,48 @@ +.. 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 + +TSHttpTxnResponseActionSet +** + +Synopsis + + +.. code-block:: cpp + +#include + +.. function:: void TSHttpTxnResponseActionSet(TSHttpTxn txnp, TSResponseAction *action) + +Description +=== + +Takes a ResponseAction and sets it as the behavior for finding the +next parent. + +Be aware ATS will never change this outside a plugin. +Therefore, plugins which set the ResponseAction to retry +must also un-set it after the subsequent success or failure, +or ATS will retry forever! + +The passed *action must not be null, and is copied and may be +destroyed after this call returns. + +Callers must maintain owernship of action.hostname, +and its lifetime must exceed the transaction. diff --git a/include/proxy/http/HttpTransact.h b/include/proxy/http/HttpTransact.h index c089dde2ce..d4029eabb8 100644 --- a/include/proxy/http/HttpTransact.h +++
(trafficserver) branch master updated: Add support for verifying plugins at test time (#11056)
This is an automated email from the ASF dual-hosted git repository. cmcfarlen pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 255dadf11e Add support for verifying plugins at test time (#11056) 255dadf11e is described below commit 255dadf11eafca648de6deed902cfd6d5aebb5ea Author: Chris McFarlen AuthorDate: Wed Feb 7 16:13:20 2024 -0600 Add support for verifying plugins at test time (#11056) --- cmake/add_atsplugin.cmake| 12 plugins/cache_promote/CMakeLists.txt | 2 ++ 2 files changed, 14 insertions(+) diff --git a/cmake/add_atsplugin.cmake b/cmake/add_atsplugin.cmake index f8619789d1..675bd8d409 100644 --- a/cmake/add_atsplugin.cmake +++ b/cmake/add_atsplugin.cmake @@ -25,6 +25,18 @@ function(add_atsplugin name) install(TARGETS ${name} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}) endfunction() +function(verify_remap_plugin target) + add_test(NAME verify_${target} COMMAND $ -C + "verify_remap_plugin $" + ) +endfunction() + +function(verify_global_plugin target) + add_test(NAME verify_${target} COMMAND $ -C + "verify_global_plugin $" + ) +endfunction() + if(APPLE) set(CMAKE_MODULE_LINKER_FLAGS "-undefined dynamic_lookup") endif() diff --git a/plugins/cache_promote/CMakeLists.txt b/plugins/cache_promote/CMakeLists.txt index c25198f5cc..ce98ccebe4 100644 --- a/plugins/cache_promote/CMakeLists.txt +++ b/plugins/cache_promote/CMakeLists.txt @@ -18,3 +18,5 @@ add_atsplugin(cache_promote cache_promote.cc configs.cc policy.cc lru_policy.cc policy_manager.cc) target_link_libraries(cache_promote PRIVATE OpenSSL::Crypto libswoc::libswoc) + +verify_remap_plugin(cache_promote)
(trafficserver) branch master updated: Fix an assertion failure on QPACK (#11054)
This is an automated email from the ASF dual-hosted git repository. maskit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 7b84ec5c03 Fix an assertion failure on QPACK (#11054) 7b84ec5c03 is described below commit 7b84ec5c0319cc6dad0ffe220bc543e949e3c82c Author: Masakazu Kitajo AuthorDate: Wed Feb 7 13:13:43 2024 -0700 Fix an assertion failure on QPACK (#11054) * Fix an assertion failure on QPACK * Fix a logic error in the previous commit --- src/proxy/hdrs/XPACK.cc | 1 + src/proxy/http3/QPACK.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/proxy/hdrs/XPACK.cc b/src/proxy/hdrs/XPACK.cc index 6cb775c097..e5eb070bd5 100644 --- a/src/proxy/hdrs/XPACK.cc +++ b/src/proxy/hdrs/XPACK.cc @@ -453,6 +453,7 @@ XpackDynamicTable::is_empty() const uint32_t XpackDynamicTable::largest_index() const { + // This function can return a meaningful value only if there is at least one entry on the table. ink_assert(!this->is_empty()); return this->_entries_inserted - 1; } diff --git a/src/proxy/http3/QPACK.cc b/src/proxy/http3/QPACK.cc index 1d316b10e0..dc32d7a171 100644 --- a/src/proxy/http3/QPACK.cc +++ b/src/proxy/http3/QPACK.cc @@ -267,7 +267,7 @@ QPACK::decode(uint64_t stream_id, const uint8_t *header_block, size_t header_blo } uint16_t largest_reference = tmp; - if (this->_dynamic_table.largest_index() < largest_reference) { + if (this->_dynamic_table.is_empty() || this->_dynamic_table.largest_index() < largest_reference) { // Blocked if (this->_add_to_blocked_list( new DecodeRequest(largest_reference, thread, cont, stream_id, header_block, header_block_len, hdr))) {
(trafficserver) branch master updated (cbd80dfb2e -> 7e9d532ee1)
This is an automated email from the ASF dual-hosted git repository. maskit pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git from cbd80dfb2e include swoc/bwf_base.h so templates work (#11052) add 7e9d532ee1 Deprecate the support for NPN (#11045) No new revisions were added by this update. Summary of changes: doc/admin-guide/configuration/session-protocol.en.rst | 4 +++- doc/developer-guide/api/functions/TSHttpConnectPlugin.en.rst | 2 +- doc/developer-guide/api/functions/TSHttpConnectWithPluginId.en.rst | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-)
(trafficserver) branch master updated: include swoc/bwf_base.h so templates work (#11052)
This is an automated email from the ASF dual-hosted git repository. cmcfarlen pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new cbd80dfb2e include swoc/bwf_base.h so templates work (#11052) cbd80dfb2e is described below commit cbd80dfb2e4d3337ae37256f39b3738f7897d510 Author: Chris McFarlen AuthorDate: Wed Feb 7 14:08:38 2024 -0600 include swoc/bwf_base.h so templates work (#11052) --- plugins/cache_promote/policy.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/cache_promote/policy.cc b/plugins/cache_promote/policy.cc index cf20d9f0b6..17345ac679 100644 --- a/plugins/cache_promote/policy.cc +++ b/plugins/cache_promote/policy.cc @@ -15,6 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +#include "swoc/bwf_base.h" #include "swoc/BufferWriter.h" #include "tscore/Random.h" #include "policy.h"
(trafficserver) branch master updated: SSLConfig: free temporary ALPN string (#11051)
This is an automated email from the ASF dual-hosted git repository. bneradt pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new d357538a61 SSLConfig: free temporary ALPN string (#11051) d357538a61 is described below commit d357538a61306d2e46d3ea532460171e808f460c Author: Brian Neradt AuthorDate: Wed Feb 7 13:55:41 2024 -0600 SSLConfig: free temporary ALPN string (#11051) We allocate a temporary string for the user's client-side ALPN configuration, but don't free it after using it. This frees the string after we're done with it. --- src/iocore/net/SSLConfig.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/iocore/net/SSLConfig.cc b/src/iocore/net/SSLConfig.cc index 15dbcbfa81..df1f2299e2 100644 --- a/src/iocore/net/SSLConfig.cc +++ b/src/iocore/net/SSLConfig.cc @@ -366,6 +366,7 @@ SSLConfigParams::initialize() if (clientALPNProtocols) { this->alpn_protocols_array_size = MAX_ALPN_STRING; convert_alpn_to_wire_format(clientALPNProtocols, this->alpn_protocols_array, this->alpn_protocols_array_size); +ats_free(clientALPNProtocols); } #ifdef SSL_OP_CIPHER_SERVER_PREFERENCE
(trafficserver) branch master updated: XPACK: Fix a ats_malloc/delete mismatch (#11049)
This is an automated email from the ASF dual-hosted git repository. bneradt pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 1bf13a210c XPACK: Fix a ats_malloc/delete mismatch (#11049) 1bf13a210c is described below commit 1bf13a210c0a4170390cebf2771dffcec2d3f12a Author: Brian Neradt AuthorDate: Wed Feb 7 13:28:16 2024 -0600 XPACK: Fix a ats_malloc/delete mismatch (#11049) An ASan run showed that in XpackDynamicTable we used ats_malloc for the table entries, but then delete it in the destructor. This fixes that mismatch. --- src/proxy/hdrs/XPACK.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/proxy/hdrs/XPACK.cc b/src/proxy/hdrs/XPACK.cc index 8e458cc52d..6cb775c097 100644 --- a/src/proxy/hdrs/XPACK.cc +++ b/src/proxy/hdrs/XPACK.cc @@ -225,7 +225,7 @@ XpackDynamicTable::XpackDynamicTable(uint32_t size) : _maximum_size(size), _avai XpackDynamicTable::~XpackDynamicTable() { if (this->_entries) { -delete this->_entries; +ats_free(this->_entries); this->_entries = nullptr; } }
(trafficserver) branch master updated: Updated the vscode launch and tasks files to work with cmake (#11016)
This is an automated email from the ASF dual-hosted git repository. bcall pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 06ff161e88 Updated the vscode launch and tasks files to work with cmake (#11016) 06ff161e88 is described below commit 06ff161e88d1fa8c2575bb8d2599c28ead962ae6 Author: Bryan Call AuthorDate: Wed Feb 7 11:22:12 2024 -0800 Updated the vscode launch and tasks files to work with cmake (#11016) --- .vscode/launch.json | 2 +- .vscode/tasks.json | 17 + 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 8117283bbd..0e30cf0e7a 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,7 +5,7 @@ "name": "(gdb) traffic_server", "type": "cppdbg", "request": "launch", -"program": "${workspaceFolder}/${env:ATS_VSCODE_BUILDDIR}/src/traffic_server/.libs/traffic_server", +"program": "${workspaceFolder}/${env:ATS_VSCODE_BUILDDIR}/src/traffic_server/traffic_server", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 0dc52a2ae6..d1c7fb878d 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,24 +1,17 @@ { "version": "2.0.0", "tasks": [ -{ -"label": "Autoreconf", -"type": "shell", -"command": "autoreconf -if", -"problemMatcher": [] -}, { "label": "Configure", "type": "shell", -"command": "mkdir ${workspaceFolder}/${env:ATS_VSCODE_BUILDDIR}; cd ${workspaceFolder}/${env:ATS_VSCODE_BUILDDIR}; ${workspaceFolder}/configure --prefix=${workspaceFolder}/target --enable-ccache --enable-experimental-plugins --enable-example-plugins --enable-test-tools --enable-debug --enable-werror ${env:ATS_VSCODE_CONFIGURE}", +"command": "cmake --preset ${env:ATS_VSCODE_PRESET}", "dependsOrder": "sequence", -"dependsOn": ["Autoreconf"], "problemMatcher": [] }, { "label": "Build", "type": "shell", -"command": "make -j 16 -C ${workspaceFolder}/${env:ATS_VSCODE_BUILDDIR}", +"command": "cmake --build --preset ${env:ATS_VSCODE_PRESET}", "problemMatcher": [ "$gcc" ], @@ -30,7 +23,7 @@ { "label": "Install", "type": "shell", -"command": "make -j 16 install -C ${workspaceFolder}/${env:ATS_VSCODE_BUILDDIR}", +"command": "cmake --install ${workspaceFolder}/${env:ATS_VSCODE_BUILDDIR}", "problemMatcher": [ "$gcc" ], @@ -38,7 +31,7 @@ { "label": "Test", "type": "shell", -"command": "make -j 8 test -C ${workspaceFolder}/${env:ATS_VSCODE_BUILDDIR}", +"command": "cmake --build --preset ${env:ATS_VSCODE_PRESET} --target test", "problemMatcher": [ "$gcc" ], @@ -50,7 +43,7 @@ { "label": "Full Build", "dependsOrder": "sequence", -"dependsOn": ["Configure", "Build", "Install"], +"dependsOn": ["Configure", "Build", "Test", "Install"], "problemMatcher": [ "$gcc" ]
(trafficserver) branch master updated: Segmentation crash caused by setting unavailable_server_retry_responses in parent.config (#11009)
This is an automated email from the ASF dual-hosted git repository. maskit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 640c27cc95 Segmentation crash caused by setting unavailable_server_retry_responses in parent.config (#11009) 640c27cc95 is described below commit 640c27cc957e9f7a686a1eca1f6b611be8cf4b75 Author: Jasmine Emanouel <40879549+jasmine-nahr...@users.noreply.github.com> AuthorDate: Thu Feb 8 03:23:16 2024 +1100 Segmentation crash caused by setting unavailable_server_retry_responses in parent.config (#11009) * Always intialize retry response code variables when parent retry is enabled * Create parent-retry.test.py * Update parent-retry.test.py --- src/proxy/ParentSelection.cc | 4 +- tests/gold_tests/parent_proxy/parent-retry.test.py | 47 ++ 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/src/proxy/ParentSelection.cc b/src/proxy/ParentSelection.cc index 3ad02aebd3..f7ab689511 100644 --- a/src/proxy/ParentSelection.cc +++ b/src/proxy/ParentSelection.cc @@ -782,7 +782,7 @@ ParentRecord::Init(matcher_line *line_info) modulePrefix, line_num); delete unavailable_server_retry_responses; unavailable_server_retry_responses = nullptr; - } else if (unavailable_server_retry_responses == nullptr && (parent_retry & PARENT_RETRY_UNAVAILABLE_SERVER)) { + } else if (unavailable_server_retry_responses == nullptr && parent_retry) { // initialize UnavailableServerResponseCodes to the default value if unavailable_server_retry is enabled. Warning("%s initializing UnavailableServerResponseCodes on line %d to 503 default.", modulePrefix, line_num); unavailable_server_retry_responses = new UnavailableServerResponseCodes(nullptr); @@ -794,7 +794,7 @@ ParentRecord::Init(matcher_line *line_info) line_num); delete simple_server_retry_responses; simple_server_retry_responses = nullptr; - } else if (simple_server_retry_responses == nullptr && (parent_retry & PARENT_RETRY_SIMPLE)) { + } else if (simple_server_retry_responses == nullptr && parent_retry) { // initialize simple server respones codes to the default value if simple_retry is enabled. Warning("%s initializing SimpleRetryResponseCodes on line %d to 404 default.", modulePrefix, line_num); simple_server_retry_responses = new SimpleRetryResponseCodes(nullptr); diff --git a/tests/gold_tests/parent_proxy/parent-retry.test.py b/tests/gold_tests/parent_proxy/parent-retry.test.py new file mode 100644 index 00..e782a065fb --- /dev/null +++ b/tests/gold_tests/parent_proxy/parent-retry.test.py @@ -0,0 +1,47 @@ +""" +Test parent_retry config settings +""" +# 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. + +Test.testName = "Test parent_retry settings" +Test.ContinueOnFail = True + + +class ParentRetryTest: +""" +Test loading parent.config with parent_retry setting enabled +""" +ts_parent_hostname = "localhost:8081" + +def __init__(self): +"""Initialize the test.""" +self._configure_ts_child() + +def _configure_ts_child(self): +self.ts_child = Test.MakeATSProcess("ts_child") +self.ts_child.Disk.parent_config.AddLine( +f'dest_domain=. method=get parent="{self.ts_parent_hostname}" parent_retry=unavailable_server_retry unavailable_server_retry_responses="502,503"' +) + +def run(self): +tr = Test.AddTestRun() +tr.Processes.Default.StartBefore(self.ts_child) +tr.Processes.Default.Command = f'curl "{self.ts_child.Variables.port}" --verbose' +tr.StillRunningAfter = self.ts_child + + +ParentRetryTest().run()
(trafficserver) branch master updated: Reuse arena for header compression (#11024)
This is an automated email from the ASF dual-hosted git repository. maskit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new e24589f5a8 Reuse arena for header compression (#11024) e24589f5a8 is described below commit e24589f5a8ea383ce807eeccbe3c2c67a8de4f3f Author: Masakazu Kitajo AuthorDate: Wed Feb 7 09:02:58 2024 -0700 Reuse arena for header compression (#11024) --- include/proxy/http2/HPACK.h | 3 +++ include/proxy/http3/QPACK.h | 3 +++ src/proxy/http2/HPACK.cc| 8 src/proxy/http3/QPACK.cc| 31 ++- 4 files changed, 28 insertions(+), 17 deletions(-) diff --git a/include/proxy/http2/HPACK.h b/include/proxy/http2/HPACK.h index f8e93856ce..ee8e25eba2 100644 --- a/include/proxy/http2/HPACK.h +++ b/include/proxy/http2/HPACK.h @@ -126,6 +126,9 @@ public: uint32_t size() const; void update_maximum_size(uint32_t new_size); + // Temporal buffer for internal use but it has to be public because many functions are not members of this class. + Arena arena; + private: XpackDynamicTable _dynamic_table; }; diff --git a/include/proxy/http3/QPACK.h b/include/proxy/http3/QPACK.h index 21b294149c..bae08bb7cf 100644 --- a/include/proxy/http3/QPACK.h +++ b/include/proxy/http3/QPACK.h @@ -282,4 +282,7 @@ private: MIOBuffer *_decoder_stream_sending_instructions; IOBufferReader *_encoder_stream_sending_instructions_reader; IOBufferReader *_decoder_stream_sending_instructions_reader; + + // Temporal buffer + Arena _arena; }; diff --git a/src/proxy/http2/HPACK.cc b/src/proxy/http2/HPACK.cc index db66c08387..ca98d30d43 100644 --- a/src/proxy/http2/HPACK.cc +++ b/src/proxy/http2/HPACK.cc @@ -592,8 +592,6 @@ decode_literal_header_field(MIMEFieldWrapper , const uint8_t *buf_start, p += len; - Arena arena; - // Decode header field name if (index) { if (indexing_table.get_header_field(index, header) == HPACK_ERROR_COMPRESSION_ERROR) { @@ -603,7 +601,7 @@ decode_literal_header_field(MIMEFieldWrapper , const uint8_t *buf_start, char *name_str= nullptr; uint64_t name_str_len = 0; -len = xpack_decode_string(arena, _str, name_str_len, p, buf_end); +len = xpack_decode_string(indexing_table.arena, _str, name_str_len, p, buf_end); if (len == XPACK_ERROR_COMPRESSION_ERROR) { return HPACK_ERROR_COMPRESSION_ERROR; } @@ -619,19 +617,21 @@ decode_literal_header_field(MIMEFieldWrapper , const uint8_t *buf_start, p += len; header.name_set(name_str, name_str_len); +indexing_table.arena.str_free(name_str); } // Decode header field value char *value_str= nullptr; uint64_t value_str_len = 0; - len = xpack_decode_string(arena, _str, value_str_len, p, buf_end); + len = xpack_decode_string(indexing_table.arena, _str, value_str_len, p, buf_end); if (len == XPACK_ERROR_COMPRESSION_ERROR) { return HPACK_ERROR_COMPRESSION_ERROR; } p += len; header.value_set(value_str, value_str_len); + indexing_table.arena.str_free(value_str); // Incremental Indexing adds header to header table as new entry if (isIncremental) { diff --git a/src/proxy/http3/QPACK.cc b/src/proxy/http3/QPACK.cc index 54cf3f5fac..1d316b10e0 100644 --- a/src/proxy/http3/QPACK.cc +++ b/src/proxy/http3/QPACK.cc @@ -346,10 +346,9 @@ QPACK::_encode_prefix(uint16_t largest_reference, uint16_t base_index, IOBufferB int QPACK::_encode_header(const MIMEField , uint16_t base_index, IOBufferBlock *compressed_header, uint16_t _index) { - Arena arena; int name_len; const char *name = field.name_get(_len); - char *lowered_name = arena.str_store(name, name_len); + char *lowered_name = this->_arena.str_store(name, name_len); for (int i = 0; i < name_len; i++) { lowered_name[i] = ParseRules::ink_tolower(lowered_name[i]); } @@ -486,6 +485,8 @@ QPACK::_encode_header(const MIMEField , uint16_t base_index, IOBufferBlock value_len, value, never_index); } + this->_arena.str_free(lowered_name); + return 0; } @@ -739,10 +740,9 @@ QPACK::_decode_literal_header_field_with_name_ref(int16_t base_index, const uint } // Read value - Arena arena; char *value; uint64_t value_len; - if ((ret = xpack_decode_string(arena, , value_len, buf + read_len, buf + buf_len, 7)) < 0) { + if ((ret = xpack_decode_string(this->_arena, , value_len, buf + read_len, buf + buf_len, 7)) < 0) { return -1; } read_len += ret; @@ -754,6 +754,8 @@ QPACK::_decode_literal_header_field_with_name_ref(int16_t base_index, const uint QPACKDebug("Decoded Literal Header Field With Name Ref: base_index=%d, abs_index=%d, name=%.*s, value=%.*s", base_index, result.index, static_cast(name_len), name, static_cast(value_len), value); + this->_arena.str_free(value); + return read_len; } @@ -769,18 +771,17
(trafficserver) branch master updated: Add basic check for pcre2 (#11041)
This is an automated email from the ASF dual-hosted git repository. dragon pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new 0fe4644a47 Add basic check for pcre2 (#11041) 0fe4644a47 is described below commit 0fe4644a47501d0025557f5c8abf556bca0fff8f Author: dragon512 AuthorDate: Wed Feb 7 09:32:31 2024 -0600 Add basic check for pcre2 (#11041) --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f927dbc5a..1a7082bfe1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -246,6 +246,7 @@ if(LibLZMA_FOUND) endif() find_package(PCRE REQUIRED) +find_package(PCRE2 COMPONENTS 8BIT) include(CheckOpenSSLIsBoringSSL) include(CheckOpenSSLIsQuictls)
(trafficserver) branch master updated: tidy: Add virtual dtor. Mute compiler warnings. (#11042)
This is an automated email from the ASF dual-hosted git repository. dmeden pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/master by this push: new ef98e1b61b tidy: Add virtual dtor. Mute compiler warnings. (#11042) ef98e1b61b is described below commit ef98e1b61b57d813d0e3b3476b7437566b1228d1 Author: Damian Meden AuthorDate: Wed Feb 7 10:01:40 2024 +0100 tidy: Add virtual dtor. Mute compiler warnings. (#11042) --- include/iocore/net/quic/QUICStream.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/iocore/net/quic/QUICStream.h b/include/iocore/net/quic/QUICStream.h index eadbde626a..29283d71a0 100644 --- a/include/iocore/net/quic/QUICStream.h +++ b/include/iocore/net/quic/QUICStream.h @@ -88,6 +88,7 @@ class QUICStreamStateListener { public: virtual void on_stream_state_close(const QUICStream *stream) = 0; + virtual ~QUICStreamStateListener() = default; // Some compilers may warn about this. }; #define QUICStreamDebug(fmt, ...) \