Skip to content

Commit

Permalink
use cowboy 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mk270 committed Jan 20, 2021
1 parent cb4d2e1 commit a17f55e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion apps/blizanci/src/blizanci.app.src
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{application, blizanci,
[{description, "A Gemini protocol server"},
{vsn, "3.0.0"},
{vsn, "4.0.0"},
{registered, [blizanci_sup]},
{mod, {blizanci_app, []}},
{applications,
Expand Down
12 changes: 6 additions & 6 deletions apps/blizanci/src/blizanci_gemini.erl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
-include("blizanci_types.hrl").

%% API to be called by other blizanci modules
-export([start_link/4]).
-export([start_link/3]).
-export([verify_cert/3]).
-export([servlet_result/2]).
-export([handle_line/3]). % temporarily enabled for testing
Expand Down Expand Up @@ -99,9 +99,9 @@ gemini_status(permanent_redirect) -> {31, <<"Moved permanently">>}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


-spec start_link(pid(), any(), any(), [any()]) -> {ok, pid()}.
start_link(Ref, Socket, Transport, Opts) ->
proc_lib:start_link(?MODULE, init, [{Ref, Socket, Transport, Opts}]).
-spec start_link(pid(), any(), [any()]) -> {ok, pid()}.
start_link(Ref, Transport, Opts) ->
proc_lib:start_link(?MODULE, init, [{Ref, Transport, Opts}]).


-spec verify_cert(
Expand Down Expand Up @@ -132,9 +132,9 @@ servlet_result(Pid, Result) when is_pid(Pid) ->
%% gen_server.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

init({Ref, Socket, Transport, Opts}) ->
init({Ref, Transport, Opts}) ->
ok = proc_lib:init_ack({ok, self()}),
ok = ranch:accept_ack(Ref),
{ok, Socket} = ranch:handshake(Ref),
ok = activate(Transport, Socket),
PC = ssl:peercert(Socket),
Hostname = erlang:list_to_binary(proplists:get_value(hostname, Opts)),
Expand Down
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{deps, [
lager,
ranch,
{ranch, "2.0.0"},
erlexec,
realpath,
ppool,
Expand Down

0 comments on commit a17f55e

Please sign in to comment.