MCPcopy Create free account
hub / github.com/apenwarr/sshuttle / ondns

Function ondns

client.py:224–236  ·  view source on GitHub ↗
(listener, mux, handlers)

Source from the content-addressed store, hash-verified

222
223
224def ondns(listener, mux, handlers):
225 pkt,peer = listener.recvfrom(4096)
226 now = time.time()
227 if pkt:
228 debug1('DNS request from %r: %d bytes\n' % (peer, len(pkt)))
229 chan = mux.next_channel()
230 dnsreqs[chan] = peer,listener,now+30
231 mux.send(chan, ssnet.CMD_DNS_REQ, pkt)
232 mux.channels[chan] = lambda cmd,data: dns_done(chan,data)
233 for chan,(peer,sock,timeout) in dnsreqs.items():
234 if timeout < now:
235 del dnsreqs[chan]
236 debug3('Remaining DNS requests: %d\n' % len(dnsreqs))
237
238
239def _main(listener, fw, ssh_cmd, remotename, python, latency_control,

Callers 1

_mainFunction · 0.85

Calls 5

debug1Function · 0.85
dns_doneFunction · 0.85
debug3Function · 0.85
next_channelMethod · 0.80
sendMethod · 0.80

Tested by

no test coverage detected