Permalink
Browse files

Rewrote url splitting (again), and made the redir to index.{html,yaws…

…} go away, it was a bad decision to redir to index.yaws when it exists and the url doesn't contain it, also reworked appmods a bit

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@686 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
klacke committed May 25, 2004
1 parent 5d32ac8 commit b67bbd803a12831eadfe082e2353e844a6f83986
Showing with 225 additions and 111 deletions.
  1. +7 −0 include/yaws.hrl
  2. +9 −0 src/yaws.erl
  3. +11 −7 src/yaws_config.erl
  4. +198 −104 src/yaws_server.erl
View
@@ -207,3 +207,10 @@
-define(READ_TIMEOUT, 30000).
+
+
+
+-record(appmodspec, {
+ type, %% atom, pair or absolute
+ data}).
+
View
@@ -642,6 +642,15 @@ arg_rewrite(A) ->
+delall(H, [H|T]) ->
+ delall(H,T);
+delall(H,[H1|T]) ->
+ [H1 | delall(H, T)];
+delall(_,[]) ->
+ [].
+
+
+
to_lowerchar(C) when C >= $A, C =< $Z ->
C+($a-$A);
to_lowerchar(C) ->
View
@@ -464,7 +464,7 @@ fload(FD, server, GC, C, Cs, Lno, Chars) ->
["appmods", '=' | AppMods] ->
case parse_appmods(AppMods, []) of
{ok, L} ->
- C2 = C#sconf{appmods = L},
+ C2 = C#sconf{appmods = L ++ C#sconf.appmods},
fload(FD, server, GC, C2, Cs, Lno+1, Next);
{error, Str} ->
{error, ?F("~s at line ~w", [Str, Lno])}
@@ -792,23 +792,27 @@ is_special(C) ->
parse_appmods(['<', PathElem, ',' , AppMod, '>' | Tail], Ack) ->
- parse_appmods(Tail, [{PathElem, list_to_atom(AppMod)} |Ack]);
+ S = {PathElem , list_to_atom(AppMod)},
+ parse_appmods(Tail, [S |Ack]);
+
parse_appmods([AppMod | Tail], Ack) ->
+ %% just some simpleminded test to catch syntax errors in the config
case AppMod of
[Char] ->
case is_special(Char) of
true ->
{error, "Bad appmod syntax"};
false ->
- parse_appmods(Tail, [{AppMod, list_to_atom(AppMod)} | Ack])
+ S = {AppMod, list_to_atom(AppMod)},
+ parse_appmods(Tail, [S | Ack])
end;
_ ->
- parse_appmods(Tail, [{AppMod, list_to_atom(AppMod)} |Ack])
+ S = {AppMod, list_to_atom(AppMod)},
+ parse_appmods(Tail, [S | Ack])
end;
+
parse_appmods([], Ack) ->
- {ok, Ack};
-parse_appmods(_, _) ->
- {error, "Wrong appmod spec"}.
+ {ok, Ack}.
Oops, something went wrong.

0 comments on commit b67bbd8

Please sign in to comment.