Skip to content

Commit a73d98d

Browse files
OscarLicarito
authored andcommitted
speedtest_cli: use https by default. (haikuports#11123)
Patch taken from sivel/speedtest-cli#800
1 parent b8428e2 commit a73d98d

File tree

2 files changed

+59
-2
lines changed

2 files changed

+59
-2
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
From 74d662e1e00de05779c71717626bb7ec299bdf3c Mon Sep 17 00:00:00 2001
2+
From: Strahinja Kustudic <[email protected]>
3+
Date: Tue, 1 Aug 2023 11:17:06 +0200
4+
Subject: [PATCH] Set secure connection as default
5+
6+
Speedtest servers don't support HTTP connections anymore so I renamed
7+
the `--secure` parameter to `--insecure` and set it to False by default.
8+
---
9+
speedtest.py | 10 +++++-----
10+
1 file changed, 5 insertions(+), 5 deletions(-)
11+
12+
diff --git a/speedtest.py b/speedtest.py
13+
index 186b52929..59540af66 100755
14+
--- a/speedtest.py
15+
+++ b/speedtest.py
16+
@@ -946,7 +946,7 @@ class SpeedtestResults(object):
17+
"""
18+
19+
def __init__(self, download=0, upload=0, ping=0, server=None, client=None,
20+
- opener=None, secure=False):
21+
+ opener=None, secure=True):
22+
self.download = download
23+
self.upload = upload
24+
self.ping = ping
25+
@@ -1087,7 +1087,7 @@ class Speedtest(object):
26+
"""Class for performing standard speedtest.net testing operations"""
27+
28+
def __init__(self, config=None, source_address=None, timeout=10,
29+
- secure=False, shutdown_event=None):
30+
+ secure=True, shutdown_event=None):
31+
self.config = {}
32+
33+
self._source_address = source_address
34+
@@ -1770,8 +1770,8 @@ def parse_args():
35+
parser.add_argument('--source', help='Source IP address to bind to')
36+
parser.add_argument('--timeout', default=10, type=PARSER_TYPE_FLOAT,
37+
help='HTTP timeout in seconds. Default 10')
38+
- parser.add_argument('--secure', action='store_true',
39+
- help='Use HTTPS instead of HTTP when communicating '
40+
+ parser.add_argument('--insecure', action='store_true', default=False,
41+
+ help='Use HTTP instead of HTTPS when communicating '
42+
'with speedtest.net operated servers')
43+
parser.add_argument('--no-pre-allocate', dest='pre_allocate',
44+
action='store_const', default=True, const=False,
45+
@@ -1885,7 +1885,7 @@ def shell():
46+
speedtest = Speedtest(
47+
source_address=args.source,
48+
timeout=args.timeout,
49+
- secure=args.secure
50+
+ secure=not args.insecure
51+
)
52+
except (ConfigRetrievalError,) + HTTP_ERRORS:
53+
printer('Cannot retrieve speedtest configuration', error=True)

net-analyzer/speedtest-cli/speedtest_cli-2.1.3.recipe

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ and CPU and Memory capacity and speed."
1212
HOMEPAGE="https://github.com/sivel/speedtest-cli"
1313
COPYRIGHT="2012-2021 Matt Martz"
1414
LICENSE="Apache v2"
15-
REVISION="2"
15+
REVISION="3"
1616
SOURCE_URI="$HOMEPAGE/archive/v$portVersion.tar.gz"
1717
CHECKSUM_SHA256="45e3ca21c3ce3c339646100de18db8a26a27d240c29f1c9e07b6c13995a969be"
1818
SOURCE_FILENAME="speedtest-cli-$portVersion.tar.gz"
1919
SOURCE_DIR="speedtest-cli-$portVersion"
20-
PATCHES="0001-Python-3.10-support.patch"
20+
21+
PATCHES="
22+
0001-Python-3.10-support.patch
23+
800.patch
24+
"
2125

2226
ARCHITECTURES="any"
2327

0 commit comments

Comments
 (0)