Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed a number of compiler warnings and html validation errors

  • Loading branch information...
commit ca1c8b1b030ce59234764cc67d806d18c0e52b2d 1 parent 1407f5e
@karlsson karlsson authored
View
4 applications/wiki/wiki/WikiPreferences.files/template.html
@@ -28,12 +28,12 @@
</tr>
<tr>
<td>
-<p>&nbsp;<br>
+<p>&nbsp;<br /></p>
<!-- the generated page -->
<h1><a href='@@ALLREFS@@'>@@NODE@@</a></h1>
@@DATA@@
-<hr><p>Last Modified: @@MODIFIED@@
+<hr /><p>Last Modified: @@MODIFIED@@</p>
</td>
</tr>
</table>
View
2  applications/wiki/wiki/WikiPreferences.files/template_info.html
@@ -19,7 +19,7 @@
</tr>
<tr>
<td>
-<p>&nbsp;<br>
+<p>&nbsp;<br /></p>
<!-- the generated page -->
<h1>@@HEADER@@</h1>
View
2  applications/wiki/wiki/WikiPreferences.files/template_info2.html
@@ -14,7 +14,7 @@
<tbody>
<tr>
<td style="vertical-align: middle; text-align: left;">
- <table colspan="2" cellpadding="2" cellspacing="2" border="0"
+ <table cellpadding="2" cellspacing="2" border="0"
style="text-align: left; width: 100%;">
<tbody>
<tr>
View
2  src/jsonrpc.erl
@@ -46,7 +46,7 @@ call(URL, Options, Payload) ->
try
{ok, CallPayloadDeep} = encode_call_payload(Payload),
CallPayload = lists:flatten(CallPayloadDeep),
- {ok, Response} = http:request(post,
+ {ok, Response} = httpc:request(post,
{URL,[{"Content-length",length(CallPayload)}],
"application/x-www-form-urlencoded",CallPayload},
Options, []),
View
4 src/yaws_dav.erl
@@ -509,13 +509,13 @@ store_client_data(Fd, CliSock, Len, SSlBool) ->
%% not nice to support this for ssl sockets
store_chunked_client_data(Fd, CliSock, SSL) ->
yaws:setopts(CliSock, [binary, {packet, line}], SSL),
- N = yaws_revproxy:store_chunk_num(CliSock, SSL),
+ N = yaws:get_chunk_num(CliSock, SSL),
yaws:setopts(CliSock, [binary, {packet, raw}], SSL),
if
N == 0 ->
_Tmp=yaws:do_recv(CliSock, 2, SSL);%% flush last crnl
true ->
- B = yaws_revproxy:store_chunk(CliSock, N, 0,SSL),
+ B = yaws:get_chunk(CliSock, N, 0,SSL),
yaws:eat_crnl(CliSock,SSL),
ok = file:write(Fd, B),
store_chunked_client_data(Fd, CliSock, SSL)
View
11 src/yaws_debug.erl
@@ -618,11 +618,12 @@ send_inet(Sock) ->
%%
capture_io(Fun) ->
do_capture_io(Fun).
-capture_io(Fun, MilliSecTimeout) ->
- {ok, Tref} = timer:send_after(MilliSecTimeout, capio_timeout),
- Chars = do_capture_io(Fun),
- timer:cancel(Tref),
- Chars.
+
+%% capture_io(Fun, MilliSecTimeout) ->
+%% {ok, Tref} = timer:send_after(MilliSecTimeout, capio_timeout),
+%% Chars = do_capture_io(Fun),
+%% timer:cancel(Tref),
+%% Chars.
do_capture_io(Fun) ->
Pid = spawn(fun() ->
View
11 src/yaws_log.erl
@@ -17,7 +17,7 @@
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2,
- handle_event/2]).
+ handle_event/2, code_change/3]).
-export([accesslog/5,
accesslog/7,
accesslog/8,
@@ -461,6 +461,15 @@ terminate(_Reason, _State) ->
gen_event:delete_handler(error_logger, yaws_log_file_h, normal),
ok.
+
+%%----------------------------------------------------------------------
+%% Func: code_change/3
+%% Purpose: Handle upgrade
+%% Returns: new State data
+%%----------------------------------------------------------------------
+code_change(_OldVsn, Data, _Extra) ->
+ {ok, Data}.
+
%%%----------------------------------------------------------------------
%%% Internal functions
%%%----------------------------------------------------------------------
View
42 src/yaws_ls.erl
@@ -194,27 +194,27 @@ allzip() ->
["/icons/" ++ Gif,
Alt]).
-alltgz() ->
- {Gif, Alt} = list_gif(zip,""),
- ?F(" <tr>\n"
- " <td><img src=~p alt=~p/><a href=\"all.tgz\">all.tgz</a></td>\n"
- " <td></td>\n"
- " <td>-</td>\n"
- " <td>Build a gzip archive of current directory</td>\n"
- " </tr>\n",
- ["/icons/" ++ Gif,
- Alt]).
-
-alltbz2() ->
- {Gif, Alt} = list_gif(zip,""),
- ?F(" <tr>\n"
- " <td><img src=~p alt=~p/><a href=\"all.tbz2\">all.tbz2</a></td>\n"
- " <td></td>\n"
- " <td>-</td>\n"
- " <td>Build a bzip2 archive of current directory</td>\n"
- " </tr>\n",
- ["/icons/" ++ Gif,
- Alt]).
+%% alltgz() ->
+%% {Gif, Alt} = list_gif(zip,""),
+%% ?F(" <tr>\n"
+%% " <td><img src=~p alt=~p/><a href=\"all.tgz\">all.tgz</a></td>\n"
+%% " <td></td>\n"
+%% " <td>-</td>\n"
+%% " <td>Build a gzip archive of current directory</td>\n"
+%% " </tr>\n",
+%% ["/icons/" ++ Gif,
+%% Alt]).
+
+%% alltbz2() ->
+%% {Gif, Alt} = list_gif(zip,""),
+%% ?F(" <tr>\n"
+%% " <td><img src=~p alt=~p/><a href=\"all.tbz2\">all.tbz2</a></td>\n"
+%% " <td></td>\n"
+%% " <td>-</td>\n"
+%% " <td>Build a bzip2 archive of current directory</td>\n"
+%% " </tr>\n",
+%% ["/icons/" ++ Gif,
+%% Alt]).
is_user_dir(SP) ->
case SP of
View
11 src/yaws_rss.erl
@@ -20,7 +20,8 @@
-export([t_setup/0, t_exp/0, t_xopen/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,
+ code_change/3]).
-record(s, {
open_apps = [], % activated applications
@@ -263,6 +264,14 @@ handle_info(_Info, State) ->
terminate(_Reason, _State) ->
ok.
+%%----------------------------------------------------------------------
+%% Func: code_change/3
+%% Purpose: Handle upgrade
+%% Returns: new State data
+%%----------------------------------------------------------------------
+code_change(_OldVsn, Data, _Extra) ->
+ {ok, Data}.
+
%%%----------------------------------------------------------------------
%%% Internal functions
%%%----------------------------------------------------------------------
View
11 src/yaws_session_server.erl
@@ -15,7 +15,8 @@
-export([start_link/0, start/0, stop/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,
+ code_change/3]).
-include("../include/yaws_api.hrl").
-export([new_session/1,new_session/2,new_session/3,new_session/4,
@@ -248,6 +249,14 @@ handle_info(long_timeout, _State) ->
terminate(_Reason, _State) ->
ok.
+%%----------------------------------------------------------------------
+%% Func: code_change/3
+%% Purpose: Handle upgrade
+%% Returns: new State data
+%%----------------------------------------------------------------------
+code_change(_OldVsn, Data, _Extra) ->
+ {ok, Data}.
+
%%%----------------------------------------------------------------------
%%% Internal functions
%%%----------------------------------------------------------------------
View
2  src/yaws_showarg.erl
@@ -2,7 +2,7 @@
-export([out/1]).
--include_lib("yaws/include/yaws_api.hrl").
+-include("../include/yaws_api.hrl").
f(Fmt, Args) ->
io_lib:format(Fmt, Args).
View
6 src/yaws_soap_lib.erl
@@ -386,7 +386,7 @@ addSchemas([Xsd| Tail], AccModel, Prefix, Options, ImportList) ->
%%% Get a file from an URL spec.
%%% --------------------------------------------------------------------
get_url_file("http://"++_ = URL) ->
- case http:request(URL) of
+ case httpc:request(URL) of
{ok,{{_HTTP,200,_OK}, _Headers, Body}} ->
{ok, Body};
{ok,{{_HTTP,RC,Emsg}, _Headers, _Body}} ->
@@ -427,8 +427,8 @@ inets_request(URL, SoapAction, Request, Options, Headers, ContentType) ->
NHeaders
end,
NewOptions = [{cookies, enabled}|Options],
- http:set_options(NewOptions),
- case http:request(post,
+ httpc:set_options(NewOptions),
+ case httpc:request(post,
{URL,NewHeaders,
ContentType,
Request},
View
5 src/yaws_vdir.erl
@@ -2,10 +2,7 @@
-export([arg_rewrite/1]).
--include_lib("yaws/include/yaws.hrl").
--include_lib("yaws/include/yaws_api.hrl").
--include_lib("yaws/src/yaws_debug.hrl").
-
+-include_lib("../include/yaws_api.hrl").
-export([join/2]).
View
25 src/ymnesia.erl
@@ -145,9 +145,9 @@ style() ->
%%% Build the result page.
-table(Cbox, Sp, Table) when atom(Table) ->
+table(Cbox, Sp, Table) when is_atom(Table) ->
case catch ?MNESIA(table_info, [Table, attributes]) of
- Headers when list(Headers) ->
+ Headers when is_list(Headers) ->
Vp = view_pattern(Cbox, map(fun(X) -> a2l(X) end, Headers)),
{Q, Result} = do_query(Sp),
{ehtml,
@@ -262,34 +262,23 @@ get_attributes(Table) ->
max_noof_attrs() ->
foldl(fun(Table, Max) ->
- max(length(get_attributes(Table)), Max)
+ erlang:max(length(get_attributes(Table)), Max)
end, 0, get_tables()).
-max(X,Y) when X>Y -> X;
-max(X,Y) when X=< Y -> Y.
+a2l(A) when is_atom(A) -> atom_to_list(A);
+a2l(L) when is_list(L) -> L.
-a2l(A) when atom(A) -> atom_to_list(A);
-a2l(L) when list(L) -> L.
-
-l2a(L) when list(L) -> list_to_atom(L);
-l2a(A) when atom(A) -> A.
+l2a(L) when is_list(L) -> list_to_atom(L);
+l2a(A) when is_atom(A) -> A.
lk(Key, L) ->
{value, {_,Val}} = lists:keysearch(Key, 1, L),
Val.
-lk(Key, L, Default) ->
- case lists:keysearch(Key, 1, L) of
- {value, {_,Val}} -> Val;
- _ -> Default
- end.
-
t2l(L) ->
map(fun(T) -> tail(tuple_to_list(T)) end, L).
-
-
tail([]) -> [];
tail(L) -> tl(L).
View
43 www/shoppingcart/source.html
@@ -8,7 +8,7 @@
<link rel="stylesheet" type="text/css" href="style.css">
</head>
-<html>
+<body>
<h2> The source for the shopping cart </h2>
@@ -18,36 +18,37 @@
The source itself resides in the www/shoppingcart directory in the
source code tree. A <a href="shopcart.erl">link to the source itself</a> to view from
the browser.
-
+</p>
<h3> The first trick, the <tt>break</tt> statement </h3>
<p class="pp">
The source of all yaws pages (including example index.yaws)
-look very similar in this application, specifically
+look very similar in this application, specifically</p>
<div style="background: rgb(211, 211, 211)">
<pre>
-out(A) ->
+out(A) -&gt;
case shopcart:top(A) of
- ok ->
+ ok -&gt;
shopcart:index(A);
- X ->
+ X -&gt;
X
end.
+
</pre>
</div>
<p class=pp>All code, including the head containing the link
to the stylesheet is dynamically
generated. The first function in all code snippets in yaws files is always
-a call to <tt>shopcart:top(A)</tt>
+a call to <tt>shopcart:top(A)</tt></p>
<p class=pp>The <tt>top/1</tt> function will check the cookie and if a cookie
which is associated to an active session is found, the request is granted,
-otherwise the login page is displayed by the <tt>shopcart:login(A)</tt> function.
+otherwise the login page is displayed by the <tt>shopcart:login(A)</tt> function.</p>
<p class=pp>The last item displayed by the login function is the atom <tt>break</tt>. When the
yaws server sees the <tt>break</tt>, it will not process any more data from the
yaws page being requested. Thus, we can have the login call at the top of a yaws
-page and still have subsequent html/yaws code on the same page.
+page and still have subsequent html/yaws code on the same page.</p>
<h3>Redirect to the requested page</h3>
@@ -56,38 +57,36 @@
Arg of the requested page, the login function
will set the path of the requested page in a hidden field in the login form.
The code that processes the login form will then issue a redirect to the
-value of this hidden field if the login in successful.
+value of this hidden field if the login in successful.</p>
<h3>Ehtml</h3>
<p class=pp>The use of the ehtml output syntax makes it more convenient to dynamically
-generate structured content:
+generate structured content:</p>
<ul>
<li><p class=pp>
-It is easier to get the structure right,
+It is easier to get the structure right,</p></li>
<li><p class=pp>It
-is easier to inject the dynamically generated parts in the structure,
-<li><p class=pp>It is <em>much </em> more beautiful.
+is easier to inject the dynamically generated parts in the structure,</p></li>
+<li><p class=pp>It is <em>much </em> more beautiful.</p></li>
</ul>
-<p class=pp>See the <a href="shopcart.erl">source</a> for a number of "proofs" for this.
+<p class=pp>See the <a href="shopcart.erl">source</a> for a number of "proofs" for this.</p>
-<h3>The use of the <b>yaws_session_server </h3>
+<h3>The use of the <b>yaws_session_server</b> </h3>
<p class=pp>The yaws_session_server is designed to facilitate server side
state applications. The yaws application writer is supplied
-with the following capabilities and services:
+with the following capabilities and services:</p>
<ol>
<li><p class=pp>Truly random cookie generation. Each cookie can
-subsequently be used to uniquely identify a session.
+subsequently be used to uniquely identify a session.</p></li>
<li><p class=pp>Maintenance of an opaque application state in an ets table.
-This state is readily available to the yaws page by means of the cookie.
-
-<li><p class=pp>Old idle sessions are garbage collected.
+This state is readily available to the yaws page by means of the cookie.</p></li>
-</li>
+<li><p class=pp>Old idle sessions are garbage collected.</p></li>
</ol>
Please sign in to comment.
Something went wrong with that request. Please try again.