Created
October 20, 2010 09:34
-
-
Save nox/636088 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do_handshake(Socket, User, #connect_opts{passwd = Passwd, db = Db}) -> | |
{ok, {Number, Bytes}} = mysqerl_tcp:recv(Socket), | |
{Caps, Message} = mysqerl_util:read_init(Bytes), | |
ok = send_auth(Socket, Number + 1, User, Message, Passwd), | |
State = #state{socket = Socket, supports = Caps}, | |
case Db of | |
undefined -> {ok, State}; | |
_ -> | |
case do_use(Db, State) of | |
Error = {error, _Reason} -> {stop, Error}; | |
_Ok -> {ok, State} end end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment