X Tutup
Skip to content

Commit 8bb0dda

Browse files
authored
v1.9.9
1 parent f866b0b commit 8bb0dda

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pproxy/__doc__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__title__ = "pproxy"
2-
__version__ = "1.9.8"
2+
__version__ = "1.9.9"
33
__license__ = "MIT"
44
__description__ = "Proxy server that can tunnel among remote servers by regex rules."
55
__keywords__ = "proxy socks http shadowsocks shadowsocksr ssr redirect pf tunnel cipher ssl udp"

pproxy/server.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
SOCKET_TIMEOUT = 300
66
PACKET_SIZE = 65536
7-
UDP_LIMIT = 150
7+
UDP_LIMIT = 30
88
DUMMY = lambda s: s
99

1010
asyncio.StreamReader.read_ = lambda self: self.read(PACKET_SIZE)
@@ -239,7 +239,9 @@ def connection_lost(prot, exc):
239239
self.connection_change(1)
240240
if len(self.udpmap) > UDP_LIMIT:
241241
min_addr = min(self.udpmap, key=lambda x: self.udpmap[x].update)
242-
self.udpmap.pop(min_addr).transport.close()
242+
prot = self.udpmap.pop(min_addr)
243+
if prot.transport:
244+
prot.transport.close()
243245
prot = Protocol(data)
244246
remote_addr = (host, port) if self.direct else (self.host_name, self.port)
245247
await asyncio.get_event_loop().create_datagram_endpoint(lambda: prot, remote_addr=remote_addr)

0 commit comments

Comments
 (0)
X Tutup