Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/mysql_conn.erl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
%%% Modified: 23 Sep 2006 by Yariv Sadan <[email protected]>
%%% Added transaction handling and prepared statement execution.
%%%
%%% Copyright (c) 2001-2004 Kungliga Tekniska H�gskolan
%%% Copyright (c) 2001-2004 Kungliga Tekniska Högskolan
%%% See the file COPYING
%%%
%%%
Expand Down
3 changes: 2 additions & 1 deletion src/mysql_recv.erl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
%%% Note : All MySQL code was written by Magnus Ahltorp, originally
%%% in the file mysql.erl - I just moved it here.
%%%
%%% Copyright (c) 2001-2004 Kungliga Tekniska H�gskolan
%%% Copyright (c) 2001-2004 Kungliga Tekniska Högskolan
%%% See the file COPYING
%%%
%%% Signals this receiver process can send to it's parent
Expand Down Expand Up @@ -75,6 +75,7 @@ start_link(Host, Port, LogFun, Parent) when is_list(Host), is_integer(Port) ->
spawn_link(fun () ->
init(Host, Port, LogFun, Parent)
end),
erlang:monitor(process, RecvPid),
Copy link

Choose a reason for hiding this comment

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

As I suggested in #37, I would move this call to mysql_conn:

    case mysql_recv:start_link(Host, Port, LogFun, self()) of
	{ok, RecvPid, Sock} ->
	    erlang:monitor(process, RecvPid), % <-- here
	    case mysql_init(Sock, RecvPid, User, Password, LogFun, FoundRows) of

Other than that suggestion, your change looks good to me.

%% wait for the socket from the spawned pid
receive
{mysql_recv, RecvPid, init, {error, E}} ->
Expand Down