Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

""

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@245 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
commit 281a3ca91550a3889511564b818bb973a3ac618a 1 parent 821ad7a
@klacke authored
Showing with 8 additions and 6 deletions.
  1. +4 −2 src/yaws_404.erl
  2. +4 −4 src/yaws_server.erl
View
6 src/yaws_404.erl
@@ -13,13 +13,15 @@
-include("../include/yaws_api.hrl").
%% The default error 404 error delivery module
+%% This function can be used to generate
+%% a special page on 404's (it doesn't even have to be a 404)
-out(Arg, GC, SC) ->
+
+out404(Arg, GC, SC) ->
yaws_api:set_status_code(404),
Req = Arg#arg.req,
{abs_path, Path} = Req#http_request.path,
B = not_found_body(Path, GC, SC),
- io:format("In 404 \n",[]),
{html, B}.
View
8 src/yaws_server.erl
@@ -985,7 +985,7 @@ handle_ut(CliSock, GC, SC, Req, H, ARG, UT, N) ->
DCC = req_to_dcc(Req),
make_dyn_headers(DCC, Req),
- do_appmod(SC#sconf.errormod_404, CliSock, GC, SC,
+ do_appmod(SC#sconf.errormod_404, out404, CliSock, GC, SC,
Req, H, [A2, GC, SC], UT, N);
directory ->
P = UT#urltype.dir,
@@ -1006,7 +1006,7 @@ handle_ut(CliSock, GC, SC, Req, H, ARG, UT, N) ->
{Mod, PathData} = UT#urltype.data,
A2 = ARG#arg{appmoddata = PathData,
querydata = UT#urltype.q},
- do_appmod(Mod, CliSock, GC, SC, Req, H, [A2], UT, N)
+ do_appmod(Mod, out, CliSock, GC, SC, Req, H, [A2], UT, N)
end.
@@ -1173,9 +1173,9 @@ get_client_data(_CliSock, all, eof, _GC, _) ->
-do_appmod(Mod, CliSock, GC, SC, Req, H, ARG, UT, N) ->
+do_appmod(Mod, FunName, CliSock, GC, SC, Req, H, ARG, UT, N) ->
DCC = req_to_dcc(Req),
- case yaws_call(DCC, 0, "appmod", Mod, out, ARG, GC,SC, N) of
+ case yaws_call(DCC, 0, "appmod", Mod, FunName, ARG, GC,SC, N) of
{streamcontent, MimeType, FirstChunk} ->
put(content_type, MimeType),
accumulate_chunk(DCC, FirstChunk),
Please sign in to comment.
Something went wrong with that request. Please try again.