aio-libs / aio-libs/aiosmtpd

Starttls session erase old session instance, including proxy_arg details

未關閉
#287 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
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 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。