From 59fa698967b5483bd7faa027560923f216358ebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20R=C3=A9mond?= Date: Thu, 26 Jul 2007 10:08:41 +0000 Subject: [PATCH] * src/mod_offline.erl: Code clean-up. SVN Revision: 832 --- ChangeLog | 2 ++ src/mod_offline.erl | 24 ++++++++++-------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index dcdad2ae2..c7758a58f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2007-07-26 Mickael Remond + * src/mod_offline.erl: Code clean-up. + * src/gen_mod.erl: Throw error more cleanly. * src/mod_configure.erl: One ACL call was not virtual host diff --git a/src/mod_offline.erl b/src/mod_offline.erl index 0f5f89935..b9fde8833 100644 --- a/src/mod_offline.erl +++ b/src/mod_offline.erl @@ -171,20 +171,16 @@ find_x_expire(TimeStamp, [{xmlcdata, _} | Els]) -> find_x_expire(TimeStamp, [El | Els]) -> case xml:get_tag_attr_s("xmlns", El) of ?NS_EXPIRE -> - case xml:get_tag_attr_s("seconds", El) of - Val -> - case catch list_to_integer(Val) of - {'EXIT', _} -> - never; - Int when Int > 0 -> - {MegaSecs, Secs, MicroSecs} = TimeStamp, - S = MegaSecs * 1000000 + Secs + Int, - MegaSecs1 = S div 1000000, - Secs1 = S rem 1000000, - {MegaSecs1, Secs1, MicroSecs}; - _ -> - never - end; + Val = xml:get_tag_attr_s("seconds", El), + case catch list_to_integer(Val) of + {'EXIT', _} -> + never; + Int when Int > 0 -> + {MegaSecs, Secs, MicroSecs} = TimeStamp, + S = MegaSecs * 1000000 + Secs + Int, + MegaSecs1 = S div 1000000, + Secs1 = S rem 1000000, + {MegaSecs1, Secs1, MicroSecs}; _ -> never end;