Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'fdsrv-removal'

  • Loading branch information...
commit 3af91fbfa185313756d694f00148bc03cd78e6c4 2 parents f229da3 + 98ac050
@etrepum etrepum authored
View
1  .gitignore
@@ -5,3 +5,4 @@
/docs
.DS_Store
/TEST-*.xml
+/deps
View
2  src/mochiweb.app.src
@@ -1,7 +1,7 @@
%% This is generated from src/mochiweb.app.src
{application, mochiweb,
[{description, "MochiMedia Web Server"},
- {vsn, "1.5.2"},
+ {vsn, "2.0.0"},
{modules, []},
{registered, []},
{mod, {mochiweb_app, []}},
View
33 src/mochiweb_socket_server.erl
@@ -165,27 +165,7 @@ init(State=#mochiweb_socket_server{ip=Ip, port=Port, backlog=Backlog, nodelay=No
{_, _, _, _, _, _, _, _} -> % IPv6
[inet6, {ip, Ip} | BaseOpts]
end,
- case listen(Port, Opts, State) of
- {stop, eacces} ->
- case Port < 1024 of
- true ->
- case catch fdsrv:start() of
- {ok, _} ->
- case fdsrv:bind_socket(tcp, Port) of
- {ok, Fd} ->
- listen(Port, [{fd, Fd} | Opts], State);
- _ ->
- {stop, fdsrv_bind_failed}
- end;
- _ ->
- {stop, fdsrv_start_failed}
- end;
- false ->
- {stop, eacces}
- end;
- Other ->
- Other
- end.
+ listen(Port, Opts, State).
new_acceptor_pool(Listen,
State=#mochiweb_socket_server{acceptor_pool=Pool,
@@ -271,15 +251,8 @@ handle_cast(stop, State) ->
terminate(Reason, State) when ?is_old_state(State) ->
terminate(Reason, upgrade_state(State));
-terminate(_Reason, #mochiweb_socket_server{listen=Listen, port=Port}) ->
- mochiweb_socket:close(Listen),
- case Port < 1024 of
- true ->
- catch fdsrv:stop(),
- ok;
- false ->
- ok
- end.
+terminate(_Reason, #mochiweb_socket_server{listen=Listen}) ->
+ mochiweb_socket:close(Listen).
code_change(_OldVsn, State, _Extra) ->
State.
Please sign in to comment.
Something went wrong with that request. Please try again.