Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced authentication #52

Closed
wants to merge 7 commits into from

Conversation

@tigercl
Copy link
Contributor

tigercl commented Oct 18, 2018

No description provided.

{ok, Data1} = gen_tcp:recv(Sock1, 0),
{ok, ?CONNACK_PACKET(?RC_MALFORMED_PACKET), _} = raw_recv_pase(Data1),
emqx_client_sock:close(Sock1),

This comment has been minimized.

Copy link
@gilbertwong96

gilbertwong96 Oct 18, 2018

Contributor

There are too many duplicated procedure in your test cases, can you abstract your code and make it shorter and more clear ?

This comment has been minimized.

Copy link
@gilbertwong96

gilbertwong96 Oct 18, 2018

Contributor

You can just write like this

with_connection(fun(Sock) ->

                   %% your procedure
                end).

This comment has been minimized.

Copy link
@tigercl

tigercl Oct 18, 2018

Author Contributor

It's difficult, because it's flexible.

{ok, Data1} = gen_tcp:recv(Sock1, 0),
{ok, ?CONNACK_PACKET(?RC_MALFORMED_PACKET), _} = raw_recv_pase(Data1),
emqx_client_sock:close(Sock1),

This comment has been minimized.

Copy link
@gilbertwong96

gilbertwong96 Oct 18, 2018

Contributor

You can just write like this

with_connection(fun(Sock) ->

                   %% your procedure
                end).
@emqplus emqplus changed the title Enhanced authenticate Enhanced authentication Oct 18, 2018
@emqplus emqplus self-assigned this Oct 18, 2018
@emqplus emqplus added the enhancement label Oct 18, 2018
Username1;
_->
Username
end,

This comment has been minimized.

Copy link
@terry-xiaoyu

terry-xiaoyu Oct 19, 2018

Contributor

An useful trick to do this is using functions.

@tigercl tigercl removed the request for review from CrazyWisdom Oct 19, 2018
@gilbertwong96 gilbertwong96 deleted the enhanced_auth branch Apr 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.