[trafficserver] branch quic-latest updated: Update loss detection logic to draft-08
This is an automated email from the ASF dual-hosted git repository. maskit pushed a commit to branch quic-latest in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/quic-latest by this push: new ad7d9eb Update loss detection logic to draft-08 ad7d9eb is described below commit ad7d9eb2859974acb1d3add8c7a6fc3816a42c17 Author: Masakazu KitajoAuthorDate: Thu Dec 21 15:02:15 2017 +0900 Update loss detection logic to draft-08 --- iocore/net/quic/QUICCongestionController.cc | 9 +- iocore/net/quic/QUICCongestionController.h | 5 +- iocore/net/quic/QUICLossDetector.cc | 337 iocore/net/quic/QUICLossDetector.h | 27 +-- 4 files changed, 212 insertions(+), 166 deletions(-) diff --git a/iocore/net/quic/QUICCongestionController.cc b/iocore/net/quic/QUICCongestionController.cc index 96c2b55..3ce8e76 100644 --- a/iocore/net/quic/QUICCongestionController.cc +++ b/iocore/net/quic/QUICCongestionController.cc @@ -51,12 +51,12 @@ QUICCongestionController::handle_frame(std::shared_ptr frame) } void -QUICCongestionController::on_packet_sent() +QUICCongestionController::on_packet_sent(size_t sent_bytes) { } void -QUICCongestionController::on_packet_acked() +QUICCongestionController::on_packet_acked(QUICPacketNumber acked_packet_number) { } @@ -66,6 +66,11 @@ QUICCongestionController::on_packets_lost(std::set packets) } void +QUICCongestionController::on_retransmission_timeout_verified() +{ +} + +void QUICCongestionController::on_rto_verified() { } diff --git a/iocore/net/quic/QUICCongestionController.h b/iocore/net/quic/QUICCongestionController.h index 1f76343..79cb96a 100644 --- a/iocore/net/quic/QUICCongestionController.h +++ b/iocore/net/quic/QUICCongestionController.h @@ -35,10 +35,11 @@ public: virtual std::vector interests() override; virtual QUICErrorUPtr handle_frame(std::shared_ptr) override; - void on_packet_sent(); - void on_packet_acked(); + void on_packet_sent(size_t sent_bytes); + void on_packet_acked(QUICPacketNumber acked_packet_number); virtual void on_packets_lost(std::set packets); void on_rto_verified(); + void on_retransmission_timeout_verified(); private: }; diff --git a/iocore/net/quic/QUICLossDetector.cc b/iocore/net/quic/QUICLossDetector.cc index f162221..7edd181 100644 --- a/iocore/net/quic/QUICLossDetector.cc +++ b/iocore/net/quic/QUICLossDetector.cc @@ -28,6 +28,17 @@ #define QUICLDDebug(fmt, ...) \ Debug("quic_loss_detector", "[%" PRIx64 "] " fmt, static_cast(this->_connection_id), ##__VA_ARGS__) +// 3.4.1. Constants of interest (draft-08) +// Keep the order as the same as the spec so that we can see the difference easily. +constexpr static uint32_t MAX_TLPS = 2; +constexpr static uint32_t REORDERING_THRESHOLD = 3; +constexpr static double TIME_REORDERING_FRACTION = 1 / 8; +constexpr static ink_hrtime MIN_TLP_TIMEOUT = HRTIME_MSECONDS(10); +constexpr static ink_hrtime MIN_RTO_TIMEOUT = HRTIME_MSECONDS(200); +// This is defined on the spec but not used +// constexpr static ink_hrtime DELAYED_ACK_TIMEOUT = HRTIME_MSECONDS(25); +constexpr static ink_hrtime DEFAULT_INITIAL_RTT = HRTIME_MSECONDS(100); + QUICLossDetector::QUICLossDetector(QUICPacketTransmitter *transmitter, QUICCongestionController *cc) : _transmitter(transmitter), _cc(cc) { @@ -35,9 +46,9 @@ QUICLossDetector::QUICLossDetector(QUICPacketTransmitter *transmitter, QUICConge if (this->_time_loss_detection) { this->_reordering_threshold = UINT32_MAX; -this->_time_reordering_fraction = this->_TIME_REORDERING_FRACTION; +this->_time_reordering_fraction = TIME_REORDERING_FRACTION; } else { -this->_reordering_threshold = this->_REORDERING_THRESHOLD; +this->_reordering_threshold = REORDERING_THRESHOLD; this->_time_reordering_fraction = INFINITY; } @@ -103,46 +114,6 @@ QUICLossDetector::largest_acked_packet_number() } void -QUICLossDetector::_detect_lost_packets(QUICPacketNumber largest_acked_packet_number) -{ - SCOPED_MUTEX_LOCK(lock, this->mutex, this_ethread()); - this->_loss_time = 0; - std::set lost_packets; - uint32_t delay_until_lost = UINT32_MAX; - - if (this->_time_reordering_fraction != INFINITY) { -delay_until_lost = (1 + this->_time_reordering_fraction) * std::max(this->_latest_rtt, this->_smoothed_rtt); - } else if (largest_acked_packet_number == this->_largest_sent_packet) { -// Early retransmit alarm. -delay_until_lost = 9 / 8 * std::max(this->_latest_rtt, this->_smoothed_rtt); - } - for (auto : this->_sent_packets) { -if (unacked.first >= largest_acked_packet_number) { - break; -} -ink_hrtime time_since_sent = Thread::get_hrtime() - unacked.second->time; -uint64_t packet_delta = largest_acked_packet_number - unacked.second->packet_number; -if (time_since_sent > delay_until_lost) { -
[trafficserver] annotated tag 7.1.2-rc2 updated (fcd852c -> dc6df6f)
This is an automated email from the ASF dual-hosted git repository. zwoop pushed a change to annotated tag 7.1.2-rc2 in repository https://gitbox.apache.org/repos/asf/trafficserver.git. *** WARNING: tag 7.1.2-rc2 was modified! *** from fcd852c (commit) to dc6df6f (tag) tagging fcd852ca8296bcced0ec332133022093d98def7d (commit) replaces 7.1.2-rc1 by Leif Hedstrom on Wed Dec 20 17:08:00 2017 -0700 - Log - Release Candidate 7.1.2-rc2 -BEGIN PGP SIGNATURE- iQJ8BAABCgBmBQJaOvtgXxSAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ3QUIxNUU1RkRFMTk1NUE1MERBOTg2MDU1 MzNERUYxNTVEN0JCQzVBAAoJEFM97xVde7xa8EwP/jsDValhXOI2+jscy25idmcu sJYptBXM2qettjn40gRkeNzrUfsytJHV8HlNruOwCo0YCWNdN0TEyX4ld9JzGO9g 9nDRJttKSQ+uVmPe05pYsDNnS5CC0seR3R8L16ItZ9dT6jVK1gClot37CTbL/yZ4 WMmeuaqhbeH5te4ejeetU7zV8sIiU9C8W9fPjVJtKJMB2gTot5FcV4Zek09B/sH/ 3MoiWVDq5n9fUmjaAVWbP4EkWGjSbxrIVdtDlBI5KPY3tpGoglyZ8d8HknNk3RFm nMBi4ZiD1HlpTy7rbQgFq1hxgT4IIiAJQm4u5Mzn5pDmGDkYOlSFqos7lm1zYBc0 BgBwwDGRdsFDsKHlOXFHLP8cHBrn7NZPw1kErU1GWEVdbiqzpHPzB2LijxFA86bQ aLtyqUbh4QMR+StbAvc1LItAcoV1pPvTll0Rs8lr0OJQwAHykNfKp8u8efZG4QlK 6LzOzqfRTti/IjBU8D3rR9jdLhmMGzk8918Wsy1AYVVtnrORugWiFfv4Dr15q3J0 APnWPv2wMw4OOP0kjCsnxRRUXbB0NTuGALTuBVh8fiXYDN71KgdgbT+Jpx5P9o3R K17imzRWvkXJUIi2P32wuNBGWBnqxdCEsO2z3tDHZmS+P7234VHFqGZNYf4ZtZcE CXPHTOxE4/QeYovictfq =cid0 -END PGP SIGNATURE- --- No new revisions were added by this update. Summary of changes: -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org"'].
[trafficserver] 02/02: Delete space after semi-colon when deleting cookies with a test to ensure not overflowing the cookies char buffer. Ensure idx + 1 is less than len before checking for space.
This is an automated email from the ASF dual-hosted git repository. zwoop pushed a commit to branch 7.1.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git commit 2efadb84e072e22bab600caae524b24af432fd21 Author: Steven FeltnerAuthorDate: Mon Dec 18 07:17:19 2017 -0700 Delete space after semi-colon when deleting cookies with a test to ensure not overflowing the cookies char buffer. Ensure idx + 1 is less than len before checking for space. (cherry picked from commit 08b560d57ac6c30f7c3ab11e796efbd11c9ec669) --- plugins/header_rewrite/operators.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/header_rewrite/operators.cc b/plugins/header_rewrite/operators.cc index fc818ad..d467f89 100644 --- a/plugins/header_rewrite/operators.cc +++ b/plugins/header_rewrite/operators.cc @@ -796,7 +796,7 @@ CookieHelper::cookieModifyHelper(const char *cookies, const size_t cookies_len, } // If we have not reached the end and there is a space after the // semi-colon, advance one char -if (idx < cookies_len && std::isspace(cookies[idx + 1])) { +if (idx + 1 < cookies_len && std::isspace(cookies[idx + 1])) { idx++; } // cookie value is found -- To stop receiving notification emails like this one, please contact "commits@trafficserver.apache.org" .
[trafficserver] branch 7.1.x updated: Updated STATUS with new release date for 7.1.2
This is an automated email from the ASF dual-hosted git repository. zwoop pushed a commit to branch 7.1.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/7.1.x by this push: new fcd852c Updated STATUS with new release date for 7.1.2 fcd852c is described below commit fcd852ca8296bcced0ec332133022093d98def7d Author: Leif HedstromAuthorDate: Wed Dec 20 17:03:39 2017 -0700 Updated STATUS with new release date for 7.1.2 --- STATUS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STATUS b/STATUS index c9e4c28..4ab4b87 100644 --- a/STATUS +++ b/STATUS @@ -6,7 +6,7 @@ The current version of this file can be found at: * https://github.com/apache/trafficserver/blob/master/STATUS Release history: -7.1.2 : Released on Dec 26th, 2017 +7.1.2 : Released on Dec 27th, 2017 7.1.1 : Released on Sep 7th, 2017 7.1.0 : Released on Jul 24th, 2017 -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] branch 7.1.x updated (2689e7b -> 2efadb8)
This is an automated email from the ASF dual-hosted git repository. zwoop pushed a change to branch 7.1.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git. from 2689e7b Updated CHANGELOG and STATUS new 4d84b93 Delete space after semi colon when deleting cookies with test to ensure not overflowing end of cookies char buffer. new 2efadb8 Delete space after semi-colon when deleting cookies with a test to ensure not overflowing the cookies char buffer. Ensure idx + 1 is less than len before checking for space. The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: plugins/header_rewrite/operators.cc | 5 + 1 file changed, 5 insertions(+) -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org"'].
[trafficserver] 01/02: Delete space after semi colon when deleting cookies with test to ensure not overflowing end of cookies char buffer.
This is an automated email from the ASF dual-hosted git repository. zwoop pushed a commit to branch 7.1.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git commit 4d84b939c1cb186ef1631f84f2850f76358e3ed9 Author: Steven FeltnerAuthorDate: Tue Dec 12 13:44:45 2017 -0700 Delete space after semi colon when deleting cookies with test to ensure not overflowing end of cookies char buffer. (cherry picked from commit d04ec06d5495d0a453290ea3f6f746534fe0dcf7) --- plugins/header_rewrite/operators.cc | 5 + 1 file changed, 5 insertions(+) diff --git a/plugins/header_rewrite/operators.cc b/plugins/header_rewrite/operators.cc index c54e167..fc818ad 100644 --- a/plugins/header_rewrite/operators.cc +++ b/plugins/header_rewrite/operators.cc @@ -794,6 +794,11 @@ CookieHelper::cookieModifyHelper(const char *cookies, const size_t cookies_len, for (; idx < cookies_len && cookies[idx] != ';'; idx++) { ; } +// If we have not reached the end and there is a space after the +// semi-colon, advance one char +if (idx < cookies_len && std::isspace(cookies[idx + 1])) { + idx++; +} // cookie value is found size_t value_end_idx = idx; if (CookieHelper::COOKIE_OP_SET == cookie_op) { -- To stop receiving notification emails like this one, please contact "commits@trafficserver.apache.org" .
[trafficserver] branch master updated: Change normalize_ae handling to normalize request from client not request to server (for benefit of gzip plugin).
This is an automated email from the ASF dual-hosted git repository. amc 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 762dd93 Change normalize_ae handling to normalize request from client not request to server (for benefit of gzip plugin). 762dd93 is described below commit 762dd93a0f0b82368442f418045d0301eedf2adc Author: Walt KarasAuthorDate: Wed Nov 22 20:15:11 2017 + Change normalize_ae handling to normalize request from client not request to server (for benefit of gzip plugin). --- proxy/http/HttpTransact.cc | 10 +- tests/gold_tests/pluginTest/gzip/greplog.sh| 23 ++ tests/gold_tests/pluginTest/gzip/gzip.config | 7 + tests/gold_tests/pluginTest/gzip/gzip.gold | 296 + tests/gold_tests/pluginTest/gzip/gzip.test.py | 137 ++ tests/gold_tests/pluginTest/gzip/gzip_observer.py | 26 ++ tests/gold_tests/pluginTest/gzip/gzip_userver.gold | 19 ++ 7 files changed, 514 insertions(+), 4 deletions(-) diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index dbc6c4a..88a0e3e 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -7523,6 +7523,11 @@ HttpTransact::build_request(State *s, HTTPHdr *base_request, HTTPHdr *outgoing_r base_request->url_get()->copy(o_url); } } + +// Peform any configured normalization (including per-remap-rule configuration overrides) of the Accept-Encoding header +// field (if any). This has to be done in the request from the client, for the benefit of the gzip plugin. +// +HttpTransactHeaders::normalize_accept_encoding(s->txn_conf, base_request); } HttpTransactHeaders::copy_header_fields(base_request, outgoing_request, s->txn_conf->fwd_proxy_auth_to_parent); @@ -7623,12 +7628,9 @@ HttpTransact::build_request(State *s, HTTPHdr *base_request, HTTPHdr *outgoing_r TxnDebug("http_trans", "[build_request] request expect 100-continue headers removed"); } - // Peform any configured normalization (including per-remap-rule configuration overrides) of the Accept-Encoding header - // field (if any). - HttpTransactHeaders::normalize_accept_encoding(s->txn_conf, outgoing_request); - s->request_sent_time = ink_local_time(); s->current.now = s->request_sent_time; + // The assert is backwards in this case because request is being (re)sent. ink_assert(s->request_sent_time >= s->response_received_time); diff --git a/tests/gold_tests/pluginTest/gzip/greplog.sh b/tests/gold_tests/pluginTest/gzip/greplog.sh new file mode 100755 index 000..f42f1af --- /dev/null +++ b/tests/gold_tests/pluginTest/gzip/greplog.sh @@ -0,0 +1,23 @@ +# 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. + +grep --text \ + -e 'HTTP/' \ + -e '^> X-Ats-Gzip-Test:' \ + -e '^> Accept-Encoding:' \ + -e '^< Content-' \ + -e '^< Vary:' \ + -e '^$' diff --git a/tests/gold_tests/pluginTest/gzip/gzip.config b/tests/gold_tests/pluginTest/gzip/gzip.config new file mode 100644 index 000..c8f4fb6 --- /dev/null +++ b/tests/gold_tests/pluginTest/gzip/gzip.config @@ -0,0 +1,7 @@ +cache true +remove-accept-encoding true +compressible-content-type text/* +compressible-content-type application/x-javascript* +compressible-content-type application/javascript* +compressible-content-type application/json* +supported-algorithms gzip,br diff --git a/tests/gold_tests/pluginTest/gzip/gzip.gold b/tests/gold_tests/pluginTest/gzip/gzip.gold new file mode 100644 index 000..8bd76e3 --- /dev/null +++ b/tests/gold_tests/pluginTest/gzip/gzip.gold @@ -0,0 +1,296 @@ +> GET http://ae-0/obj0 HTTP/1.1 +> X-Ats-Gzip-Test: ts/0/gzip, deflate, sdch, br +> Accept-Encoding: gzip, deflate, sdch, br +< HTTP/1.1 200 OK +< Content-Type: text/javascript +< Content-Encoding: br +< Vary: Accept-Encoding +< Content-Length: 41 + +> GET http://ae-0/obj0 HTTP/1.1 +> X-Ats-Gzip-Test: ts/0/gzip +> Accept-Encoding: gzip +< HTTP/1.1 200 OK +< Content-Type: text/javascript +< Content-Encoding: gzip +< Vary: Accept-Encoding +< Content-Length: 60 + +> GET
[trafficserver] branch master updated: Add pparam to url_sig plugin to make it authenticate pristine URL, eliminate sheme check, other minor changes.
This is an automated email from the ASF dual-hosted git repository. amc 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 5fe7236 Add pparam to url_sig plugin to make it authenticate pristine URL, eliminate sheme check, other minor changes. 5fe7236 is described below commit 5fe7236975506514ed79d9f624c28bb84e60af60 Author: Walt KarasAuthorDate: Tue Nov 7 17:11:10 2017 + Add pparam to url_sig plugin to make it authenticate pristine URL, eliminate sheme check, other minor changes. --- doc/admin-guide/plugins/url_sig.en.rst | 10 +- plugins/experimental/url_sig/sign.pl | 8 +- plugins/experimental/url_sig/url_sig.c | 236 +++ tests/gold_tests/logging/ccid_ctid.test.py | 2 +- tests/gold_tests/pluginTest/url_sig/run_sign.sh| 138 +++ tests/gold_tests/pluginTest/url_sig/url_sig.config | 17 ++ tests/gold_tests/pluginTest/url_sig/url_sig.gold | 24 ++ .../gold_tests/pluginTest/url_sig/url_sig.test.py | 261 + 8 files changed, 592 insertions(+), 104 deletions(-) diff --git a/doc/admin-guide/plugins/url_sig.en.rst b/doc/admin-guide/plugins/url_sig.en.rst index cabbcf1..caee1cf 100644 --- a/doc/admin-guide/plugins/url_sig.en.rst +++ b/doc/admin-guide/plugins/url_sig.en.rst @@ -110,12 +110,14 @@ To require a valid signature, verified by a key from the list you generated earlier, modify your :file:`remap.config` configuration to include this plugin for any rules you wish it to affect. -Two parameters for each remap rule are required:: +Two parameters for each remap rule are required, and a third one is optional:: -@plugin=url_sig.so @pparam= +@plugin=url_sig.so @pparam= @pparam=pristineurl The first simply enables this plugin for the rule. The second specifies the -location of the configuration file containing your signing keys. +location of the configuration file containing your signing keys. The third one, +if present, causes authentication to be performed on the original (pristine) URL +as received from the client. (The value of the parameter is not case sensitive.) For example, if we wanted to restrict all paths under a ``/download`` directory on our website ``foo.com`` we might have a remap line like this:: @@ -184,7 +186,7 @@ Key Index Parts Configures which components of the URL to use for signature verification. -The value of this paramerts is a string of ones and zeroes, each enabling +The value of this parameter is a string of ones and zeroes, each enabling or disabling the use of a URL part for signatures. The URL scheme (e.g. ``http://``) is never part of the signature. The first number of this parameter's value indicates whether to include the FQDN, and all remaining diff --git a/plugins/experimental/url_sig/sign.pl b/plugins/experimental/url_sig/sign.pl index 7f2cc7b..66fa729 100755 --- a/plugins/experimental/url_sig/sign.pl +++ b/plugins/experimental/url_sig/sign.pl @@ -48,7 +48,9 @@ if ( !defined($key) || !defined($url) || !defined($duration) || !defined($keyind exit(1); } -$url =~ s/^http:\/\///; +my $url_prefix = $url; +$url_prefix =~ s/^([^:]*:\/\/).*$/$1/; +$url =~ s/^[^:]+:\/\///; my $i = 0; my $part_active= 0; my $j = 0; @@ -97,13 +99,13 @@ else { if ($urlHasParams == -1) { my $qstring = ( split( /\?/, $string ) )[1]; - print "curl -s -o /dev/null -v --max-redirs 0 'http://; . $url . "?" . $qstring . $digest . "'\n"; + print "curl -s -o /dev/null -v --max-redirs 0 '" . $url_prefix . $url . "?" . $qstring . $digest . "'\n"; } else { my $url_noparams = ( split( /\?/, $url ) )[0]; my $qstring = ( split( /\?/, $string ) )[1]; - print "curl -s -o /dev/null -v --max-redirs 0 'http://; . $url_noparams . "?" . $qstring . $digest . "'\n"; + print "curl -s -o /dev/null -v --max-redirs 0 '" . $url_prefix . $url_noparams . "?" . $qstring . $digest . "'\n"; } sub help { diff --git a/plugins/experimental/url_sig/url_sig.c b/plugins/experimental/url_sig/url_sig.c index ad583c9..537ef35 100644 --- a/plugins/experimental/url_sig/url_sig.c +++ b/plugins/experimental/url_sig/url_sig.c @@ -38,6 +38,7 @@ #include #include #include +#include #ifdef HAVE_PCRE_PCRE_H #include @@ -48,7 +49,7 @@ #include #include -static const char *PLUGIN_NAME = "url_sig"; +static const char PLUGIN_NAME[] = "url_sig"; struct config { TSHttpStatus err_status; @@ -56,6 +57,7 @@ struct config { char keys[MAX_KEY_NUM][MAX_KEY_LEN]; pcre *regex; pcre_extra *regex_extra; + int pristine_url_flag; }; static void @@ -83,12 +85,12 @@ TSReturnCode TSRemapInit(TSRemapInterface *api_info, char *errbuf, int errbuf_size) { if (!api_info) { -strncpy(errbuf, "[tsremap_init] - Invalid TSRemapInterface
[trafficserver] branch master updated: coverity 1367517: Destroy held lock
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 ebd16da coverity 1367517: Destroy held lock ebd16da is described below commit ebd16da3bdb05746798e0bd9690ee6d2142b494e Author: Bryan CallAuthorDate: Tue Dec 12 18:54:50 2017 -0800 coverity 1367517: Destroy held lock --- mgmt/FileManager.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/mgmt/FileManager.cc b/mgmt/FileManager.cc index 23fb028..ad2de62 100644 --- a/mgmt/FileManager.cc +++ b/mgmt/FileManager.cc @@ -76,6 +76,7 @@ FileManager::~FileManager() ink_hash_table_destroy(bindings); + ink_mutex_release(); ink_mutex_destroy(); ink_mutex_destroy(); } -- To stop receiving notification emails like this one, please contact ['"commits@trafficserver.apache.org" '].
[trafficserver] branch master updated: option for using the host field for response lookup
This is an automated email from the ASF dual-hosted git repository. paziz 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 b115de7 option for using the host field for response lookup b115de7 is described below commit b115de779c4399199989ddce7b745cf18f2d9a86 Author: Persia AzizAuthorDate: Tue Dec 12 19:01:07 2017 -0600 option for using the host field for response lookup --- tests/gold_tests/autest-site/microserver.test.ext | 57 --- tests/gold_tests/remap/gold/lookupTest.gold | 14 + tests/gold_tests/remap/remap_http.test.py | 21 ++- tests/tools/microServer/uWServer.py | 67 ++- 4 files changed, 134 insertions(+), 25 deletions(-) diff --git a/tests/gold_tests/autest-site/microserver.test.ext b/tests/gold_tests/autest-site/microserver.test.ext index 1ca1cb4..4ab6783 100644 --- a/tests/gold_tests/autest-site/microserver.test.ext +++ b/tests/gold_tests/autest-site/microserver.test.ext @@ -49,16 +49,54 @@ def addResponse(self, filename, testName, request_header, response_header): self.Setup.CopyAs(absFilepath, self.Variables.DataDir) return +def getHeaderFieldVal(request_header, field): +requestline = request_header["headers"].split("\r\n")[0] +requestline = requestline.split(" ")[1] +field = field+':' +valField = request_header["headers"].split(field,1); +val="" +if len(valField)>1: +field_v = valField[1].split("\r\n",1) +if len(field_v)>0: +val = field_v[0].strip() +return val # addResponse adds customized response with respect to request_header. request_header and response_header are both dictionaries def addResponse(self, filename, request_header, response_header): requestline = request_header["headers"].split("\r\n")[0] -requestline = requestline.split(" ")[1] -resourceLocation = requestline.split("/", 1) -if len(resourceLocation) > 1: -rl = resourceLocation[1] -else: -rl = "" +host_ = "" +path_ = "" +if requestline: +url_part = requestline.split(" ") +if len(url_part)>1: +if url_part[1].startswith("http"): +path_ = url_part[1].split("/",2)[2] +host_,path_ = path_.split("/",1) +else: +path_ = url_part[1].split("/",1)[1] + +kpath = "" +#print("Format of lookup key",self.Variables.lookup_key) + +argsList = [] +keyslist = self.Variables.lookup_key.split("}") +for keystr in keyslist: +if keystr == '{PATH': +kpath = kpath+path_ +continue +if keystr == '{HOST': +kpath = kpath + host_ +continue +if keystr == '': #empty +continue +stringk = keystr.replace("{%","") +argsList.append(stringk) +KeyList = [] +for argsL in argsList: +field_val = getHeaderFieldVal(request_header,argsL) +if field_val!=None: +KeyList.append(field_val) +rl = "".join(KeyList)+kpath txn = dict() txn["timestamp"] = "" txn["uuid"] = rl @@ -103,7 +141,7 @@ def makeHeader(self, requestString, **kwargs): return headerStr -def MakeOriginServer(obj, name, port=False, ip=False, delay=False, ssl=False, options={}): +def MakeOriginServer(obj, name, port=False, ip=False, delay=False, ssl=False, lookup_key='{PATH}', options={}): server_path = os.path.join(obj.Variables.AtsTestToolsDir, 'microServer/uWServer.py') data_dir = os.path.join(obj.RunDirectory, name) # create Process @@ -114,8 +152,8 @@ def MakeOriginServer(obj, name, port=False, ip=False, delay=False, ssl=False, op ip = '127.0.0.1' if (delay == False): delay = 0 -command = "python3 {0} --data-dir {1} --port {2} --ip_address {3} --delay {4} -m test --ssl {5}".format( -server_path, data_dir, port, ip, delay, ssl) +command = "python3 {0} --data-dir {1} --port {2} --ip_address {3} --delay {4} -m test --ssl {5} --lookupkey '{6}'".format( +server_path, data_dir, port, ip, delay, ssl,lookup_key) for flag, value in options.items(): command += " {} {}".format(flag, value) @@ -123,6 +161,7 @@ def MakeOriginServer(obj, name, port=False, ip=False, delay=False, ssl=False, op p.Command = command p.Setup.MakeDir(data_dir) p.Variables.DataDir = data_dir +p.Variables.lookup_key = lookup_key p.Ready = When.PortOpen(port, ip) p.ReturnCode = Any(None,0) AddMethodToInstance(p, addResponse) diff --git a/tests/gold_tests/remap/gold/lookupTest.gold b/tests/gold_tests/remap/gold/lookupTest.gold new file mode 100644 index 000..bdf7213 --- /dev/null +++ b/tests/gold_tests/remap/gold/lookupTest.gold @@ -0,0 +1,14 @@ +`` +> GET http://www.testexample.com/test``