[trafficserver] 02/03: Add compatibility define when building with OpenSSL3 (#8837)
This is an automated email from the ASF dual-hosted git repository. bcall pushed a commit to branch 9.1.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git commit 9cb73bcb76338e4fb7087ff4caefeef07ce04964 Author: Bryan Call AuthorDate: Thu May 12 08:10:06 2022 -0700 Add compatibility define when building with OpenSSL3 (#8837) (cherry picked from commit cea26fe72406963fa7648a9bef3099a1a545f838) --- build/crypto.m4 | 19 +++ configure.ac| 3 +++ 2 files changed, 22 insertions(+) diff --git a/build/crypto.m4 b/build/crypto.m4 index 8a4d8fea8..d4c054be6 100644 --- a/build/crypto.m4 +++ b/build/crypto.m4 @@ -58,6 +58,25 @@ int main() { [AC_MSG_FAILURE([requires an OpenSSL version 1.0.2 or greater])]) ]) +dnl +dnl Check OpenSSL Version 3 +dnl +AC_DEFUN([TS_CHECK_OPENSSL3], [ + AC_MSG_CHECKING([for OpenSSL version 3]) + AC_RUN_IFELSE([AC_LANG_SOURCE( + [ +#include +int main() { + if (OPENSSL_VERSION_NUMBER > 0x300fL) { +return 0; + } + return 1; +} + ])], + [AC_MSG_RESULT(yes) TS_ADDTO(CPPFLAGS, -DOPENSSL_API_COMPAT=10002)], [AC_MSG_RESULT(no)] + ) +]) + dnl dnl Since OpenSSL 1.1.0 dnl diff --git a/configure.ac b/configure.ac index d753b294c..24cac8875 100644 --- a/configure.ac +++ b/configure.ac @@ -1249,6 +1249,9 @@ TS_CHECK_CRYPTO # Check for OpenSSL Version TS_CHECK_CRYPTO_VERSION +# Check for OpenSSL Version 3 and add compatiblity define if needed +TS_CHECK_OPENSSL3 + # Check for openssl ASYNC jobs TS_CHECK_CRYPTO_ASYNC
[trafficserver] 01/03: mkdfa.c is not being used and doesn't compile with gcc 12.1.1 (#8838)
This is an automated email from the ASF dual-hosted git repository. bcall pushed a commit to branch 9.1.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git commit 56e8c475e70b459313d0bb23bcd2b4360ab370cc Author: Bryan Call AuthorDate: Thu May 19 08:31:53 2022 -0700 mkdfa.c is not being used and doesn't compile with gcc 12.1.1 (#8838) (cherry picked from commit 5fe6f413efdd296351a53391f3a0d21c5514e1d7) Conflicts: src/tscore/Makefile.am --- src/tscore/Makefile.am | 4 +- src/tscore/mkdfa.c | 621 - 2 files changed, 1 insertion(+), 624 deletions(-) diff --git a/src/tscore/Makefile.am b/src/tscore/Makefile.am index 878fbb187..0113de9fb 100644 --- a/src/tscore/Makefile.am +++ b/src/tscore/Makefile.am @@ -18,7 +18,7 @@ include $(top_srcdir)/build/tidy.mk -noinst_PROGRAMS = mkdfa CompileParseRules +noinst_PROGRAMS = CompileParseRules check_PROGRAMS = test_geometry test_X509HostnameValidator test_tscore if EXPENSIVE_TESTS @@ -140,8 +140,6 @@ $(srcdir)/ParseRules.cc: ParseRulesCType ParseRulesCType: CompileParseRules LSAN_OPTIONS='detect_leaks=0' ./CompileParseRules -mkdfa_SOURCES = mkdfa.c - test_atomic_SOURCES = test_atomic.cc test_atomic_LDADD = libtscore.la $(top_builddir)/src/tscpp/util/libtscpputil.la @LIBPCRE@ diff --git a/src/tscore/mkdfa.c b/src/tscore/mkdfa.c deleted file mode 100644 index 2e3092941..0 --- a/src/tscore/mkdfa.c +++ /dev/null @@ -1,621 +0,0 @@ -/** @file - - A brief file description - - @section license License - - 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 -#include -#include -#include -#include - -#define SIZEOF(t) (sizeof(t) / (sizeof((t)[0]))) - -typedef struct _info_t info_t; -typedef struct _state_t state_t; -typedef struct _transition_t transition_t; - -struct _info_t { - const char *name; - const char *value; - int namelen; -}; - -struct _state_t { - int num; - const char *value; - transition_t *transitions; -}; - -struct _transition_t { - int value; - state_t *state; - transition_t *next; -}; - -info_t fields[] = { - {"Accept", "MIME_FIELD_ACCEPT", 0}, - {"Accept-Charset", "MIME_FIELD_ACCEPT_CHARSET", 0}, - {"Accept-Encoding", "MIME_FIELD_ACCEPT_ENCODING", 0}, - {"Accept-Language", "MIME_FIELD_ACCEPT_LANGUAGE", 0}, - {"Accept-Ranges", "MIME_FIELD_ACCEPT_RANGES", 0}, - {"Age", "MIME_FIELD_AGE", 0}, - {"Allow", "MIME_FIELD_ALLOW", 0}, - {"Approved", "MIME_FIELD_APPROVED", 0}, - {"Authorization", "MIME_FIELD_AUTHORIZATION", 0}, - {"Bytes", "MIME_FIELD_BYTES", 0}, - {"Cache-Control", "MIME_FIELD_CACHE_CONTROL", 0}, - {"Connection", "MIME_FIELD_CONNECTION", 0}, - {"Content-Base", "MIME_FIELD_CONTENT_BASE", 0}, - {"Content-Encoding", "MIME_FIELD_CONTENT_ENCODING", 0}, - {"Content-Language", "MIME_FIELD_CONTENT_LANGUAGE", 0}, - {"Content-Length", "MIME_FIELD_CONTENT_LENGTH", 0}, - {"Content-Location", "MIME_FIELD_CONTENT_LOCATION", 0}, - {"Content-Md5", "MIME_FIELD_CONTENT_MD5", 0}, - {"Content-Range", "MIME_FIELD_CONTENT_RANGE", 0}, - {"Content-Type", "MIME_FIELD_CONTENT_TYPE", 0}, - {"Control", "MIME_FIELD_CONTROL", 0}, - {"Cookie", "MIME_FIELD_COOKIE", 0}, - {"Date", "MIME_FIELD_DATE", 0}, - {"Distribution", "MIME_FIELD_DISTRIBUTION", 0}, - {"Etag", "MIME_FIELD_ETAG", 0}, - {"Expires", "MIME_FIELD_EXPIRES", 0}, - {"Followup-To", "MIME_FIELD_FOLLOWUP_TO", 0}, - {"From", "MIME_FIELD_FROM", 0}, - {"Host", "MIME_FIELD_HOST", 0}, - {"If-Match", "MIME_FIELD_IF_MATCH", 0}, - {"If-Modified-Since", "MIME_FIELD_IF_MODIFIED_SINCE", 0}, - {"If-None-Match", "MIME_FIELD_IF_NONE_MATCH", 0}, - {"If-Range", "MIME_FIELD_IF_RANGE", 0}, - {"If-Unmodified-Since", "MIME_FIELD_IF_UNMODIFIED_SINCE", 0}, - {"Keywords", "MIME_FIELD_KEYWORDS", 0}, - {"Last-Modified", "MIME_FIELD_LAST_MODIFIED", 0}, - {"Lines", "MIME_FIELD_LINES", 0}, - {"Location", "MIME_FIELD_LOCATION", 0}, - {"Max-Forwards", "MIME_FIELD_MAX_FORWARDS", 0}, - {"Message-ID", "MIME_FIELD_MESSAGE_ID", 0}, - {"Newsgroups", "MIME_FIELD_NEWSGROUPS", 0}, - {"Organization", "MIME_FIELD_ORGANIZATION", 0}, - {"Path", "MIME_FIELD_PATH", 0}, - {"Pragma", "MIME_FIELD_PRAGMA", 0}, -
[trafficserver] 03/03: Modifying array outside bounds (#8806)
This is an automated email from the ASF dual-hosted git repository. bcall pushed a commit to branch 9.1.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git commit 7e785535c143843123bf2af1bc6885ea154e28ac Author: Bryan Call AuthorDate: Mon Apr 25 16:04:27 2022 -0700 Modifying array outside bounds (#8806) (cherry picked from commit a4920094574dddfd88a6148dd88fd790b82d613b) --- tools/http_load/http_load.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/http_load/http_load.c b/tools/http_load/http_load.c index 8d89962b5..238a77e43 100644 --- a/tools/http_load/http_load.c +++ b/tools/http_load/http_load.c @@ -438,7 +438,7 @@ main(int argc, char **argv) } else { extra_headers = malloc_check(65536); strncpy(extra_headers, argv[++argn], 65536 - 1); -extra_headers[65536] = '\0'; +extra_headers[65535] = '\0'; } } else if (strncmp(argv[argn], "-http_version", strlen(argv[argn])) == 0 && argn + 1 < argc) { http_version = argv[++argn];
[trafficserver] branch 9.1.x updated (804af1232 -> 7e785535c)
This is an automated email from the ASF dual-hosted git repository. bcall pushed a change to branch 9.1.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git from 804af1232 9.1.x: Fix GCC 12 compiler warnings (#9135) new 56e8c475e mkdfa.c is not being used and doesn't compile with gcc 12.1.1 (#8838) new 9cb73bcb7 Add compatibility define when building with OpenSSL3 (#8837) new 7e785535c Modifying array outside bounds (#8806) The 3 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: build/crypto.m4 | 19 ++ configure.ac| 3 + src/tscore/Makefile.am | 4 +- src/tscore/mkdfa.c | 621 tools/http_load/http_load.c | 2 +- 5 files changed, 24 insertions(+), 625 deletions(-) delete mode 100644 src/tscore/mkdfa.c
[trafficserver] branch 9.1.x updated: 9.1.x: Fix GCC 12 compiler warnings (#9135)
This is an automated email from the ASF dual-hosted git repository. bcall pushed a commit to branch 9.1.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/9.1.x by this push: new 804af1232 9.1.x: Fix GCC 12 compiler warnings (#9135) 804af1232 is described below commit 804af1232e34a242014c82bee0e79fb50dc919b5 Author: Brian Neradt AuthorDate: Tue Oct 11 18:09:28 2022 -0500 9.1.x: Fix GCC 12 compiler warnings (#9135) * Fix Clang 13.0.1 and GCC 12.0.1 Compiler Warnings (#8690) This cherry-picks two commits from master: Fix Clang 13.0.1 compiler warnings (#8685) This fixes a couple compiler warnings raised by Clang 13.0.1. (cherry picked from commit 96ce993fa53a05b872c5041629e3aac0bc15d56d) Fix warnings from GCC 12.0.1 (#8684) This patch fixes warnings generated by GCC 12.0.1. The warnings involved the use of the deprecated std::binary_function, std::unary_function, and std::iterator interfaces. The use of these was considered more confusing than explicitly declaring the associated types. Therefore this patch replaces the use of these deprecated interfaces with the declaration of the associated types. (cherry picked from commit 0ae34d4d1699d978f6938027efb2ecb9ae05c89a) (cherry picked from commit 1a37ae9efaf40ee19e3a735828c03ed25eac6a4f) * LogFilter: fix NULL termination check (#8603) gcc-12 generated the following warning: proxy/logging/LogFilter.h: In function 'void wipeField(char**, char*, const char*)': proxy/logging/LogFilter.h:477:35: error: comparing the result of pointer addition '(new_param + 1)' and NULL [-Werror=address] 477 | if (new_param && (new_param + 1)) { |~~~^~~~ That is indeed a bug. `new_param + 1` will always be non-NULL even if new_param is NULL because 1 will be added to it. The intention was to check for the string's null terminator at the offset, which is done via a dereference. (cherry picked from commit 9966c9b8210ade388598aa42ac49f960126bfff7) --- example/plugins/cpp-api/boom/boom.cc | 5 - include/tscore/IntrusivePtr.h| 6 +- include/tscpp/api/Headers.h | 10 -- iocore/net/quic/QUICFrame.h | 5 - iocore/net/quic/QUICVersionNegotiator.cc | 2 -- proxy/logging/LogFilter.h| 2 +- src/tscore/HostLookup.cc | 6 +- src/wccp/WccpMeta.h | 6 +- 8 files changed, 32 insertions(+), 10 deletions(-) diff --git a/example/plugins/cpp-api/boom/boom.cc b/example/plugins/cpp-api/boom/boom.cc index a312e7f20..7a3a3234d 100644 --- a/example/plugins/cpp-api/boom/boom.cc +++ b/example/plugins/cpp-api/boom/boom.cc @@ -98,13 +98,16 @@ GlobalPlugin *plugin; // Functor that decides whether the HTTP error can be rewritten or not. // Rewritable codes are: 2xx, 3xx, 4xx, 5xx and 6xx. // 1xx is NOT rewritable! -class IsRewritableCode : public std::unary_function +class IsRewritableCode { // could probably be replaced with mem_ptr_fun().. private: int current_code_; std::string current_code_string_; public: + using argument_type = std::string; + using result_type = bool; + explicit IsRewritableCode(int current_code) : current_code_(current_code) { std::ostringstream oss; diff --git a/include/tscore/IntrusivePtr.h b/include/tscore/IntrusivePtr.h index bfe63a3ae..70cc671e3 100644 --- a/include/tscore/IntrusivePtr.h +++ b/include/tscore/IntrusivePtr.h @@ -330,9 +330,13 @@ public: static void finalize(T *t); /// Strict weak order for STL containers. - class Order : public std::binary_function, IntrusivePtr, bool> + class Order { public: +using first_argument_type = IntrusivePtr; +using second_argument_type = IntrusivePtr; +using result_type = bool; + /// Default constructor. Order() {} /// Compare by raw pointer. diff --git a/include/tscpp/api/Headers.h b/include/tscpp/api/Headers.h index 9e6daea8e..ffaffde81 100644 --- a/include/tscpp/api/Headers.h +++ b/include/tscpp/api/Headers.h @@ -109,12 +109,15 @@ class HeaderField; /** * @brief A header field value iterator iterates through all header fields. */ -class header_field_value_iterator : public std::iterator +class header_field_value_iterator { private: HeaderFieldValueIteratorState *state_; public: + using iterator_category = std::forward_iterator_tag; + using value_type= int; + /** * Constructor for header_field_value_iterator, this shouldn't need to be used directly. * @param bufp the TSMBuffer associated with the headers @@ -169,13 +172,16 @@ public: /** * @brief A header field iterator is an iterator that dereferences to a HeaderField. */ -class header_field_iterator : public std::iterator +class header_field_iterator
[trafficserver] branch 9.1.x updated: Fix a couple compiler warnings (#9033)
This is an automated email from the ASF dual-hosted git repository. bcall pushed a commit to branch 9.1.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/9.1.x by this push: new 3621b682a Fix a couple compiler warnings (#9033) 3621b682a is described below commit 3621b682a3c0c260d368b2ea3f6ac1faedd105e5 Author: Brian Neradt AuthorDate: Tue Oct 11 17:25:09 2022 -0500 Fix a couple compiler warnings (#9033) This pulls in a couple compiler warning fixes from later 9.x branches. Type error: experimental/traffic_dump/json_utils.cc: In function ‘int {anonymous}::esc_json_out(const char*, int64_t, std::ostream&)’: experimental/traffic_dump/json_utils.cc:117:18: error: comparison is always true due to limited range of data type [-Werror=type-limits] 117 | if ('\x00' <= c && c <= '\x1f') { | ~~~^~~~ Maybe uninitialized error: header_rewrite/conditions.cc: In static member function ‘static void ConditionInbound::append_value(std::string&, const Resources&, NetworkSessionQualifiers)’: header_rewrite/conditions.cc:1131:56: error: ‘tags’ may be used uninitialized [-Werror=maybe-uninitialized] 1131 | TSHttpTxnClientProtocolStackGet(res.txnp, tags.size(), tags.data(), ); | ~^~ In file included from header_rewrite/conditions.cc:29: /opt/rh/gcc-toolset-11/root/usr/include/c++/11/array:176:7: note: by argument 1 of type ‘const std::array*’ to ‘constexpr std::array<_Tp, _Nm>::size_type std::array<_Tp, _Nm>::size() const [with _Tp = const char*; long unsigned int _Nm = 8]’ declared here 176 | size() const noexcept { return _Nm; } | ^~~~ header_rewrite/conditions.cc:1128:33: note: ‘tags’ declared here 1128 | std::array tags; | ^~~~ --- plugins/experimental/traffic_dump/json_utils.cc | 2 +- plugins/header_rewrite/conditions.cc| 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/experimental/traffic_dump/json_utils.cc b/plugins/experimental/traffic_dump/json_utils.cc index 3b5fbbdc6..54fa69468 100644 --- a/plugins/experimental/traffic_dump/json_utils.cc +++ b/plugins/experimental/traffic_dump/json_utils.cc @@ -114,7 +114,7 @@ esc_json_out(const char *buf, int64_t len, std::ostream ) break; } default: { - if ('\x00' <= c && c <= '\x1f') { + if (c <= '\x1f') { write_buffered_context(buf, prevIdx, idx, jsonfile); jsonfile << "\\u" << std::hex << std::setw(4) << std::setfill('0') << static_cast(c); } diff --git a/plugins/header_rewrite/conditions.cc b/plugins/header_rewrite/conditions.cc index f88dadcb9..7da7dfbfd 100644 --- a/plugins/header_rewrite/conditions.cc +++ b/plugins/header_rewrite/conditions.cc @@ -1125,9 +1125,9 @@ ConditionInbound::append_value(std::string , const Resources , NetworkSess zret = TSHttpTxnClientProtocolStackContains(res.txnp, "ip"); break; case NET_QUAL_STACK: { -std::array tags; -int count = 0; -size_t len = 0; +std::array tags = {}; +int count= 0; +size_t len = 0; TSHttpTxnClientProtocolStackGet(res.txnp, tags.size(), tags.data(), ); for (int i = 0; i < count; ++i) { len += 1 + strlen(tags[i]);
[trafficserver] branch master updated (c4d07a402 -> 700500407)
This is an automated email from the ASF dual-hosted git repository. duke8253 pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git from c4d07a402 Remove unused functions in SocketManager namespace. (#9126) add 700500407 mimalloc nodump allocator (#8791) No new revisions were added by this update. Summary of changes: build/mimalloc.m4 | 7 +- include/tscore/{JeAllocator.h => JeMiAllocator.h} | 54 +-- src/tscore/{JeAllocator.cc => JeMiAllocator.cc} | 84 +++ src/tscore/Makefile.am| 2 +- src/tscore/ink_queue.cc | 8 +-- 5 files changed, 100 insertions(+), 55 deletions(-) rename include/tscore/{JeAllocator.h => JeMiAllocator.h} (62%) rename src/tscore/{JeAllocator.cc => JeMiAllocator.cc} (54%)
[trafficserver] branch master updated: Remove unused functions in SocketManager namespace. (#9126)
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 c4d07a402 Remove unused functions in SocketManager namespace. (#9126) c4d07a402 is described below commit c4d07a402f6b48fe032444d9756ea47655f5559c Author: Walt Karas AuthorDate: Tue Oct 11 15:58:33 2022 -0500 Remove unused functions in SocketManager namespace. (#9126) Co-authored-by: Walt Karas --- iocore/eventsystem/I_SocketManager.h | 38 + iocore/eventsystem/P_UnixSocketManager.h | 280 --- 2 files changed, 3 insertions(+), 315 deletions(-) diff --git a/iocore/eventsystem/I_SocketManager.h b/iocore/eventsystem/I_SocketManager.h index 9506c877a..718293f83 100644 --- a/iocore/eventsystem/I_SocketManager.h +++ b/iocore/eventsystem/I_SocketManager.h @@ -50,13 +50,11 @@ #endif #endif -#define DEFAULT_OPEN_MODE 0644 - extern int net_config_poll_timeout; #define SOCKET int -/** Utility class for socket operations. +/** Utility namespace for socket operations. */ namespace SocketManager { @@ -65,60 +63,30 @@ bool fastopen_supported(); // result is the socket or -errno SOCKET socket(int domain = AF_INET, int type = SOCK_STREAM, int protocol = 0); -SOCKET mc_socket(int domain = AF_INET, int type = SOCK_DGRAM, int protocol = 0, bool bNonBlocking = true); + +const mode_t DEFAULT_OPEN_MODE{0644}; // result is the fd or -errno int open(const char *path, int oflag = O_RDWR | O_NDELAY | O_CREAT, mode_t mode = DEFAULT_OPEN_MODE); // result is the number of bytes or -errno int64_t read(int fd, void *buf, int len, void *pOLP = nullptr); -int64_t vector_io(int fd, struct iovec *vector, size_t count, int read_request, void *pOLP = nullptr); -int64_t readv(int fd, struct iovec *vector, size_t count); -int64_t read_vector(int fd, struct iovec *vector, size_t count, void *pOLP = nullptr); -int64_t pread(int fd, void *buf, int len, off_t offset, char *tag = nullptr); int recv(int s, void *buf, int len, int flags); int recvfrom(int fd, void *buf, int size, int flags, struct sockaddr *addr, socklen_t *addrlen); int recvmsg(int fd, struct msghdr *m, int flags, void *pOLP = nullptr); int64_t write(int fd, void *buf, int len, void *pOLP = nullptr); -int64_t writev(int fd, struct iovec *vector, size_t count); -int64_t write_vector(int fd, struct iovec *vector, size_t count, void *pOLP = nullptr); int64_t pwrite(int fd, void *buf, int len, off_t offset, char *tag = nullptr); int send(int fd, void *buf, int len, int flags); int sendto(int fd, void *buf, int len, int flags, struct sockaddr const *to, int tolen); int sendmsg(int fd, struct msghdr *m, int flags, void *pOLP = nullptr); int64_t lseek(int fd, off_t offset, int whence); -int fstat(int fd, struct stat *); -int unlink(char *buf); int fsync(int fildes); -int ftruncate(int fildes, off_t length); -int lockf(int fildes, int function, off_t size); int poll(struct pollfd *fds, unsigned long nfds, int timeout); -#if TS_USE_EPOLL -int epoll_create(int size); -int epoll_close(int eps); -int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event); -int epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout = net_config_poll_timeout); -#endif - -#if TS_USE_KQUEUE -int kqueue(); -int kevent(int kq, const struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, - const struct timespec *timeout); -#endif - -#if TS_USE_PORT -int port_create(); -int port_associate(int port, int fd, uintptr_t obj, int events, void *user); -int port_dissociate(int port, int fd, uintptr_t obj); -int port_getn(int port, port_event_t *list, uint_t max, uint_t *nget, timespec_t *timeout); -#endif - int shutdown(int s, int how); -int dup(int s); // result is the fd or -errno int accept4(int s, struct sockaddr *addr, socklen_t *addrlen, int flags); diff --git a/iocore/eventsystem/P_UnixSocketManager.h b/iocore/eventsystem/P_UnixSocketManager.h index dc5c0c911..177a3704f 100644 --- a/iocore/eventsystem/P_UnixSocketManager.h +++ b/iocore/eventsystem/P_UnixSocketManager.h @@ -82,82 +82,6 @@ SocketManager::read(int fd, void *buf, int size, void * /* pOLP ATS_UNUSED */) return r; } -TS_INLINE int64_t -SocketManager::pread(int fd, void *buf, int size, off_t offset, char * /* tag ATS_UNUSED */) -{ - int64_t r; - do { -r = ::pread(fd, buf, size, offset); -if (r < 0) { - r = -errno; -} - } while (r == -EINTR); - return r; -} - -TS_INLINE int64_t -SocketManager::readv(int fd, struct iovec *vector, size_t count) -{ - int64_t r; - do { -// coverity[tainted_data_argument] -if (likely((r = ::readv(fd, vector, count)) >= 0)) { - break; -} -r = -errno; - } while (transient_error()); - return r; -} - -TS_INLINE int64_t -SocketManager::vector_io(int fd,
[trafficserver] branch master updated (4f4ee2e21 -> 495f81f9a)
This is an automated email from the ASF dual-hosted git repository. wkaras pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git from 4f4ee2e21 Allocator that just uses malloc and bypasses custom jemalloc or freelists (#9108) add 495f81f9a In NetHandler, don't use a union to do a ratchet cast to base class. (#9127) No new revisions were added by this update. Summary of changes: iocore/net/P_UnixNet.h | 4 ++-- iocore/net/UnixNet.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
[trafficserver] branch master updated (ed13a31f2 -> 4f4ee2e21)
This is an automated email from the ASF dual-hosted git repository. cmcfarlen pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git from ed13a31f2 fix contradicting documentation and say a bit about the resident size of a volume directory (#9133) add 4f4ee2e21 Allocator that just uses malloc and bypasses custom jemalloc or freelists (#9108) No new revisions were added by this update. Summary of changes: configure.ac | 11 include/tscore/Allocator.h| 117 +++--- include/tscore/ink_config.h.in| 2 + iocore/eventsystem/I_ProxyAllocator.h | 3 +- mgmt/RecordsConfig.cc | 2 + src/traffic_server/traffic_server.cc | 6 ++ 6 files changed, 130 insertions(+), 11 deletions(-)
[trafficserver] branch master updated (4335cf868 -> ed13a31f2)
This is an automated email from the ASF dual-hosted git repository. cmcfarlen pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git from 4335cf868 Add Au test for various HTTP requests that are not RFC compliant. (#9035) add ed13a31f2 fix contradicting documentation and say a bit about the resident size of a volume directory (#9133) No new revisions were added by this update. Summary of changes: doc/admin-guide/storage/index.en.rst | 2 +- doc/developer-guide/cache-architecture/architecture.en.rst | 4 2 files changed, 5 insertions(+), 1 deletion(-)
[trafficserver] branch master updated (07e7ab94c -> 4335cf868)
This is an automated email from the ASF dual-hosted git repository. wkaras pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git from 07e7ab94c Remove unnecessary, dangerous casts from SET_HANDLER and SET_CONTINUATION invocations. (#9129) add 4335cf868 Add Au test for various HTTP requests that are not RFC compliant. (#9035) No new revisions were added by this update. Summary of changes: tests/gold_tests/bad_http_fmt/bad_http_fmt.test.py | 175 + tests/gold_tests/bad_http_fmt/client.gold | 25 +++ tests/gold_tests/bad_http_fmt/server.gold | 16 ++ 3 files changed, 216 insertions(+) create mode 100644 tests/gold_tests/bad_http_fmt/bad_http_fmt.test.py create mode 100644 tests/gold_tests/bad_http_fmt/client.gold create mode 100644 tests/gold_tests/bad_http_fmt/server.gold
[trafficserver] branch 9.2.x updated: Updated ChangeLog
This is an automated email from the ASF dual-hosted git repository. zwoop pushed a commit to branch 9.2.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/9.2.x by this push: new e137c6366 Updated ChangeLog e137c6366 is described below commit e137c636671703405613840f40f074e7991bb671 Author: Leif Hedstrom AuthorDate: Tue Oct 11 09:31:02 2022 -0600 Updated ChangeLog --- CHANGELOG-9.2.0 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG-9.2.0 b/CHANGELOG-9.2.0 index 17e11229f..4cf77c28e 100644 --- a/CHANGELOG-9.2.0 +++ b/CHANGELOG-9.2.0 @@ -427,6 +427,7 @@ Changes with Apache Traffic Server 9.2.0 #8690 - 9.2.x: Fix Clang 13.0.1 and GCC 12.0.1 Compiler Warnings #8691 - 9.2.x: Fix test_QUIC unit test builds. (#8678) #8692 - Add docs for parent.config defaults + #8698 - Remove intermediate buffer in PluginVC #8700 - Change api TSSslTicketKeyUpdate to return TSReturnCode #8705 - Add back "DNS: Fix lack of nameserver failover in low use circumstances." #8706 - Provide libquic.a definition to VIO::VIO() @@ -554,3 +555,5 @@ Changes with Apache Traffic Server 9.2.0 #9106 - Fix unused-but-set-variable warnings by llvm-15 #9110 - Updating AuTest to use Proxy Verifier v2.4.2 #9112 - Fix expected sha1sum for the Proxy Verifier binary + #9122 - Fix HTTP/2 session receive window handling for small sizes (#9117) + #9123 - 9.2: Fix s3_auth_config test output check
[trafficserver] branch 9.2.x updated: Remove intermediate buffer in PluginVC (#8698)
This is an automated email from the ASF dual-hosted git repository. zwoop pushed a commit to branch 9.2.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/9.2.x by this push: new 0d7d5551c Remove intermediate buffer in PluginVC (#8698) 0d7d5551c is described below commit 0d7d5551c1316178ee82c41105b317078b47c9d9 Author: Serris Lew AuthorDate: Mon Sep 19 10:30:10 2022 -0700 Remove intermediate buffer in PluginVC (#8698) * Remove intermediate buffer in PluginVC * Update inactivity status for both sides * Accounts for read ntodo when writing, resolves issues when rw ntodo are not equal * Checks vc is closed before reenabled, prevent race cond Co-authored-by: Serris Lew (cherry picked from commit feb7f1e368752065e67096c9df021845e07e5f5f) --- proxy/PluginVC.cc | 240 +- proxy/PluginVC.h | 10 +-- 2 files changed, 77 insertions(+), 173 deletions(-) diff --git a/proxy/PluginVC.cc b/proxy/PluginVC.cc index e64d59f68..d491d4d5a 100644 --- a/proxy/PluginVC.cc +++ b/proxy/PluginVC.cc @@ -217,11 +217,11 @@ PluginVC::main_handler(int event, void *data) } if (need_read_process) { - process_read_side(false); + process_read_side(); } if (need_write_process && !closed) { - process_write_side(false); + process_write_side(); } } @@ -343,11 +343,11 @@ PluginVC::reenable_re(VIO *vio) if (vio->op == VIO::WRITE) { ink_assert(vio == _state.vio); need_write_process = true; -process_write_side(false); +process_write_side(); } else if (vio->op == VIO::READ) { ink_assert(vio == _state.vio); need_read_process = true; -process_read_side(false); +process_read_side(); } else { ink_release_assert(0); } @@ -458,22 +458,20 @@ PluginVC::transfer_bytes(MIOBuffer *transfer_to, IOBufferReader *transfer_from, return total_added; } -// void PluginVC::process_write_side(bool cb_ok) +// void PluginVC::process_write_side() // // This function may only be called while holding // this->mutex & while it is ok to callback the // write side continuation // -// Does write side processing +// Does write side processing directly to other read side writer // void -PluginVC::process_write_side(bool other_side_call) +PluginVC::process_write_side() { ink_assert(!deletable); ink_assert(magic == PLUGIN_VC_MAGIC_ALIVE); - MIOBuffer *core_buffer = (vc_type == PLUGIN_VC_ACTIVE) ? core_obj->a_to_p_buffer : core_obj->p_to_a_buffer; - Debug("pvc", "[%u] %s: process_write_side", core_obj->id, PVC_TYPE); need_write_process = false; @@ -494,7 +492,8 @@ PluginVC::process_write_side(bool other_side_call) Debug("pvc", "[%u] %s: process_write_side; act_on %" PRId64 "", core_obj->id, PVC_TYPE, act_on); - if (other_side->closed || other_side->read_state.shutdown) { + // Check read_state of other side + if (other_side->read_state.vio.op != VIO::READ || other_side->closed || other_side->read_state.shutdown) { write_state.vio.cont->handleEvent(VC_EVENT_ERROR, _state.vio); return; } @@ -507,28 +506,54 @@ PluginVC::process_write_side(bool other_side_call) } return; } - // Bytes available, try to transfer to the PluginVCCore - // intermediate buffer - // - int64_t buf_space = core_obj->buffer_size - core_buffer->max_read_avail(); + + // Check the state of the other side read buffer as well as ntodo + int64_t other_ntodo = other_side->read_state.vio.ntodo(); + if (other_ntodo == 0) { +return; + } + act_on = std::min(act_on, other_ntodo); + + // Other side read_state is open + // obtain the proper mutexes on other side + EThread *my_ethread = mutex->thread_holding; + ink_assert(my_ethread != nullptr); + MUTEX_TRY_LOCK(lock, other_side->read_state.vio.mutex, my_ethread); + if (!lock.is_locked()) { +Debug("pvc_event", "[%u] %s: process_read_side from other side lock miss, retrying", other_side->core_obj->id, + ((other_side->vc_type == PLUGIN_VC_ACTIVE) ? "Active" : "Passive")); + +// set need_read_process to enforce the read processing +other_side->need_read_process = true; +other_side->setup_event_cb(PVC_LOCK_RETRY_TIME, _side->core_lock_retry_event); +return; + } + + // Bytes available, setting up other side read state writer + MIOBuffer *output_buffer = other_side->read_state.vio.get_writer(); + int64_t water_mark = output_buffer->water_mark; + water_mark = std::max(water_mark, core_obj->buffer_size); + int64_t buf_space= water_mark - output_buffer->max_read_avail(); if (buf_space <= 0) { -Debug("pvc", "[%u] %s: process_write_side no buffer space", core_obj->id, PVC_TYPE); +Debug("pvc", "[%u] %s: process_read_side from other side no buffer space", core_obj->id, PVC_TYPE); return; } act_on =