MCPcopy Index your code
hub / github.com/sshuttle/sshuttle / callback

Method callback

sshuttle/server.py:231–253  ·  view source on GitHub ↗
(self, sock)

Source from the content-addressed store, hash-verified

229 return
230
231 def callback(self, sock):
232 peer = self.peers[sock]
233
234 try:
235 data = sock.recv(4096)
236 except socket.error:
237 _, e = sys.exc_info()[:2]
238 self.socks.remove(sock)
239 del self.peers[sock]
240
241 if e.args[0] in ssnet.NET_ERRS:
242 # might have been spurious; try again.
243 # Note: these errors sometimes are reported by recv(),
244 # and sometimes by send(). We have to catch both.
245 debug2('DNS recv from %r: %s' % (peer, e))
246 self.try_send()
247 return
248 else:
249 log('DNS recv from %r: %s' % (peer, e))
250 return
251 debug2('DNS response: %d bytes' % len(data))
252 self.mux.send(self.chan, ssnet.CMD_DNS_RESPONSE, data)
253 self.ok = False
254
255
256class UdpProxy(Handler):

Callers

nothing calls this directly

Calls 5

try_sendMethod · 0.95
debug2Function · 0.90
logFunction · 0.90
removeMethod · 0.80
sendMethod · 0.45

Tested by

no test coverage detected