tienlx
unread,May 10, 2008, 6:18:10 AM5/10/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to MochiWeb
Hi all,
I encountered a problem when server static file.
=CRASH REPORT==== 10-May-2008::16:35:56 ===
crasher:
pid: <0.55.0>
registered_name: []
exception error: bad argument
in function erlang:universaltime_to_localtime/1
called as erlang:universaltime_to_localtime({{1969,12,31},
{23,59,59}})
in call from calendar:local_time_to_universal_time_dst/1
in call from httpd_util:rfc1123_date/1
in call from mochiweb_request:serve_file/3
in call from mochiweb_http:headers/4
initial call:
mochiweb_socket_server:acceptor_loop({<0.54.0>,#Port<0.123>,
#Fun<mochiweb_http.1.62821608>})
So I tried file:read_file_info/1 function and have result below:
> file:read_file_info("/home/ti/erlang/web/test/priv/www/index.html").
{ok,{file_info,88,regular,read_write,
{{2008,5,10},{16,14,15}},
{{2008,5,10},{18,36,56}},
{{2008,5,10},{18,36,56}},
33188,1,98,14518194,3630455,1001,1001}}
ok, its mtime is {{2008,5,10},{18,36,56}}. And i continue with:
8> httpd_util:rfc1123_date({{2008,5,10},{18,36,56}}).
** exception error: bad argument
in function erlang:universaltime_to_localtime/1
called as erlang:universaltime_to_localtime({{1969,12,31},
{23,59,59}})
in call from calendar:local_time_to_universal_time_dst/1
in call from httpd_util:rfc1123_date/1
It seem rfc1123_date/1 doesn't accept any date I given:
9> httpd_util:rfc1123_date({{2009,5,10},{18,36,56}}).
** exception error: bad argument
in function erlang:universaltime_to_localtime/1
called as erlang:universaltime_to_localtime({{1969,12,31},
{23,59,59}})
in call from calendar:local_time_to_universal_time_dst/1
in call from httpd_util:rfc1123_date/1
10> httpd_util:rfc1123_date({{2009,5,3},{8,6,3}}).
** exception error: bad argument
in function erlang:universaltime_to_localtime/1
called as erlang:universaltime_to_localtime({{1969,12,31},
{23,59,59}})
in call from calendar:local_time_to_universal_time_dst/1
in call from httpd_util:rfc1123_date/1
I current use Freebsd 7.0. Don't know what happen, it'd worked great
before.
Any opinion?
Regards,
Tien