Starttls session erase old session instance, including proxy_arg details
- 主要語言
- Python
- 星號
- 373
- 分支
- 105
- 平均合併
- 4 分鐘
- 30 天內合併 PR
- 2
描述
Hi,
I noticed that when a StartTls connection is made over an existing connection, a entirely new Session object is created, which erase the previous one that contained the PROXY details (when used).
In order to avoid this issue, a simple solution could be to pass the previous session into the new one, such as:
```
def _create_session(self):
return Session(self.loop, self.session)
```
And the Session object:
```
@public
class Session:
def __init__(self, loop, session: Optional[Session] = None):
self.peer = None
self.ssl = None
self.host_name = session.host_name if session else None
self.extended_smtp = session.extended_smtp if session else False
self.loop = loop
self.proxy_data: Optional[ProxyData] = session.proxy_data if session else None
```
貢獻指南
評估
這個 Issue 還沒有評估資料。