Skip to content

Commit

Permalink
Rename p1_tls files to match project name
Browse files Browse the repository at this point in the history
  • Loading branch information
mremond committed Jan 14, 2016
1 parent 365fb87 commit 10e440c
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions c_src/p1_tls_drv.c → c_src/fast_tls_drv.c
Expand Up @@ -838,7 +838,7 @@ ErlDrvEntry tls_driver_entry = {
NULL, /* F_PTR output, called when erlang has sent */
NULL, /* F_PTR ready_input, called when input descriptor ready */
NULL, /* F_PTR ready_output, called when output descriptor ready */
"p1_tls_drv", /* char *driver_name, the argument to open_port */
"fast_tls_drv", /* char *driver_name, the argument to open_port */
tls_drv_finish, /* F_PTR finish, called when unloaded */
NULL, /* handle */
tls_drv_control, /* F_PTR control, port_command callback */
Expand All @@ -858,7 +858,7 @@ ErlDrvEntry tls_driver_entry = {
NULL /* stop_select */
};

DRIVER_INIT(p1_tls_drv) /* must match name in driver_entry */
DRIVER_INIT(fast_tls_drv) /* must match name in driver_entry */
{
CRYPTO_set_mem_functions(driver_alloc, driver_realloc, driver_free);
OpenSSL_add_ssl_algorithms();
Expand Down
6 changes: 3 additions & 3 deletions rebar.config
Expand Up @@ -26,13 +26,13 @@

{port_env, [{"CFLAGS", "$CFLAGS"}, {"LDFLAGS", "$LDFLAGS -lssl -lcrypto"}]}.

{port_specs, [{"priv/lib/p1_tls_drv.so", ["c_src/p1_tls_drv.c"]},
{port_specs, [{"priv/lib/fast_tls_drv.so", ["c_src/fast_tls_drv.c"]},
{"priv/lib/p1_sha.so", ["c_src/p1_sha.c"]}]}.

{deps, [{p1_utils, ".*", {git, "git://github.com/processone/p1_utils", {tag, "1.0.3"}}}]}.

{clean_files, ["c_src/p1_tls_drv.gcda", "c_src/p1_tls_drv.gcno",
"c_src/p1_sha.gcda", "c_src/p1_sha.gcno"]}.
{clean_files, ["c_src/fast_tls_drv.gcda", "c_src/fast_tls_drv.gcno",
"c_src/fast_sha.gcda", "c_src/fast_sha.gcno"]}.

{cover_enabled, true}.
{cover_export_enabled, true}.
Expand Down
2 changes: 1 addition & 1 deletion rebar.config.script
Expand Up @@ -50,7 +50,7 @@ Cfg0 = ModCfg(CONFIG, [port_env, "CFLAGS"], fun(V) -> V ++ " " ++ CfgCFlags end,
Cfg00 = ModCfg(Cfg0, [port_env, "LDFLAGS"], fun(V) -> V ++ " " ++ CfgLDFlags end, "$LDFLAGS"),
Cfg1 = case CfgWithGCov of
"true" ->
V1 = ModCfg(Cfg00, [post_hooks], fun(V) -> V ++ [{eunit, "gcov -o c_src p1_tls p1_sha"},
V1 = ModCfg(Cfg00, [post_hooks], fun(V) -> V ++ [{eunit, "gcov -o c_src fast_tls p1_sha"},
{eunit, "mv *.gcov .eunit/"}] end, []),
V2 = ModCfg(V1, [port_env, "LDFLAGS"], fun(V) -> V ++ " --coverage" end, ""),
ModCfg(V2, [port_env, "CFLAGS"], fun(V) -> V ++ " --coverage" end, "");
Expand Down
4 changes: 2 additions & 2 deletions src/p1_tls.app.src → src/fast_tls.app.src
Expand Up @@ -21,13 +21,13 @@
%%%
%%%----------------------------------------------------------------------

{application, p1_tls,
{application, fast_tls,
[{description, "TLS / SSL OpenSSL-based native driver for Erlang / Elixir"},
{vsn, "1.0.0"},
{modules, []},
{registered, []},
{applications, [kernel, stdlib]},
{mod, {p1_tls_app,[]}}]}.
{mod, {fast_tls_app,[]}}]}.

%% Local Variables:
%% mode: erlang
Expand Down
12 changes: 6 additions & 6 deletions src/p1_tls.erl → src/fast_tls.erl
@@ -1,5 +1,5 @@
%%%----------------------------------------------------------------------
%%% File : p1_tls.erl
%%% File : fast_tls.erl
%%% Author : Alexey Shchepin <alexey@process-one.net>
%%% Purpose : Interface to openssl
%%% Created : 24 Jul 2004 by Alexey Shchepin <alexey@process-one.net>
Expand All @@ -21,7 +21,7 @@
%%%
%%%----------------------------------------------------------------------

-module(p1_tls).
-module(fast_tls).

-author('alexey@process-one.net').

Expand Down Expand Up @@ -109,7 +109,7 @@ tcp_to_tls(TCPSocket, Options) ->
case lists:keysearch(certfile, 1, Options) of
{value, {certfile, CertFile}} ->
load_driver(),
Port = open_port({spawn, "p1_tls_drv"}, [binary]),
Port = open_port({spawn, "fast_tls_drv"}, [binary]),
Flags1 = case lists:member(verify_none, Options) of
true -> ?VERIFY_NONE;
false -> 0
Expand Down Expand Up @@ -284,7 +284,7 @@ get_verify_result(#tlssock{tlsport = Port}) ->

test() ->
load_driver(),
Port = open_port({spawn, "p1_tls_drv"}, [binary]),
Port = open_port({spawn, "fast_tls_drv"}, [binary]),
?PRINT("open_port: ~p~n", [Port]),
PCRes = port_control(Port, ?SET_CERTIFICATE_FILE_ACCEPT,
<<"./ssl.pem", 0>>),
Expand Down Expand Up @@ -403,9 +403,9 @@ integer_to_binary(I) ->
list_to_binary(integer_to_list(I)).

load_driver() ->
SOPath = p1_nif_utils:get_so_path(p1_tls, [fast_tls, p1_tls], "p1_tls_drv"),
SOPath = p1_nif_utils:get_so_path(fast_tls, [fast_tls], "fast_tls_drv"),
Dir = filename:dirname(SOPath),
case erl_ddll:load_driver(Dir, "p1_tls_drv") of
case erl_ddll:load_driver(Dir, "fast_tls_drv") of
ok ->
ok;
{error, already_loaded} ->
Expand Down
8 changes: 4 additions & 4 deletions src/p1_tls_app.erl → src/fast_tls_app.erl
@@ -1,7 +1,7 @@
%%%----------------------------------------------------------------------
%%% File : p1_tls_app.erl
%%% File : fast_tls_app.erl
%%% Author : Evgeniy Khramtsov <ekhramtsov@process-one.net>
%%% Purpose : p1_tls application
%%% Purpose : fast_tls application
%%% Created : 4 Apr 2013 by Evgeniy Khramtsov <ekhramtsov@process-one.net>
%%%
%%%
Expand All @@ -21,7 +21,7 @@
%%%
%%%----------------------------------------------------------------------

-module(p1_tls_app).
-module(fast_tls_app).

-behaviour(application).

Expand Down Expand Up @@ -51,7 +51,7 @@
start(_StartType, _StartArgs) ->
ok = application:ensure_started(crypto),
ok = p1_sha:load_nif(),
p1_tls_sup:start_link().
fast_tls_sup:start_link().


%%--------------------------------------------------------------------
Expand Down
10 changes: 5 additions & 5 deletions src/p1_tls_sup.erl → src/fast_tls_sup.erl
@@ -1,7 +1,7 @@
%%%----------------------------------------------------------------------
%%% File : p1_tls_sup.erl
%%% File : fast_tls_sup.erl
%%% Author : Evgeniy Khramtsov <ekhramtsov@process-one.net>
%%% Purpose : p1_tls supervisor
%%% Purpose : fast_tls supervisor
%%% Created : 4 Apr 2013 by Evgeniy Khramtsov <ekhramtsov@process-one.net>
%%%
%%%
Expand All @@ -21,7 +21,7 @@
%%%
%%%----------------------------------------------------------------------

-module(p1_tls_sup).
-module(fast_tls_sup).

-behaviour(supervisor).

Expand Down Expand Up @@ -65,8 +65,8 @@ start_link() ->
%% @end
%%--------------------------------------------------------------------
init([]) ->
TLS = {p1_tls, {p1_tls, start_link, []},
permanent, brutal_kill, worker, [p1_tls]},
TLS = {fast_tls, {fast_tls, start_link, []},
permanent, brutal_kill, worker, [fast_tls]},
{ok, {{one_for_one, 10, 1}, [TLS]}}.

%%%===================================================================
Expand Down

0 comments on commit 10e440c

Please sign in to comment.