Skip to content

Commit

Permalink
Merge pull request #163 from Jonney/patch-2
Browse files Browse the repository at this point in the history
Compatible with Python 3.11
  • Loading branch information
qwj authored Jan 13, 2024
2 parents 4863477 + c970092 commit e03384f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pproxy/proto.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,12 +616,21 @@ def abort(self):
self.close()
ssl.connection_made(Transport())
async def channel():
read_size=65536
buffer=None
if hasattr(ssl,'get_buffer'):
buffer=ssl.get_buffer(read_size)
try:
while not reader.at_eof() and not ssl._app_transport._closed:
data = await reader.read(65536)
data = await reader.read(read_size)
if not data:
break
ssl.data_received(data)
if buffer!=None:
data_len=len(data)
buffer[:data_len]=data
ssl.buffer_updated(data_len)
else:
ssl.data_received(data)
except Exception:
pass
finally:
Expand Down

0 comments on commit e03384f

Please sign in to comment.