mirror of
https://github.com/sshuttle/sshuttle.git
synced 2024-11-22 16:03:57 +01:00
Fixed instances of str being used as bytes
This should fix #45. Once PR #37 is merged maybe we can make use of b() to make these conversions.
This commit is contained in:
parent
117afc7a68
commit
052b23800f
@ -335,7 +335,7 @@ def onaccept_tcp(listener, method, mux, handlers):
|
||||
|
||||
|
||||
def udp_done(chan, data, method, sock, dstip):
|
||||
(src, srcport, data) = data.split(",", 2)
|
||||
(src, srcport, data) = data.split(b",", 2)
|
||||
srcip = (src, int(srcport))
|
||||
debug3('doing send from %r to %r\n' % (srcip, dstip,))
|
||||
method.send_udp(sock, srcip, dstip, data)
|
||||
@ -354,10 +354,11 @@ def onaccept_udp(listener, method, mux, handlers):
|
||||
chan = mux.next_channel()
|
||||
mux.channels[chan] = lambda cmd, data: udp_done(
|
||||
chan, data, method, listener, dstip=srcip)
|
||||
mux.send(chan, ssnet.CMD_UDP_OPEN, listener.family)
|
||||
mux.send(chan, ssnet.CMD_UDP_OPEN,
|
||||
str(int(listener.family).encode("ASCII"))
|
||||
udp_by_src[srcip] = chan, now + 30
|
||||
|
||||
hdr = "%s,%r," % (dstip[0], dstip[1])
|
||||
hdr = ("%s,%r," % (dstip[0], dstip[1])).encode("ASCII")
|
||||
mux.send(chan, ssnet.CMD_UDP_DATA, hdr + data)
|
||||
|
||||
expire_connections(now, mux)
|
||||
|
Loading…
Reference in New Issue
Block a user