Skip to content

Commit c208797

Browse files
committed
webmachine_mochiweb: loop/2: swap parameter order; loop2/2: replace with loop/2
1 parent 7da44ab commit c208797

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/webmachine_mochiweb.erl

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
-module(webmachine_mochiweb).
1919
-author('Justin Sheehy <justin@basho.com>').
2020
-author('Andy Gross <andy@basho.com>').
21-
-export([start/1, stop/0, stop/1, loop/2, loop2/2, new_webmachine_req/1]).
21+
-export([start/1, stop/0, stop/1, loop/2, new_webmachine_req/1]).
2222

2323
-include("webmachine_logger.hrl").
2424
-include("wm_reqstate.hrl").
@@ -63,7 +63,7 @@ start(Options) ->
6363
webmachine_router:init_routes(DGroup, DispatchList),
6464
_ = [application_set_unless_env_or_undef(K, V) || {K, V} <- WMOptions],
6565
MochiName = list_to_atom(to_list(PName) ++ "_mochiweb"),
66-
LoopFun = {?MODULE, loop2, [DGroup]},
66+
LoopFun = {?MODULE, loop, [DGroup]},
6767
mochiweb_http:start([{name, MochiName}, {loop, LoopFun} | OtherOptions]).
6868

6969
stop() ->
@@ -74,14 +74,8 @@ stop() ->
7474
stop(Name) ->
7575
mochiweb_http:stop(Name).
7676

77-
-spec loop2(mochiweb_request(), any()) -> ok.
78-
loop2(MochiReq, DGroup) ->
79-
loop(DGroup, MochiReq).
80-
81-
-spec loop(any(),
82-
mochiweb_request()) ->
83-
ok.
84-
loop(Name, MochiReq) ->
77+
-spec loop(mochiweb_request(), any()) -> ok.
78+
loop(MochiReq, Name) ->
8579
case new_webmachine_req(MochiReq) of
8680
{{error, NewRequestError}, ErrorReq} ->
8781
handle_error(500, {error, NewRequestError}, ErrorReq);

0 commit comments

Comments
 (0)