diff options
author | tradke <tradke@1faa4e14-9dd3-4be0-9f0e-ffe519881164> | 2002-01-04 13:00:56 +0000 |
---|---|---|
committer | tradke <tradke@1faa4e14-9dd3-4be0-9f0e-ffe519881164> | 2002-01-04 13:00:56 +0000 |
commit | bf0001377ee0765926ae1848ccab76f5cdb5608a (patch) | |
tree | 708237a069b1617cdf33adf88286195d7d8e7044 /src/Content.c | |
parent | af5a1374223b0bd5f5041fd9d7ca38765c1be95d (diff) |
Callback functions, which serve registered pages, take a 'const cGH *'
argument now. Also fixed a small memory leak in redirection code.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPD/trunk@145 1faa4e14-9dd3-4be0-9f0e-ffe519881164
Diffstat (limited to 'src/Content.c')
-rw-r--r-- | src/Content.c | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/src/Content.c b/src/Content.c index 4f7526d..896c25e 100644 --- a/src/Content.c +++ b/src/Content.c @@ -69,24 +69,24 @@ struct httpLink static int RegisterImages(void); -static int MainPage(cGH *cctkGH, httpRequest *request, void *data); -static int AboutPage(cGH *cctkGH, httpRequest *request, void *data); +static int MainPage(const cGH *cctkGH, httpRequest *request, void *data); +static int AboutPage(const cGH *cctkGH, httpRequest *request, void *data); -static int ShowStaticPage(cGH *cctkGH, httpRequest *request, void *data); +static int ShowStaticPage(const cGH *cctkGH, httpRequest *request, void *data); static int CompareStrings(const void *string1, const void *string2); -static int ControlPage(cGH *cctkGH, httpRequest *request, void *data); -static int ControlSet(cGH *cctkGH, httpRequest *request); -static int ControlTerminationPage(cGH *cctkGH, httpRequest *request); +static int ControlPage(const cGH *cctkGH, httpRequest *request, void *data); +static int ControlSet(const cGH *cctkGH, httpRequest *request); +static int ControlTerminationPage(const cGH *cctkGH, httpRequest *request); -static int CookieTestPage(cGH *cctkGH, httpRequest *request, void *data); +static int CookieTestPage(const cGH *cctkGH, httpRequest *request, void *data); /******************************************************************** ********************* Other Routine Prototypes ********************* ********************************************************************/ -void HTTP_ContentWork(cGH *GH); +void HTTP_ContentWork(const cGH *GH); int HTTP_RegisterPages(void); int HTTPi_RegisterGroupsPages(void); int HTTPi_RegisterThornPages(void); @@ -123,7 +123,7 @@ static const char *notauthorized_page = @endhistory @@*/ -void HTTP_ContentWork(cGH *GH) +void HTTP_ContentWork(const cGH *GH) { /* avoid compiler warning about unused parameter */ GH = GH; @@ -294,7 +294,7 @@ static int CompareStrings(const void *string1, const void *string2) @endhistory @@*/ -static int MainPage(cGH *cctkGH, httpRequest *request, void *data) +static int MainPage(const cGH *cctkGH, httpRequest *request, void *data) { DECLARE_CCTK_PARAMETERS @@ -511,18 +511,15 @@ static int MainPage(cGH *cctkGH, httpRequest *request, void *data) strcpy(message,"<li>Estimated time to completion:<UL> "); - if (cctk_final_time < cctk_initial_time) + if (cctk_final_time<cctk_initial_time) { - seconds = cctk_itlast - cctkGH->cctk_iteration; + seconds = (cctk_itlast-cctkGH->cctk_iteration)*CCTK_RunTime()/ + cctkGH->cctk_iteration; } else { - seconds = (cctk_final_time - cctkGH->cctk_time) / cctkGH->cctk_delta_time; - } - seconds *= CCTK_RunTime(); - if (cctkGH->cctk_iteration) - { - seconds /= cctkGH->cctk_iteration; + seconds = (cctk_final_time-cctkGH->cctk_time)/cctkGH->cctk_delta_time* + CCTK_RunTime()/cctkGH->cctk_iteration; } minutes = seconds/60; @@ -693,7 +690,7 @@ static int RegisterImages(void) @endhistory @@*/ -static int ShowStaticPage(cGH *cctkGH, httpRequest *request, void *data) +static int ShowStaticPage(const cGH *cctkGH, httpRequest *request, void *data) { int retval; char message[1024]; @@ -740,7 +737,7 @@ static int ShowStaticPage(cGH *cctkGH, httpRequest *request, void *data) @endhistory @@*/ -static int ControlPage(cGH *cctkGH, httpRequest *request, void *data) +static int ControlPage(const cGH *cctkGH, httpRequest *request, void *data) { DECLARE_CCTK_PARAMETERS @@ -925,7 +922,7 @@ static int ControlPage(cGH *cctkGH, httpRequest *request, void *data) @endhistory @@*/ -static int ControlSet(cGH *cctkGH, httpRequest *request) +static int ControlSet(const cGH *cctkGH, httpRequest *request) { DECLARE_CCTK_PARAMETERS char message[4098]; @@ -1094,7 +1091,7 @@ static int ControlSet(cGH *cctkGH, httpRequest *request) @endhistory @@*/ -static int ControlTerminationPage(cGH *cctkGH, httpRequest *request) +static int ControlTerminationPage(const cGH *cctkGH, httpRequest *request) { int retval; char message[4098]; @@ -1306,7 +1303,7 @@ int HTTP_ContentSendFromFile(httpRequest *request, int filedes) @calls @calledby @@*/ -static int AboutPage(cGH *cctkGH, httpRequest *request, void *data) +static int AboutPage(const cGH *cctkGH, httpRequest *request, void *data) { int retval; char message[4098]; @@ -1381,7 +1378,7 @@ static int AboutPage(cGH *cctkGH, httpRequest *request, void *data) @endhistory @@*/ -static int CookieTestPage(cGH *cctkGH, httpRequest *request, void *data) +static int CookieTestPage(const cGH *cctkGH, httpRequest *request, void *data) { int retval; char message[4098]; |