check that webserver is stopped before starting
authorDuncan Mac-Vicar P <dmacvicar@suse.de>
Tue, 24 Feb 2009 23:34:13 +0000 (00:34 +0100)
committerDuncan Mac-Vicar P <dmacvicar@suse.de>
Tue, 24 Feb 2009 23:34:13 +0000 (00:34 +0100)
tests/lib/WebServer.cc

index 030c6f0..4a215ed 100644 (file)
@@ -160,6 +160,12 @@ public:
     
     virtual void start()
     {
+        if ( ! _stopped )
+        {
+            MIL << "mongoose server already running, stopping." << endl;
+            stop();
+        }
+        
         MIL << "Starting shttpd (mongoose)" << endl;
         _log.clear();
         _ctx = mg_start();