mirror of
https://github.com/onionshare/onionshare.git
synced 2025-06-06 22:09:15 -04:00
Merge branch 'enotodden-master'
This commit is contained in:
commit
2fb31da2c9
1 changed files with 6 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import os, sys, subprocess, time, hashlib, platform, json, locale
|
import os, sys, subprocess, time, hashlib, platform, json, locale, socket
|
||||||
from random import randint
|
from random import randint
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
|
|
||||||
|
@ -100,8 +100,11 @@ if __name__ == '__main__':
|
||||||
filehash = hasher.hexdigest()
|
filehash = hasher.hexdigest()
|
||||||
filesize = os.path.getsize(filename)
|
filesize = os.path.getsize(filename)
|
||||||
|
|
||||||
# choose a port
|
# let the OS choose a port
|
||||||
port = randint(1025, 65535)
|
tmpsock = socket.socket()
|
||||||
|
tmpsock.bind(("127.0.0.1", 0))
|
||||||
|
port = tmpsock.getsockname()[1]
|
||||||
|
tmpsock.close()
|
||||||
|
|
||||||
# connect to the tor controlport
|
# connect to the tor controlport
|
||||||
print strings["connecting_ctrlport"].format(port)
|
print strings["connecting_ctrlport"].format(port)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue