Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
v1.02-prebeta-9121
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrewerr committed Jan 9, 2021
1 parent a59602a commit c8e2b56
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{relx, [{release, {'MeowMeow', "1.02-prebeta-101120"}, [app]},
{relx, [{release, {'MeowMeow', "1.02-prebeta-9121"}, [app]},
{dev_mode, true},
{include_erts, false},
{extended_start_script, true}
Expand Down
2 changes: 1 addition & 1 deletion src/app.app.src
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{application, app, [
{description, "A tiny webserver written in erlang"},
{vsn, "1.02-prebeta-101120"},
{vsn, "1.02-prebeta-9121"},
{modules, []},
{registered, [app_sup]},
{applications, [
Expand Down
4 changes: 2 additions & 2 deletions src/config.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
%%% @end
%%% Created : 26. авг. 2020 19:50
%%%-------------------------------------------------------------------
%%TODO:Config file
%%DONE:Config file
-author("p01ar").
-record(sockaddr_in4, {family = inet, port = 8888, addr = {0, 0, 0, 0}}).
-define(CHUNK_SIZE, 2048).
-define(version, "MeowMeow/1.02-prebeta-101120").
-define(version, "MeowMeow/1.02-prebeta-9121").
-define(accessfile, "/etc/MeowMeow/routes.conf").
-define(max_request_length, 10000).
-define(mime_types_file, "mime.types").
Expand Down
13 changes: 9 additions & 4 deletions src/fcgi.erl
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,22 @@ fcgi_proxy(FastCGIConnection,Response) ->
logging:debug("Sending ~p, then ~p",[NewResponse,Tail]),
io_proxy:tcp_send(Response#response.socket, response:do_response_headers(NewResponse)),
io_proxy:tcp_send(Response#response.socket, Tail),
fcgi_send(NewResponse);
fcgi_send(NewResponse),
NewResponse#response{is_finished=true};
NewResponse->
fcgi_proxy(FastCGIConnection, NewResponse)
end;
{fast_cgi_stderr, 600, Msg}->
logging:err("FastCGI error: ~p",[Msg]),
fcgi_proxy(FastCGIConnection, Response);
Unhandled->
logging:debug("Got unhandled FastCGI data: ~p @ fcgi:fcgi_proxy/2",[Unhandled]),
io_proxy:tcp_send(Response#response.socket, handle:abort(502))
io_proxy:tcp_send(Response#response.socket, handle:abort(502)),
Response#response{code=502, is_finished=true}
after
5000 -> erl_fastcgi:close(FastCGIConnection)
end,
Response#response{is_finished=true}.
end.
%%Response#response{is_finished=true}.

fcgi_exec(Arg, Response) ->
[Script,Host,Port,TryToReconnectEveryMillis] = string:split(Arg, " ",all),
Expand Down

0 comments on commit c8e2b56

Please sign in to comment.