MCPcopy Index your code
hub / github.com/apenwarr/sshuttle / uwrite

Method uwrite

ssnet.py:194–208  ·  view source on GitHub ↗
(self, buf)

Source from the content-addressed store, hash-verified

192 return False # fullness is determined by the socket's select() state
193
194 def uwrite(self, buf):
195 if self.connect_to:
196 return 0 # still connecting
197 self.wsock.setblocking(False)
198 try:
199 return _nb_clean(os.write, self.wsock.fileno(), buf)
200 except OSError, e:
201 if e.errno == errno.EPIPE:
202 debug1('%r: uwrite: got EPIPE\n' % self)
203 self.nowrite()
204 return 0
205 else:
206 # unexpected error... stream is dead
207 self.seterr('uwrite: %s' % e)
208 return 0
209
210 def write(self, buf):
211 assert(buf)

Callers 1

writeMethod · 0.95

Calls 4

nowriteMethod · 0.95
seterrMethod · 0.95
_nb_cleanFunction · 0.85
debug1Function · 0.85

Tested by

no test coverage detected