mirror of
https://github.com/sshuttle/sshuttle.git
synced 2024-11-24 17:04:36 +01:00
fix: bad file descriptor error in windows, fix pytest errors
This commit is contained in:
parent
4a84ad3be6
commit
d4d0fa945d
@ -24,7 +24,7 @@ ping)
|
|||||||
;;
|
;;
|
||||||
iperf3)
|
iperf3)
|
||||||
port=5001
|
port=5001
|
||||||
with_set_x exec iperf3 --client "$ip" --port=$port --connect-timeout=$connect_timeout_sec "$@"
|
with_set_x exec iperf3 --client "$ip" --port=$port --connect-timeout=$((connect_timeout_sec * 1000)) "$@"
|
||||||
;;
|
;;
|
||||||
curl)
|
curl)
|
||||||
port=8080
|
port=8080
|
||||||
@ -32,6 +32,6 @@ curl)
|
|||||||
;;
|
;;
|
||||||
ab)
|
ab)
|
||||||
port=8080
|
port=8080
|
||||||
with_set_x exec ab -n 100 -c 20 -s $connect_timeout_sec "$@" "http://$ip:$port/"
|
with_set_x exec ab -n 100 -c 20 -s $connect_timeout_sec "$@" "http://$ip:$port/"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
9
hack/run-checks
Executable file
9
hack/run-checks
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
|
export PYTHONPATH=.
|
||||||
|
|
||||||
|
set -x
|
||||||
|
python -m pytest .
|
||||||
|
python -m flake8 .
|
@ -224,7 +224,6 @@ def main(method_name, syslog):
|
|||||||
stdout.write(('READY %s\n' % method.name).encode('ASCII'))
|
stdout.write(('READY %s\n' % method.name).encode('ASCII'))
|
||||||
stdout.flush()
|
stdout.flush()
|
||||||
|
|
||||||
|
|
||||||
def _read_next_string_line():
|
def _read_next_string_line():
|
||||||
try:
|
try:
|
||||||
line = stdin.readline(128)
|
line = stdin.readline(128)
|
||||||
|
@ -432,7 +432,8 @@ class Mux(Handler):
|
|||||||
def flush(self):
|
def flush(self):
|
||||||
set_non_blocking_io(self.wfile.fileno())
|
set_non_blocking_io(self.wfile.fileno())
|
||||||
if self.outbuf and self.outbuf[0]:
|
if self.outbuf and self.outbuf[0]:
|
||||||
wrote = _nb_clean(os.write, self.wfile.fileno(), self.outbuf[0])
|
wrote = _nb_clean(self.wfile.write, self.outbuf[0])
|
||||||
|
self.wfile.flush()
|
||||||
debug2('mux wrote: %r/%d' % (wrote, len(self.outbuf[0])))
|
debug2('mux wrote: %r/%d' % (wrote, len(self.outbuf[0])))
|
||||||
if wrote:
|
if wrote:
|
||||||
self.outbuf[0] = self.outbuf[0][wrote:]
|
self.outbuf[0] = self.outbuf[0][wrote:]
|
||||||
|
@ -21,7 +21,7 @@ NSLIST
|
|||||||
PORTS 1024,1025,1026,1027
|
PORTS 1024,1025,1026,1027
|
||||||
GO 1 - - 0x01 12345
|
GO 1 - - 0x01 12345
|
||||||
HOST 1.2.3.3,existing
|
HOST 1.2.3.3,existing
|
||||||
""".format(inet=AF_INET, inet6=AF_INET6))
|
""".format(inet=AF_INET, inet6=AF_INET6).encode('ASCII'))
|
||||||
stdout = Mock()
|
stdout = Mock()
|
||||||
return stdin, stdout
|
return stdin, stdout
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user