Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ZaWertun/c587b0c3d9e2c2c4215b02a4efdda423 to your computer and use it in GitHub Desktop.
Save ZaWertun/c587b0c3d9e2c2c4215b02a4efdda423 to your computer and use it in GitHub Desktop.
diff -r -U3 sshuttle-1.0.1.orig/sshuttle/ssnet.py sshuttle-1.0.1/sshuttle/ssnet.py
--- sshuttle-1.0.1.orig/sshuttle/ssnet.py 2020-06-05 00:43:00.000000000 +0300
+++ sshuttle-1.0.1/sshuttle/ssnet.py 2020-07-01 12:15:35.206952388 +0300
@@ -439,7 +439,8 @@
callback(cmd, data)
def flush(self):
- os.set_blocking(self.wfile.fileno(), False)
+ if 'set_blocking' in dir(os):
+ os.set_blocking(self.wfile.fileno(), False)
if self.outbuf and self.outbuf[0]:
wrote = _nb_clean(os.write, self.wfile.fileno(), self.outbuf[0])
debug2('mux wrote: %r/%d\n' % (wrote, len(self.outbuf[0])))
@@ -449,7 +450,8 @@
self.outbuf[0:1] = []
def fill(self):
- os.set_blocking(self.rfile.fileno(), False)
+ if 'set_blocking' in dir(os):
+ os.set_blocking(self.rfile.fileno(), False)
try:
read = _nb_clean(os.read, self.rfile.fileno(), LATENCY_BUFFER_SIZE)
except OSError:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment