aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/http_server.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mauve/http_server.rb')
-rw-r--r--lib/mauve/http_server.rb21
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