Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

refactor(security): close the connection when something is wrong with sever_negotiation #606

Merged
merged 3 commits into from
Aug 28, 2020

Conversation

levy5307
Copy link
Contributor

@levy5307 levy5307 commented Aug 27, 2020

In previous implementation, when something is wrong in server_negotiation, it send a message to client_negotiation, and the client_negotiation will close the connection when it receives the message.
So I think we can directly close the connection in this case, no need to send a message.

{
negotiation_response &response = rpc.response();
_status = response.status = negotiation_status::type::SASL_AUTH_FAIL;
response.msg = reason;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In previous implementation, there will be error reason. Is it totally useless?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is only used for sending a message to client to show why it is failed. I think it is useless

@hycdong hycdong merged commit e057876 into XiaoMi:master Aug 28, 2020
levy5307 added a commit to levy5307/rdsn that referenced this pull request Dec 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants