mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-04-25 19:58:56 +02:00
new option to disable fullness checking
On high latency links, the PING/PONG round trip triggered by fullness checking could kill the bandwidth. Disabling it could result in >10x bandwidth increase in some setups where the existing latency is already high and the available bandwidth is also high.
This commit is contained in:
parent
675f19f57e
commit
fdb7c9b995
@ -21,6 +21,7 @@ while 1:
|
|||||||
break
|
break
|
||||||
|
|
||||||
verbose = verbosity
|
verbose = verbosity
|
||||||
|
no_fullness = no_fullness0
|
||||||
sys.stderr.flush()
|
sys.stderr.flush()
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
main()
|
main()
|
||||||
|
5
main.py
5
main.py
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import sys, os, re
|
import sys, os, re
|
||||||
import helpers, options, client, server, firewall, hostwatch
|
import helpers, options, client, server, firewall, hostwatch, ssnet
|
||||||
import compat.ssubprocess as ssubprocess
|
import compat.ssubprocess as ssubprocess
|
||||||
from helpers import *
|
from helpers import *
|
||||||
|
|
||||||
@ -51,6 +51,7 @@ sshuttle --server
|
|||||||
sshuttle --firewall <port> <subnets...>
|
sshuttle --firewall <port> <subnets...>
|
||||||
sshuttle --hostwatch
|
sshuttle --hostwatch
|
||||||
--
|
--
|
||||||
|
f,disable-fullness turn off fullness checking (could 10x bandwidth on high latency link)
|
||||||
l,listen= transproxy to this ip address and port number [127.0.0.1:0]
|
l,listen= transproxy to this ip address and port number [127.0.0.1:0]
|
||||||
H,auto-hosts scan for remote hostnames and update local /etc/hosts
|
H,auto-hosts scan for remote hostnames and update local /etc/hosts
|
||||||
N,auto-nets automatically determine subnets to route
|
N,auto-nets automatically determine subnets to route
|
||||||
@ -73,7 +74,7 @@ o = options.Options('sshuttle', optspec)
|
|||||||
if opt.daemon:
|
if opt.daemon:
|
||||||
opt.syslog = 1
|
opt.syslog = 1
|
||||||
helpers.verbose = opt.verbose
|
helpers.verbose = opt.verbose
|
||||||
|
ssnet.no_fullness = opt.disable_fullness
|
||||||
try:
|
try:
|
||||||
if opt.server:
|
if opt.server:
|
||||||
if len(extra) != 0:
|
if len(extra) != 0:
|
||||||
|
5
ssh.py
5
ssh.py
@ -1,6 +1,6 @@
|
|||||||
import sys, os, re, socket, zlib
|
import sys, os, re, socket, zlib
|
||||||
import compat.ssubprocess as ssubprocess
|
import compat.ssubprocess as ssubprocess
|
||||||
import helpers
|
import helpers, ssnet
|
||||||
from helpers import *
|
from helpers import *
|
||||||
|
|
||||||
|
|
||||||
@ -63,8 +63,9 @@ def connect(ssh_cmd, rhostport, python, stderr):
|
|||||||
import sys;
|
import sys;
|
||||||
skip_imports=1;
|
skip_imports=1;
|
||||||
verbosity=%d;
|
verbosity=%d;
|
||||||
|
no_fullness0=%d;
|
||||||
exec compile(sys.stdin.read(%d), "assembler.py", "exec")
|
exec compile(sys.stdin.read(%d), "assembler.py", "exec")
|
||||||
""" % (helpers.verbose or 0, len(content))
|
""" % (helpers.verbose or 0, ssnet.no_fullness or 0, len(content))
|
||||||
pyscript = re.sub(r'\s+', ' ', pyscript.strip())
|
pyscript = re.sub(r'\s+', ' ', pyscript.strip())
|
||||||
|
|
||||||
|
|
||||||
|
5
ssnet.py
5
ssnet.py
@ -35,7 +35,7 @@ cmd_to_name = {
|
|||||||
CMD_HOST_LIST: 'HOST_LIST',
|
CMD_HOST_LIST: 'HOST_LIST',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
no_fullness = 0
|
||||||
|
|
||||||
def _add(l, elem):
|
def _add(l, elem):
|
||||||
if not elem in l:
|
if not elem in l:
|
||||||
@ -308,7 +308,7 @@ class Mux(Handler):
|
|||||||
return total
|
return total
|
||||||
|
|
||||||
def check_fullness(self):
|
def check_fullness(self):
|
||||||
if self.fullness > 32768:
|
if not no_fullness and self.fullness > 32768:
|
||||||
if not self.too_full:
|
if not self.too_full:
|
||||||
self.send(0, CMD_PING, 'rttest')
|
self.send(0, CMD_PING, 'rttest')
|
||||||
self.too_full = True
|
self.too_full = True
|
||||||
@ -326,6 +326,7 @@ class Mux(Handler):
|
|||||||
debug2(' > channel=%d cmd=%s len=%d (fullness=%d)\n'
|
debug2(' > channel=%d cmd=%s len=%d (fullness=%d)\n'
|
||||||
% (channel, cmd_to_name.get(cmd,hex(cmd)),
|
% (channel, cmd_to_name.get(cmd,hex(cmd)),
|
||||||
len(data), self.fullness))
|
len(data), self.fullness))
|
||||||
|
if not no_fullness:
|
||||||
self.fullness += len(data)
|
self.fullness += len(data)
|
||||||
|
|
||||||
def got_packet(self, channel, cmd, data):
|
def got_packet(self, channel, cmd, data):
|
||||||
|
Loading…
Reference in New Issue
Block a user