[patch] httpd_sup.erl

Michael McDaniel erlangy@REDACTED
Tue Mar 23 02:35:04 CET 2010


 Problem:  Starting inets httpd service using proplist_file results in error as follows.

Eshell V5.7.4  (abort with ^G)
1> inets:start().
ok
2> inets:start(httpd, [{proplist_file, "priv/conf/httpd.conf"}]).
** exception error: no try clause matching 
                    {ok,[{port,8888},
                         {server_name,"httpd_test"},

                    ...

     in function  httpd_sup:httpd_config/1
     in call from httpd_sup:start_child/1
     in call from inets:call_service/3

-------------

 Patch to httpd_sup.erl :

[block]$ cat httpd_sup.erl.mcdaniel.patch 
--- /usr/local/lib/erlang/lib/inets-5.2/src/httpd_sup.erl.orig  2010-03-22 16:32:38.000000000 -0700
+++ /usr/local/lib/erlang/lib/inets-5.2/src/httpd_sup.erl       2010-03-22 16:32:55.000000000 -0700
@@ -148,7 +148,7 @@
                    httpd_conf:validate_properties(Config);
                File ->
                   try file:consult(File) of
-                      {ok, [PropList]} ->
+                      {ok, PropList} ->
                           httpd_conf:validate_properties(PropList)
                   catch 
                       exit:_ ->

-------------

 The above patch corrects the error.  Patch was created with

   diff  -u  httpd_sup.erl.orig   httpd_sup.erl  > httpd_sup.erl.mcdaniel.patch


 ~Michael

-- 
Michael McDaniel
Portland, Oregon, USA
http://trip.autosys.us


More information about the erlang-patches mailing list