Skip to content

Commit 69748a3

Browse files
committed
Fix updating binaries
1 parent 4b865bc commit 69748a3

File tree

7 files changed

+22
-16
lines changed

7 files changed

+22
-16
lines changed

async_tls_client/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66

77
__title__ = "async_tls_client"
88
__description__ = "Fork of tls-client with asyncio."
9-
__version__ = "1.0.4"
9+
__version__ = "1.0.5"
1010
__author__ = "Diprog"
1111
__license__ = "MIT"

async_tls_client/cffi.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
file_ext = '-amd64.so'
1717

1818
root_dir = os.path.abspath(os.path.dirname(__file__))
19-
library = ctypes.cdll.LoadLibrary(f'{root_dir}/dependencies/tls-client{file_ext}')
19+
binary_filepath = os.path.join(root_dir, 'dependencies', f'tls-client{file_ext}')
20+
print(binary_filepath)
21+
library = ctypes.cdll.LoadLibrary(binary_filepath)
2022

2123
# extract the exposed request function from the shared package
2224
request = library.request
@@ -29,4 +31,4 @@
2931

3032
destroySession = library.destroySession
3133
destroySession.argtypes = [ctypes.c_char_p]
32-
destroySession.restype = ctypes.c_char_p
34+
destroySession.restype = ctypes.c_char_p
16 MB
Binary file not shown.
18.7 MB
Binary file not shown.
7.96 MB
Binary file not shown.
8.59 MB
Binary file not shown.

scripts/update_shared_library.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
import requests
22

33
shared_library_version = "1.7.10"
4-
github_download_url = "https://github.com//bogdanfinn/tls-client/releases/download/v{}/{}"
4+
github_download_url = "https://github.com/bogdanfinn/tls-client/releases/download/v{}/{}"
55
github_repo_filenames = [
66
# Windows
7-
f"tls-client-windows-32-v{shared_library_version}.dll",
8-
f"tls-client-windows-64-v{shared_library_version}.dll",
7+
f"tls-client-windows-32-{shared_library_version}.dll",
8+
f"tls-client-windows-64-{shared_library_version}.dll",
99
# MacOS
10-
f"tls-client-darwin-arm64-v{shared_library_version}.dylib",
11-
f"tls-client-darwin-amd64-v{shared_library_version}.dylib",
10+
f"tls-client-darwin-arm64-{shared_library_version}.dylib",
11+
f"tls-client-darwin-amd64-{shared_library_version}.dylib",
1212
# Linux
13-
f"tls-client-linux-alpine-amd64-v{shared_library_version}.so",
14-
f"tls-client-linux-ubuntu-amd64-v{shared_library_version}.so",
15-
f"tls-client-linux-arm64-v{shared_library_version}.so"
13+
# f"tls-client-linux-alpine-amd64-{shared_library_version}.so", # Removed in 1.7.8
14+
f"tls-client-linux-ubuntu-amd64-{shared_library_version}.so",
15+
f"tls-client-linux-ubuntu-amd64-{shared_library_version}.so",
16+
f"tls-client-linux-arm64-{shared_library_version}.so"
1617
]
1718
dependency_filenames = [
1819
# Windows
@@ -28,9 +29,12 @@
2829
]
2930

3031
for github_filename, dependency_filename in zip(github_repo_filenames, dependency_filenames):
31-
response = requests.get(
32-
url=github_download_url.format(shared_library_version, github_filename)
33-
)
34-
35-
with open(f"../async_tls_client/dependencies/{dependency_filename}", "wb") as f:
32+
filepath = f"../async_tls_client/dependencies/{dependency_filename}"
33+
url = github_download_url.format(shared_library_version, github_filename)
34+
print(f'Downloading {url}...')
35+
response = requests.get(url=url)
36+
if not response.ok:
37+
print(f'Failed to fetch ({response.status_code})')
38+
print(f'Writing to "{filepath}"...')
39+
with open(filepath, "wb") as f:
3640
f.write(response.content)

0 commit comments

Comments
 (0)