Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7c2b077
add connection status check in read_from_descriptors
JerryKwan Nov 19, 2021
899cd8c
Merge remote-tracking branch 'origin/develop' into issue748
JerryKwan Nov 19, 2021
ad1eee8
add tls parser skeleton
JerryKwan Nov 19, 2021
bc16223
temporary commit
JerryKwan Dec 10, 2021
fbe85e9
Merge remote-tracking branch 'origin/develop' into issue748
JerryKwan Dec 10, 2021
15da114
fix bugs when using connection pool with https
JerryKwan Dec 10, 2021
ed21988
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 13, 2021
e0f97e9
Merge branch 'develop' into issue748
abhinavsingh Dec 13, 2021
aa85cae
Merge branch 'develop' into issue748
abhinavsingh Dec 17, 2021
150d809
Merge branch 'develop' into issue748
abhinavsingh Dec 17, 2021
a44b67c
Fix syntax, lint, spellcheck errors
abhinavsingh Dec 17, 2021
d6e90a8
Fix flake8 errors
abhinavsingh Dec 17, 2021
2417070
Merge branch 'develop' into issue748
abhinavsingh Dec 17, 2021
260819f
Merge branch 'develop' into https-conn-pool
abhinavsingh Dec 17, 2021
ab96aff
Merge pull request #4 from abhinavsingh/https-conn-pool
JerryKwan Dec 18, 2021
0d3c6e3
bug fix in tls.py
JerryKwan Dec 18, 2021
e1c017e
bug fix in tls parser
JerryKwan Dec 18, 2021
a5963f8
Merge branch 'issue748' of https://github.com/JerryKwan/proxy.py into…
JerryKwan Dec 18, 2021
8157dbe
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 18, 2021
e6ee984
Merge branch 'develop' into issue748
abhinavsingh Dec 18, 2021
d0b7169
Merge branch 'develop' into issue748
abhinavsingh Dec 19, 2021
8937c4b
remove unnecessary tls parser
JerryKwan Dec 21, 2021
c8861cc
Merge branch 'issue748' of https://github.com/JerryKwan/proxy.py into…
JerryKwan Dec 21, 2021
82d8d5c
fix spell check warnings
JerryKwan Dec 21, 2021
cee0272
Merge branch 'develop' into issue748
abhinavsingh Dec 21, 2021
073dae3
Merge branch 'develop' into issue748
abhinavsingh Dec 21, 2021
8e2bd6a
Merge branch 'develop' into issue748
JerryKwan Dec 22, 2021
6419026
remove unnecessary statements
JerryKwan Dec 22, 2021
ae22907
Merge branch 'issue748' of https://github.com/JerryKwan/proxy.py into…
JerryKwan Dec 22, 2021
fe8fec6
remove unused imports
JerryKwan Dec 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions proxy/core/connection/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@

:copyright: (c) 2013-present by Abhinav Singh and contributors.
:license: BSD, see LICENSE for more details.

.. spelling::

reusability
"""
import logging

Expand Down Expand Up @@ -95,7 +91,7 @@ def release(self, conn: TcpServerConnection) -> None:
"""Release the connection.

If the connection has not been closed,
then it will be retained in the pool for reusability.
then it will be retained in the pool for re-usability.
"""
if conn.closed:
logger.debug(
Expand All @@ -111,5 +107,5 @@ def release(self, conn: TcpServerConnection) -> None:
),
)
assert not conn.is_reusable()
# Reset for reusability
# Reset for re-usability
conn.reset()
14 changes: 10 additions & 4 deletions proxy/http/proxy/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,10 @@ async def read_from_descriptors(self, r: Readables) -> bool:
return self._close_and_release()

if raw is None:
logger.debug('Server closed connection, tearing down...')
return self._close_and_release()

if self.upstream.closed:
logger.debug('Server closed connection, tearing down...')
return self._close_and_release()
return False
for plugin in self.plugins.values():
raw = plugin.handle_upstream_chunk(raw)

Expand Down Expand Up @@ -794,7 +795,12 @@ def wrap_server(self) -> bool:
assert isinstance(self.upstream.connection, socket.socket)
do_close = False
try:
self.upstream.wrap(text_(self.request.host), self.flags.ca_file)
# check if has wrapped already
logger.debug('type(self.upstream) = %s', type(self.upstream))
if not isinstance(self.upstream.connection, ssl.SSLSocket):
self.upstream.wrap(text_(self.request.host), self.flags.ca_file)
else:
logger.debug('self.upstream is ssl.SSLSocket already, do not need to wrap')
except ssl.SSLCertVerificationError: # Server raised certificate verification error
# When --disable-interception-on-ssl-cert-verification-error flag is on,
# we will cache such upstream hosts and avoid intercepting them for future
Expand Down