diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-07-01 13:09:22 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-07-01 13:09:22 +0300 |
commit | 4b120368d66d843f27f868cd84374c732d22e830 (patch) | |
tree | 4af41ca964de2dead72f54f8ac1a1eecb74fa8c9 | |
parent | 0c4ace9a6574efac8e4d423e77cbebd0592dc84c (diff) | |
download | ydb-4b120368d66d843f27f868cd84374c732d22e830.tar.gz |
intermediate changes
ref:090632378b7b7874f8203fa4877f372f9e3bf51e
6 files changed, 47 insertions, 22 deletions
diff --git a/contrib/python/requests/py3/.dist-info/METADATA b/contrib/python/requests/py3/.dist-info/METADATA index ae0f3509ca..17b5413c1a 100644 --- a/contrib/python/requests/py3/.dist-info/METADATA +++ b/contrib/python/requests/py3/.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: requests -Version: 2.28.0 +Version: 2.28.1 Summary: Python HTTP for Humans. Home-page: https://requests.readthedocs.io Author: Kenneth Reitz @@ -30,7 +30,7 @@ Classifier: Topic :: Software Development :: Libraries Requires-Python: >=3.7, <4 Description-Content-Type: text/markdown License-File: LICENSE -Requires-Dist: charset-normalizer (>=2.0.0) +Requires-Dist: charset-normalizer (<3,>=2) Requires-Dist: idna (<4,>=2.5) Requires-Dist: urllib3 (<1.27,>=1.21.1) Requires-Dist: certifi (>=2017.4.17) @@ -38,7 +38,7 @@ Provides-Extra: security Provides-Extra: socks Requires-Dist: PySocks (!=1.5.7,>=1.5.6) ; extra == 'socks' Provides-Extra: use_chardet_on_py3 -Requires-Dist: chardet (<5,>=3.0.2) ; extra == 'use_chardet_on_py3' +Requires-Dist: chardet (<6,>=3.0.2) ; extra == 'use_chardet_on_py3' # Requests diff --git a/contrib/python/requests/py3/patches/02-support-charset-normalizer-2.1.patch b/contrib/python/requests/py3/patches/02-support-charset-normalizer-2.1.patch deleted file mode 100644 index 2cf1ea08ae..0000000000 --- a/contrib/python/requests/py3/patches/02-support-charset-normalizer-2.1.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- contrib/python/requests/py3/.dist-info/METADATA (index) -+++ contrib/python/requests/py3/.dist-info/METADATA (working tree) -@@ -30,7 +30,7 @@ Classifier: Topic :: Software Development :: Libraries - Requires-Python: >=3.7, <4 - Description-Content-Type: text/markdown - License-File: LICENSE --Requires-Dist: charset-normalizer (~=2.0.0) -+Requires-Dist: charset-normalizer (>=2.0.0) - Requires-Dist: idna (<4,>=2.5) - Requires-Dist: urllib3 (<1.27,>=1.21.1) - Requires-Dist: certifi (>=2017.4.17) diff --git a/contrib/python/requests/py3/requests/__init__.py b/contrib/python/requests/py3/requests/__init__.py index 343e5082d3..7ac8e297b8 100644 --- a/contrib/python/requests/py3/requests/__init__.py +++ b/contrib/python/requests/py3/requests/__init__.py @@ -75,8 +75,8 @@ def check_compatibility(urllib3_version, chardet_version, charset_normalizer_ver if chardet_version: major, minor, patch = chardet_version.split(".")[:3] major, minor, patch = int(major), int(minor), int(patch) - # chardet_version >= 3.0.2, < 5.0.0 - assert (3, 0, 2) <= (major, minor, patch) < (5, 0, 0) + # chardet_version >= 3.0.2, < 6.0.0 + assert (3, 0, 2) <= (major, minor, patch) < (6, 0, 0) elif charset_normalizer_version: major, minor, patch = charset_normalizer_version.split(".")[:3] major, minor, patch = int(major), int(minor), int(patch) diff --git a/contrib/python/requests/py3/requests/__version__.py b/contrib/python/requests/py3/requests/__version__.py index cbb5c5cfde..e725ada655 100644 --- a/contrib/python/requests/py3/requests/__version__.py +++ b/contrib/python/requests/py3/requests/__version__.py @@ -5,8 +5,8 @@ __title__ = "requests" __description__ = "Python HTTP for Humans." __url__ = "https://requests.readthedocs.io" -__version__ = "2.28.0" -__build__ = 0x022800 +__version__ = "2.28.1" +__build__ = 0x022801 __author__ = "Kenneth Reitz" __author_email__ = "me@kennethreitz.org" __license__ = "Apache 2.0" diff --git a/contrib/python/requests/py3/requests/models.py b/contrib/python/requests/py3/requests/models.py index 7e1522837f..3cd49f5bba 100644 --- a/contrib/python/requests/py3/requests/models.py +++ b/contrib/python/requests/py3/requests/models.py @@ -813,8 +813,7 @@ class Response: # Special case for urllib3. if hasattr(self.raw, "stream"): try: - for chunk in self.raw.stream(chunk_size, decode_content=True): - yield chunk + yield from self.raw.stream(chunk_size, decode_content=True) except ProtocolError as e: raise ChunkedEncodingError(e) except DecodeError as e: diff --git a/library/cpp/actors/http/http_proxy_sock64.h b/library/cpp/actors/http/http_proxy_sock64.h index 7f64a0f353..29b7b34b47 100644 --- a/library/cpp/actors/http/http_proxy_sock64.h +++ b/library/cpp/actors/http/http_proxy_sock64.h @@ -25,9 +25,46 @@ public: } if (NHttp::IsIPv6(address)) { return std::make_shared<TSockAddrInet6>(address.data(), port); - } else { + } else if (NHttp::IsIPv4(address)) { return std::make_shared<TSockAddrInet>(address.data(), port); } + struct addrinfo hints = { + .ai_flags = AI_PASSIVE, + .ai_family = AF, + .ai_socktype = SOCK_STREAM, + }; + struct addrinfo* gai_res = nullptr; + int gai_ret = getaddrinfo(address.data(), nullptr, &hints, &gai_res); + std::shared_ptr<ISockAddr> result; + if (gai_ret == 0 && gai_res->ai_addr) { + switch (gai_res->ai_addr->sa_family) { + case AF_INET6: { + std::shared_ptr<TSockAddrInet6> resultIp6 = std::make_shared<TSockAddrInet6>(); + if (resultIp6->Size() >= gai_res->ai_addrlen) { + memcpy(resultIp6->SockAddr(), gai_res->ai_addr, gai_res->ai_addrlen); + resultIp6->SetPort(port); + result = std::move(resultIp6); + } + } + break; + case AF_INET: { + std::shared_ptr<TSockAddrInet> resultIp4 = std::make_shared<TSockAddrInet>(); + if (resultIp4->Size() >= gai_res->ai_addrlen) { + memcpy(resultIp4->SockAddr(), gai_res->ai_addr, gai_res->ai_addrlen); + resultIp4->SetPort(port); + result = std::move(resultIp4); + } + } + break; + } + } + if (gai_res) { + freeaddrinfo(gai_res); + } + if (result) { + return result; + } + throw yexception() << "Unable to resolve address " << address; } static std::shared_ptr<ISockAddr> MakeAddress(const sockaddr_storage& storage) { @@ -58,7 +95,7 @@ public: } protected: - int AF = 0; + int AF = AF_UNSPEC; void CreateSocket(int af) { SOCKET s; |