Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

""

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@35 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
commit 8104bc6cf7bb941c521ab8391218a0e51938b6d7 1 parent e315955
@klacke authored
View
2  ebin/yaws.app
@@ -1,6 +1,6 @@
{application,yaws,
[{description,"yaws WWW server"},
- {vsn,"0.26"},
+ {vsn,"0.28"},
{modules,[yaws, yaws_app, yaws_config, yaws_server, yaws_sup, yaws_api, yaws_log, yaws_ls, yaws_debug, yaws_compile]},
{registered, []},
{mod,{yaws_app,[]}},
View
6 scripts/Install
@@ -6,8 +6,10 @@ prefix=$1
erl=$2
. ../vsn.mk
+y=yaws-${YAWS_VSN}
-sh ./mangle ${prefix}/lib/yaws-${YAWS_VSN} ${erl} yaws.ss ${prefix}/bin/yaws
+
+sh ./mangle ${prefix}/lib/yaws ${erl} yaws.ss ${prefix}/bin/yaws
install -d ${prefix}/lib/yaws/examples/ebin
install -d ${prefix}/lib/yaws/examples/include
chmod +x ${prefix}/bin/yaws
@@ -17,5 +19,5 @@ else
t=/etc/yaws.conf
fi
-sh ./mangle ${prefix}/lib/yaws-${YAWS_VSN} ${erl} yaws.conf.template ${t}
+sh ./mangle ${prefix}/lib/yaws ${erl} yaws.conf.template ${t}
View
14 src/yaws_config.erl
@@ -16,9 +16,16 @@
%% where to look for yaws.conf
paths() ->
- [filename:join([os:getenv("HOME"), "yaws.conf"]),
- "./yaws.conf",
- "/etc/yaws.conf"].
+ case os:cmd("id -u") of
+ [$0 |_] -> %% root
+ ["./yaws.conf",
+ "/etc/yaws.conf"];
+ _ -> %% developer
+ [filename:join([os:getenv("HOME"), "yaws.conf"]),
+ "./yaws.conf",
+ "/etc/yaws.conf"]
+ end.
+
%% load the config
@@ -31,6 +38,7 @@ load(false, Trace, Debug) ->
load({file, File}, Trace, Debug)
end;
load({file, File}, Trace, Debug) ->
+ yaws_log:infolog("Using config file ~s", [File]),
case file:open(File, [read]) of
{ok, FD} ->
GC = make_default_gconf(),
View
16 src/yaws_log.erl
@@ -40,6 +40,8 @@ accesslog(Ip, Req, Status, Length) ->
gen_server:cast(?MODULE, {access, Ip, Req, Status, Length}).
errlog(F, A) ->
gen_server:cast(?MODULE, {errlog, F, A}).
+infolog(F, A) ->
+ gen_server:cast(?MODULE, {infolog, F, A}).
sync_errlog(F, A) ->
gen_server:call(?MODULE, {errlog, F, A}).
setdir(Dir) ->
@@ -77,12 +79,14 @@ init([]) ->
%%----------------------------------------------------------------------
handle_call({setdir, Dir}, From, State) when State#state.running == false ->
?Debug("setdir ~s~n~p", [Dir, State#state.ack]),
- error_logger:logfile({open,filename:join([Dir, "error.log"])}),
+ error_logger:logfile({open,filename:join([Dir, "log"])}),
Alog = filename:join([Dir, "access"]),
case file:open(Alog, [write, raw, append]) of %% FIXME wrap log
{ok, Fd} ->
lists:foreach(fun({err, F, A}) ->
error_logger:format(F, A);
+ ({info, F, A}) ->
+ error_logger:info_msg(F,A);
({access, Ip, Req, Status, Length}) ->
I = fmt_alog(State#state.now,
Ip, Req, Status,
@@ -129,6 +133,16 @@ handle_cast({errlog, F, A}, State) when State#state.running == true ->
{noreply, State};
handle_cast({errlog, F, A}, State) when State#state.running == false ->
{noreply, State#state{ack = [{err, F, A} | State#state.ack]}};
+
+
+handle_cast({infolog, F, A}, State) when State#state.running == true ->
+ error_logger:info_report(F, A),
+ {noreply, State};
+handle_cast({infolog, F, A}, State) when State#state.running == false ->
+ {noreply, State#state{ack = [{info, F, A} | State#state.ack]}};
+
+
+
handle_cast({access, Ip, Req, Status, Length}, State) ->
case State#state.running of
true ->
View
2  vsn.mk
@@ -1 +1 @@
-YAWS_VSN=0.27
+YAWS_VSN=0.29
Please sign in to comment.
Something went wrong with that request. Please try again.