From: Ian <ya...@po...> - 2014-06-24 22:16:35
|
I've just discovered that my errormod_404 has stopped working with the latest yaws (1.98) and erlang (R16B01 and 17). No error message or crash, browser just sits there, waiting. Any ideas? Here is the code (it used to work fine): -module(err_php). -include("/usr/local/lib/yaws/include/yaws.hrl"). -include("/usr/local/lib/yaws/include/yaws_api.hrl"). -export([out404/1, out404/3, crashmsg/3]). %% This module redirects requests for non-existent resources to err.php %% per server with errormod_404 = err_php %% Note that the 404 header is elminated so it must be generated in err.php if required out404(Arg) -> out404(Arg, get(gc), get(sc)). out404(Arg, GC, SC) -> yaws_cgi:call_cgi(Arg, element(2,SC#sconf.php_handler), lists:flatten(Arg#arg.docroot) ++ "/err.php"). %% The function below is for displaying crash messages in the browser, %% It should probably be disabled on production server %% Note that it can only return an {ehtml, EH} or an {html, HTML} value, no status codes, no headers etc. crashmsg(_Arg, _SC, L) -> {ehtml, [{h2, [], "Internal error, yaws code crashed"}, {br}, {hr}, {pre, [], L}, {hr}]}. |