aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--par/http.par4
-rw-r--r--param.ccl14
-rw-r--r--src/Server.c4
-rw-r--r--src/Startup.c11
-rw-r--r--src/httpd.h2
5 files changed, 16 insertions, 19 deletions
diff --git a/par/http.par b/par/http.par
index ef09a0f..27952c2 100644
--- a/par/http.par
+++ b/par/http.par
@@ -1,4 +1,6 @@
ActiveThorns = "httpd"
httpd::port = 5555
-httpd::standalone = 1
+httpd::pause = 1
+
+httpd::provide_pages = 1
diff --git a/param.ccl b/param.ccl
index 6391c8a..718d530 100644
--- a/param.ccl
+++ b/param.ccl
@@ -16,15 +16,17 @@ INT steering_frequency "How many iterations between steering events" STEERABLE =
0: :: "Any number, 0 means don't steer"
} 1
+# Switching this off means all pages must be provided by other thorns.
BOOLEAN provide_pages "Should the server provide any pages ?"
{
} "yes"
-BOOLEAN standalone "Should the server poll continuously in startup" STEERABLE = ALWAYS
+# Setting this to true in the parameter file will start the simulation paused.
+BOOLEAN pause "Pause ?" STEERABLE = ALWAYS
{
} "no"
-
+##################################################################
# Tuning parameters
INT timeout_seconds "Polling timeout seconds" STEERABLE = ALWAYS
@@ -42,12 +44,8 @@ INT queue_length "Listen queue length"
1: :: "Any positive number"
} 4
-
-# You probably don't want to set these in a parameter file
-
-BOOLEAN pause "Pause ?" STEERABLE = ALWAYS
-{
-} "no"
+###################################################################
+# You probably don't want to set this in a parameter file
BOOLEAN terminate "Kill the simulation ?" STEERABLE = ALWAYS
{
diff --git a/src/Server.c b/src/Server.c
index dc9aaca..ba6f071 100644
--- a/src/Server.c
+++ b/src/Server.c
@@ -274,10 +274,6 @@ int HTTP_UpdateState(cGH *cctkGH, httpState *state)
state->terminate = *value;
- value = (CCTK_INT *)CCTK_ParameterGet("standalone",CCTK_THORNSTRING, &type);
-
- state->standalone = *value;
-
if(!state->paused)
{
diff --git a/src/Startup.c b/src/Startup.c
index 8fe2264..8772d86 100644
--- a/src/Startup.c
+++ b/src/Startup.c
@@ -56,11 +56,11 @@ int HTTP_Startup(void)
HTTP_UpdateState(NULL, &state);
- while(state.standalone)
+ do
{
if(CCTK_MyProc(NULL) == 0)
{
- HTTP_Poll(NULL, -1,-1);
+ HTTP_Poll(NULL, -1, -1);
}
if(state.steer == 1)
@@ -73,9 +73,10 @@ int HTTP_Startup(void)
if(state.terminate)
{
HTTP_Terminate(NULL);
- }
- }
-
+ }
+
+ } while(state.paused);
+
return 0;
}
diff --git a/src/httpd.h b/src/httpd.h
index e6c6e3f..522f0f5 100644
--- a/src/httpd.h
+++ b/src/httpd.h
@@ -20,7 +20,6 @@ typedef struct
int terminate;
int timeout_seconds;
int timeout_useconds;
- int standalone;
} httpState;
#ifdef __cplusplus
@@ -42,6 +41,7 @@ int HTTP_RequestUnsupported(cGH *cctkGH, httpRequest *request);
/* State stuff */
int HTTP_UpdateState(cGH *cctkGH, httpState *state);
+int HTTP_Terminate(cGH *cctkGH);
#ifdef __cplusplus
}