Skip to content
Browse files

added -x flag for tty trace and did the 1.3 release

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@497 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
1 parent feaff00 commit 82d6e294b3e1651888073e616c63c592ad26a676 @klacke committed Aug 25, 2003
Showing with 92 additions and 26 deletions.
  1. BIN doc/yaws.pdf
  2. +6 −0 man/yaws.1
  3. +5 −2 man/yaws.conf.5
  4. +5 −0 scripts/yaws.ss
  5. +3 −2 src/yaws.erl
  6. +11 −4 src/yaws_config.erl
  7. +1 −1 src/yaws_debug.erl
  8. +3 −3 src/yaws_log.erl
  9. +13 −5 src/yaws_server.erl
  10. +1 −1 vsn.mk
  11. +44 −8 www/index.yaws
View
BIN doc/yaws.pdf
Binary file not shown.
View
6 man/yaws.1
@@ -47,6 +47,12 @@ in the log directory.
\fB\-T\fR
HTTP trace mode. All HTTP messages will be written to a trace file called trace.http
in the log directory.
+
+.TP
+\fB\-x\fR
+When yaws is put into trace mode using either -T or -t, traces are written to files. If we provide the -x flag, the trace will also be written to stdout.
+
+
.TP
\fB\-h\fR
HUP the daemon. This forces the daemon to reread the configuration file. It also makes
View
7 man/yaws.conf.5
@@ -90,8 +90,11 @@ This makes the server listen on Port
\fBlisten = IpAddress\fR
This makes the server listen on IpAddress
When virthosting several servers on the same ip/port address, if the
-browser doesn't sebd a Host: field, yaws will pick the \fIfirst\fR
-server specified in the config file
+browser doesn't send a Host: field, yaws will pick the \fIfirst\fR
+server specified in the config file.
+If the specified ip address is 0.0.0.0 yaws will listn on all ip
+addresses on the specified port.
+
.TP
\fBrhost = Host[:Port] \fR
This forces all local redirects issued by the server to go to Host.
View
5 scripts/yaws.ss
@@ -18,6 +18,7 @@ help()
echo " yaws -r mod -- call mod:start/0 at startup"
echo " yaws -t -- trace all traffic"
echo " yaws -T -- trace http traffic"
+ echo " yaws -x -- trace output to stdout"
echo " yaws -v -- print version"
echo ""
echo " yaws -heart -- auto restart yaws if it crashes"
@@ -60,6 +61,8 @@ do
trace=" -yaws trace traffic ";;
-T)
trace=" -yaws trace http ";;
+ -x)
+ traceoutput=" -yaws traceoutput ";;
-c)
conf=" -conf $1 "
shift;;
@@ -102,6 +105,8 @@ do
esac
done
+trace="${trace} ${traceoutput}"
+
[ -z "$daemon" ] && [ -z "$interactive" ] && help
if [ -z "$heart" ] || [ -z "$daemon" ]; then
View
5 src/yaws.erl
@@ -35,8 +35,9 @@ hup(Sock) ->
dohup(Sock) ->
io:format("in dohup~n", []),
- {Debug, Trace, Conf, _RunMod, _Embed} = yaws_server:get_app_args(),
- Res = (catch case yaws_config:load(Conf, Trace, Debug) of
+ {Debug, Trace, TraceOut, Conf, _RunMod, _Embed} =
+ yaws_server:get_app_args(),
+ Res = (catch case yaws_config:load(Conf, Trace, TraceOut, Debug) of
{ok, Gconf, Sconfs} ->
yaws_api:setconf(Gconf, Sconfs);
Err ->
View
15 src/yaws_config.erl
@@ -21,7 +21,7 @@
-compile(export_all).
%%-export([Function/Arity, ...]).
--export([load/3,
+-export([load/4,
make_default_gconf/1]).
@@ -40,20 +40,27 @@ paths() ->
%% load the config
-load(false, Trace, Debug) ->
+load(false, Trace, TraceOutput, Debug) ->
case yaws:first(fun(F) -> exists(F) end, paths()) of
false ->
{error, "Can't find no config file "};
{ok, _, File} ->
- load({file, File}, Trace, Debug)
+ load({file, File}, Trace, TraceOutput, Debug)
end;
-load({file, File}, Trace, Debug) ->
+load({file, File}, Trace, TraceOutput, Debug) ->
error_logger:info_msg("Yaws: Using config file ~s~n", [File]),
case file:open(File, [read]) of
{ok, FD} ->
GC = make_default_gconf(Debug),
R = (catch fload(FD, globals, GC#gconf{file = File,
trace = Trace,
+ tty_trace =
+ if
+ TraceOutput==undefined->
+ false;
+ true ->
+ true
+ end,
debug = Debug
},
undefined,
View
2 src/yaws_debug.erl
@@ -125,7 +125,7 @@ fail({format, File,Line,Fmt,Args}) ->
-format(GC, F, A) ->
+format(GC, F, A) ->
if
GC#gconf.debug == true ->
io:format(F, A);
View
6 src/yaws_log.erl
@@ -234,9 +234,9 @@ handle_cast({trace, from_client, Data}, State) ->
do_alog(ServerName, Ip, Req, Status, Length, Referrer, UserAgent, State) ->
case lists:keysearch(ServerName, #alog.servername, State#state.alogs) of
{value, AL} ->
- I = fmt_alog(State#state.now, Ip, Req, Status, Length, Referrer, UserAgent),
- file:write(AL#alog.fd, I),
- tty_trace(I, State);
+ I = fmt_alog(State#state.now, Ip, Req, Status, Length,
+ Referrer, UserAgent),
+ file:write(AL#alog.fd, I);
_ ->
false
end.
View
18 src/yaws_server.erl
@@ -96,6 +96,12 @@ get_app_args() ->
_ ->
false
end,
+ TraceOutput = case application:get_env(yaws, traceoutput) of
+ undefined ->
+ lists:member({yaws, ["tracedebug"]}, AS);
+ {ok, Val3} ->
+ Val3
+ end,
Conf = case application:get_env(yaws, conf) of
undefined ->
find_c(AS);
@@ -114,7 +120,7 @@ get_app_args() ->
{ok, Val0} ->
Val0
end,
- {Debug, Trace, Conf, RunMod, Embed}.
+ {Debug, Trace, TraceOutput, Conf, RunMod, Embed}.
find_c([{conf, [File]} |_]) ->
{file, File};
@@ -145,17 +151,18 @@ l2a(A) when atom(A) -> A.
init([]) ->
process_flag(trap_exit, true),
put(start_time, calendar:local_time()), %% for uptime
- {Debug, Trace, Conf, RunMod, Embed} = get_app_args(),
+ {Debug, Trace, TraceOut, Conf, RunMod, Embed} = get_app_args(),
case Embed of
false ->
- case yaws_config:load(Conf, Trace, Debug) of
+ case yaws_config:load(Conf, Trace, TraceOut, Debug) of
{ok, Gconf, Sconfs} ->
erase(logdir),
?Debug("Conf = ~p~n", [?format_record(Gconf, gconf)]),
yaws_log:setdir(Gconf#gconf.logdir, Sconfs),
case Gconf#gconf.trace of
{true, What} ->
- yaws_log:open_trace(What);
+ yaws_log:open_trace(What),
+ yaws_api:set_tty_trace(Gconf#gconf.tty_trace);
_ ->
ok
end,
@@ -644,7 +651,8 @@ acceptor0(GS, Top) ->
{Top, accept} ->
acceptor0(GS, Top)
end;
- _ ->
+ ERR ->
+ yaws_debug:derror(GS#gs.gconf, "Failed to accept: ~p~n", [ERR]),
exit(normal)
end.
View
2 vsn.mk
@@ -1 +1 @@
-YAWS_VSN=1.22
+YAWS_VSN=1.30
View
52 www/index.yaws
@@ -56,15 +56,57 @@ powered by Yaws.
<p>A mailing list exists at: <a href="https://lists.sourceforge.net/lists/listinfo/erlyaws-list">https://lists.sourceforge.net/lists/listinfo/erlyaws-list</a>
+
<p> <h2> News </h2>
<div class="man">
-<h3> Jun 1, 2003. Version 1.22 released </h3>
+<h3> Aug 25, 2003. Version 1.30 released </h3>
<ul>
+<li><p> This is major feature release with many new features by in particular
+Carsten Schultz and Leon Smith plus the normal set of regular bugfixes.
+<li><p> Setuid code had broken (klacke)
+<li><p> Setcookie problem with lynx (Johan Bevemyr)
+<li><p> Wiki: Thumbnail index to slideshow (Johan Bevemyr)
+<li><p> Fixed Cross-Site Scripting vunerability (Leon Smith)
+<li><p> url parsing rewritten in order to normalize the URL path in a
+more secure way (Leon Smith)
+<li><p> Log file size for dynamic content also (Carsten Schultz)
+<li><p> Full CGI and PHP support (Carsten Schultz)
+<li><p> Added support for Content-Range, If-Range, If-Match (Carsten Schultz)
+<li><p> HEAD handling rewritten (Carsten Schultz)
+<li> <p> Darwin MacOs X support (Eric Baur)
+<li> <p> Docs updated describing cgi and php support (Carsten Schultz)
+<li> <p> tty trace directly from command line for enhanced debugging
+
+</ul>
+
+
+</div>
+
+
+
+
+
+
+
+
+
+
+<h2> Old News </h2>
+<div class="box">
+
+
+
+
+
+<ul>
+<li>Jun 1, 2003. Version 1.22 released </h3>
+<ul>
+
<li><p> This is bugfix release.
<li><p> cosmetic changes in ehtml output
<li><p> wiki install problems
@@ -77,16 +119,10 @@ powered by Yaws.
<li><p> cosmetic updates to the latex docs
</ul>
-
-
-</div>
-
-
+</ul>
-<h2> Old News </h2>
-<div class="box">
<ul>

0 comments on commit 82d6e29

Please sign in to comment.
Something went wrong with that request. Please try again.