Permalink
Browse files

Major general code cleanup, finally got rid of all the export_all sta…

…tements and in that process removed a bit of code that wasn't used

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@1240 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
1 parent f4867b8 commit 9a74e5aa8dfcc3efe5725252693c19c6685c550f @klacke committed May 12, 2008
Showing with 334 additions and 512 deletions.
  1. +208 −294 src/yaws.erl
  2. +2 −2 src/yaws_api.erl
  3. +3 −19 src/yaws_compile.erl
  4. +12 −13 src/yaws_config.erl
  5. +5 −1 src/yaws_ctl.erl
  6. +3 −3 src/yaws_dav.erl
  7. +13 −3 src/yaws_debug.erl
  8. +11 −4 src/yaws_log.erl
  9. +1 −2 src/yaws_ls.erl
  10. +25 −65 src/yaws_revproxy.erl
  11. +44 −103 src/yaws_server.erl
  12. +7 −3 src/yaws_session_server.erl
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1486,10 +1486,10 @@ parse_set_cookie(Str, Cookie) ->
case Rest1 of
[$=|Rest2] ->
{Value,Quoted,Rest3} = parse_set_cookie_value(Rest2),
- NewC=add_set_cookie(yaws:lowercase(Cookie),Key,Value,Quoted),
+ NewC=add_set_cookie(yaws:to_lower(Cookie),Key,Value,Quoted),
parse_set_cookie(Rest3,NewC);
[$;|Rest2] ->
- NewC =add_set_cookie(yaws:lowercase(Cookie),Key,undefined,false),
+ NewC =add_set_cookie(yaws:to_lower(Cookie),Key,undefined,false),
parse_set_cookie(Rest2,NewC);
_ ->
Cookie
View
@@ -8,10 +8,6 @@
-module(yaws_compile).
-author('klacke@hyber.org').
--compile(export_all).
-
-
-
-include("../include/yaws.hrl").
-include("../include/yaws_api.hrl").
-include("yaws_debug.hrl").
@@ -38,6 +34,9 @@
outfile,
outfd}).
+-export([compile_file/1]).
+%% internal exports
+-export([compiler_proc/3]).
comp_opts(GC) ->
?Debug("I=~p~n", [GC#gconf.include_dir]),
@@ -454,21 +453,6 @@ get_line_from_chars([H|T], Line) ->
-
-gg() ->
- {ok, _Fd} = file_open("arg.yaws"),
- ggg().
-
-ggg() ->
- case get_line() of
- eof ->
- eof;
- X ->
- io:format("~s", [X]),
- ggg()
- end.
-
-
%% -----------------------------------------------------------------
%% From compile.erl in order to print proper error/warning messages
%% if compiled with check option.
View
@@ -16,13 +16,17 @@
-include_lib("kernel/include/file.hrl").
--compile(export_all).
-%%-export([Function/Arity, ...]).
-
-export([load/1,
toks/1,
- make_default_gconf/2]).
-
+ make_default_gconf/2, make_default_sconf/0,
+ add_sconf/1,
+ add_yaws_auth/1,
+ add_yaws_soap_srv/1,
+ search_sconf/2, search_group/2,
+ update_sconf/2, delete_sconf/2,
+ eq_sconfs/2, soft_setconf/4, hard_setconf/2,
+ can_hard_gc/2, can_soft_setconf/4,
+ can_soft_gc/2, verify_upgrade_args/2]).
%% where to look for yaws.conf
paths() ->
@@ -266,13 +270,10 @@ make_default_gconf(Debug, Id) ->
id = Id
}.
-
-
make_default_sconf() ->
Y = yaws_dir(),
#sconf{docroot = filename:join([Y, "www"])}.
-
yaws_dir() ->
P = filename:split(code:which(?MODULE)),
P1 = del_tail(P),
@@ -1085,7 +1086,7 @@ toks([$#|_T], Mode, Ack, Tack) ->
toks([H|T], free, Ack, Tack) ->
%?Debug("Char=~p", [H]),
- case {is_quote(H), is_string_char(H), is_special(H), is_space(H)} of
+ case {is_quote(H), is_string_char(H), is_special(H), yaws:is_space(H)} of
{_,_, _, true} ->
toks(T, free, Ack, Tack);
{_,_, true, _} ->
@@ -1100,7 +1101,8 @@ toks([H|T], free, Ack, Tack) ->
end;
toks([C|T], string, Ack, Tack) ->
%?Debug("Char=~p", [C]),
- case {is_backquote(C), is_quote(C), is_string_char(C), is_special(C), is_space(C)} of
+ case {is_backquote(C), is_quote(C), is_string_char(C), is_special(C),
+ yaws:is_space(C)} of
{true, _, _, _,_} ->
toks(T, [backquote,string], Ack, Tack);
{_, _, true, _,_} ->
@@ -1150,9 +1152,6 @@ is_string_char(C) ->
lists:member(C, [$., $/, $:, $_, $-, $~])
end.
-is_space(C) ->
- lists:member(C, [$\s, $\n, $\t, $\r]).
-
is_special(C) ->
lists:member(C, [$=, $<, $>, $,]).
View
@@ -11,12 +11,16 @@
-module(yaws_ctl).
-author('klacke@bluetail.com').
--compile(export_all).
-include_lib("kernel/include/file.hrl").
-include("../include/yaws.hrl").
-include("../include/yaws_api.hrl").
-include("yaws_debug.hrl").
+-export([start/2, actl_trace/1]).
+-export([ls/1,hup/1,stop/1,status/1,load/1,
+ check/1,trace/1]).
+%% internal
+-export([run/1, aloop/3]).
%% assumes the appropriate file structures
View
@@ -32,11 +32,11 @@ put(SC, ARG) ->
H = ARG#arg.headers,
PPS = SC#sconf.partial_post_size,
CT =
- case yaws:lowercase(H#headers.content_type) of
+ case yaws:to_lower(H#headers.content_type) of
"multipart/form-data"++_ -> multipart;
_ -> urlencoded
end,
- SSL = yaws_server:is_ssl(SC#sconf.ssl),
+ SSL = yaws:is_ssl(SC),
FName = davpath(ARG),
CliSock = ARG#arg.clisock,
TmpName = FName ++ ".tmp",
@@ -516,7 +516,7 @@ store_chunked_client_data(Fd, CliSock, SSL) ->
_Tmp=yaws:do_recv(CliSock, 2, SSL);%% flush last crnl
true ->
B = yaws_revproxy:store_chunk(CliSock, N, 0,SSL),
- yaws_revproxy:eat_crnl(CliSock,SSL),
+ yaws:eat_crnl(CliSock,SSL),
ok = file:write(Fd, B),
store_chunked_client_data(Fd, CliSock, SSL)
end.
View
@@ -7,12 +7,22 @@
-module(yaws_debug).
-author('klacke@hyber.org').
--compile(export_all).
-
-include("../include/yaws.hrl").
-include("../include/yaws_api.hrl").
-include("yaws_debug.hrl").
+-export([typecheck/3,
+ format_record/3,
+ assert/4,
+ format/2,
+ derror/2,
+ dinfo/2,
+ mktags/0,
+ xref/1,
+ pids/0,
+ eprof/0,
+ check_headers/1, nobin/1]).
+
typecheck([{record, Rec, X} | Tail], File, Line) when atom(X),
@@ -50,7 +60,7 @@ format_record([Val|Vals], [F|Fs]) when is_integer(Val);
format_record([Val|Vals], [F|Fs]) ->
case is_string(Val) of
true ->
- [io_lib:format(" ~w = ~s\n", [F,Val]),
+ [io_lib:format(" ~w = \"~s\"\n", [F,Val]),
format_record(Vals, Fs)];
false ->
[io_lib:format(" ~w = ~p~n", [F, nobin(Val)]),
View
@@ -10,16 +10,23 @@
-include_lib("kernel/include/file.hrl").
--compile(export_all).
-%%-export([Function/Arity, ...]).
-
-behaviour(gen_server).
%% External exports
-export([start_link/0]).
%% gen_server callbacks
--export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2]).
+-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2,
+ handle_event/2]).
+-export([accesslog/5,
+ accesslog/7,
+ accesslog/8,
+ setdir/2,
+ open_trace/1,
+ trace_traffic/2,
+ authlog/4,
+ actl_trace/1]).
+
-include("../include/yaws.hrl").
-include("../include/yaws_api.hrl").
View
@@ -10,13 +10,12 @@
-module(yaws_ls).
-author('klacke@hyber.org').
--compile(export_all).
-
-include("../include/yaws.hrl").
-include("../include/yaws_api.hrl").
-include("yaws_debug.hrl").
-include_lib("kernel/include/file.hrl").
+-export([list_directory/6, out/1]).
list_directory(Arg, CliSock, List, DirName, Req, DoAllZip) ->
{abs_path, Path} = Req#http_request.path,
Oops, something went wrong.

0 comments on commit 9a74e5a

Please sign in to comment.