Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added calls to ?MODULE functions to ease hot code upgrade

  • Loading branch information...
commit 66ef7c100f67be9e1d7b06cf683171bf42c714cd 1 parent 7feea2f
@ostinelli authored
Showing with 6 additions and 6 deletions.
  1. +3 −3 src/misultin_acceptor.erl
  2. +3 −3 src/misultin_http.erl
View
6 src/misultin_acceptor.erl
@@ -113,7 +113,7 @@ acceptor(ServerRef, SessionsRef, TableDateRef, ListenSocket, ListenPort, RecvTim
misultin_socket:close(Sock, SocketMode)
end,
% get back to accept loop
- acceptor(ServerRef, SessionsRef, TableDateRef, ListenSocket, ListenPort, RecvTimeout, SocketMode, CustomOpts);
+ ?MODULE:acceptor(ServerRef, SessionsRef, TableDateRef, ListenSocket, ListenPort, RecvTimeout, SocketMode, CustomOpts);
{ok, Sock} ->
?LOG_DEBUG("received a new https request, spawning a controlling process",[]),
Pid = spawn(fun() ->
@@ -137,11 +137,11 @@ acceptor(ServerRef, SessionsRef, TableDateRef, ListenSocket, ListenPort, RecvTim
misultin_socket:close(Sock, SocketMode)
end,
% get back to accept loop
- acceptor(ServerRef, SessionsRef, TableDateRef, ListenSocket, ListenPort, RecvTimeout, SocketMode, CustomOpts);
+ ?MODULE:acceptor(ServerRef, SessionsRef, TableDateRef, ListenSocket, ListenPort, RecvTimeout, SocketMode, CustomOpts);
{error, _Error} ->
?LOG_WARNING("accept failed with error: ~p", [_Error]),
% get back to accept loop
- acceptor(ServerRef, SessionsRef, TableDateRef, ListenSocket, ListenPort, RecvTimeout, SocketMode, CustomOpts);
+ ?MODULE:acceptor(ServerRef, SessionsRef, TableDateRef, ListenSocket, ListenPort, RecvTimeout, SocketMode, CustomOpts);
{'EXIT', Error} ->
?LOG_ERROR("accept exited with error: ~p, quitting process", [Error]),
exit({error, {accept_failed, Error}})
View
6 src/misultin_http.erl
@@ -177,9 +177,9 @@ request(#c{recv_timeout = RecvTimeout, get_url_max_size = GetUrlMaxSize} = C, #r
% go to headers
headers(C, Req#req{vsn = Version, method = Method, uri = Path, connection = default_connection(Version)}, []);
{SocketMode, Sock, {http_error, "\r\n"}} ->
- request(C, Req);
+ ?MODULE:request(C, Req);
{SocketMode, Sock, {http_error, "\n"}} ->
- request(C, Req);
+ ?MODULE:request(C, Req);
{http, Sock, {http_error, _Other}} ->
?LOG_DEBUG("not the beginning of a request [maybe a ssl request while socket in http mode?]: ~p, sending bad request message and closing socket", [_Other]),
misultin_socket:send(Sock, build_error_message(400, Req#req{connection = close}, C#c.table_date_ref, C#c.access_log), SocketMode),
@@ -530,7 +530,7 @@ get_chunk_length(HeadLine) ->
handle_keepalive(close, _C, #req{socket = Sock, socket_mode = SocketMode} = _Req) ->
misultin_socket:close(Sock, SocketMode);
handle_keepalive(keep_alive, C, #req{socket = Sock, socket_mode = SocketMode} = Req) ->
- request(C, #req{socket = Sock, socket_mode = SocketMode, peer_addr = Req#req.peer_addr, peer_port = Req#req.peer_port, peer_cert = Req#req.peer_cert}).
+ ?MODULE:request(C, #req{socket = Sock, socket_mode = SocketMode, peer_addr = Req#req.peer_addr, peer_port = Req#req.peer_port, peer_cert = Req#req.peer_cert}).
% File dispatcher
main_dispatcher(#c{static = false} = C, Req) ->
Please sign in to comment.
Something went wrong with that request. Please try again.