mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-19 19:14:55 +00:00
[hostlist] Add port value validation
When in console, and adding a new host with an invalid port number, the console starts printing many exceptions regarding the value. Therefor, we will make sure that the port value is between 0 and 65535.
This commit is contained in:
parent
7af584d649
commit
38feea0fa4
1 changed files with 2 additions and 0 deletions
|
@ -50,6 +50,8 @@ def validate_host_info(hostname, port):
|
|||
|
||||
if not isinstance(port, int):
|
||||
raise ValueError('Invalid port. Must be an integer')
|
||||
if not 0 <= port <= 65535:
|
||||
raise ValueError('Invalid port. Must be between 0-65535')
|
||||
|
||||
|
||||
def migrate_hostlist(old_filename, new_filename):
|
||||
|
|
Loading…
Add table
Reference in a new issue