Add timeout argument
This commit is contained in:
parent
795bc51da4
commit
65c85a9b15
|
@ -89,6 +89,7 @@ Usage
|
||||||
--server SERVER Specify a server ID to test against
|
--server SERVER Specify a server ID to test against
|
||||||
--mini MINI URL of the Speedtest Mini server
|
--mini MINI URL of the Speedtest Mini server
|
||||||
--source SOURCE Source IP address to bind to
|
--source SOURCE Source IP address to bind to
|
||||||
|
--timeout TIMEOUT HTTP timeout in seconds. Default 10
|
||||||
--version Show the version number and exit
|
--version Show the version number and exit
|
||||||
|
|
||||||
Inconsistency
|
Inconsistency
|
||||||
|
|
|
@ -484,6 +484,8 @@ def speedtest():
|
||||||
parser.add_argument('--server', help='Specify a server ID to test against')
|
parser.add_argument('--server', help='Specify a server ID to test against')
|
||||||
parser.add_argument('--mini', help='URL of the Speedtest Mini server')
|
parser.add_argument('--mini', help='URL of the Speedtest Mini server')
|
||||||
parser.add_argument('--source', help='Source IP address to bind to')
|
parser.add_argument('--source', help='Source IP address to bind to')
|
||||||
|
parser.add_argument('--timeout', default=10, type=int,
|
||||||
|
help='HTTP timeout in seconds. Default 10')
|
||||||
parser.add_argument('--version', action='store_true',
|
parser.add_argument('--version', action='store_true',
|
||||||
help='Show the version number and exit')
|
help='Show the version number and exit')
|
||||||
|
|
||||||
|
@ -498,6 +500,8 @@ def speedtest():
|
||||||
if args.version:
|
if args.version:
|
||||||
version()
|
version()
|
||||||
|
|
||||||
|
socket.setdefaulttimeout(args.timeout)
|
||||||
|
|
||||||
# If specified bind to a specific IP address
|
# If specified bind to a specific IP address
|
||||||
if args.source:
|
if args.source:
|
||||||
source = args.source
|
source = args.source
|
||||||
|
|
Loading…
Reference in New Issue