diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-08-04 14:27:01 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-08-04 14:27:01 +0100 |
commit | 451e7fac0b7cb6c7cb3659c8a4acceaab6125123 (patch) | |
tree | ff43cd35e8e828f7b2a39e00ecaceb6e44cd49d1 /lib/mauve/http_server.rb | |
parent | f07c5705d4ec82f4ba851409d4a92a9f66820df8 (diff) |
Added pop3 server.
--HG--
rename : lib/mauve/auth_bytemark.rb => lib/mauve/authentication.rb
Diffstat (limited to 'lib/mauve/http_server.rb')
-rw-r--r-- | lib/mauve/http_server.rb | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/mauve/http_server.rb b/lib/mauve/http_server.rb index d0ee29f..2b8d5cf 100644 --- a/lib/mauve/http_server.rb +++ b/lib/mauve/http_server.rb @@ -2,7 +2,6 @@ # # Bleuurrgggggh! Bleurrrrrgghh! # -require 'mauve/auth_bytemark' require 'mauve/web_interface' require 'mauve/mauve_thread' require 'digest/sha1' @@ -136,11 +135,13 @@ module Mauve end def main_loop - # - # Sessions are kept for 8 days. - # - @server = ::Thin::Server.new(@ip, @port, Rack::Session::Cookie.new(WebInterface.new, {:key => "mauvealert", :secret => @session_secret, :expire_after => 691200}), :signals => false) - @server.start + unless @server and @server.running? + # + # Sessions are kept for 8 days. + # + @server = ::Thin::Server.new(@ip, @port, Rack::Session::Cookie.new(WebInterface.new, {:key => "mauvealert", :secret => @session_secret, :expire_after => 691200}), :signals => false) + @server.start + end end def base_url @@ -148,8 +149,14 @@ module Mauve end def stop - @server.stop if @server + @server.stop if @server and @server.running? super end + + def join + @server.stop! if @server and @server.running? + super + end + end end |