From b6727f88dd115b1176003e695182dfecd5f7d4c0 Mon Sep 17 00:00:00 2001 From: swhite Date: Mon, 19 Apr 2004 13:10:13 +0000 Subject: Addresses Cactus bug 923 Made the download list to be organized by variable, then by data output type, then by slice. To facilitate list manipulation, added temporarily a list module 'PtrList', which perhaps may prove of more general use in the future. Pursuant to Cactus bug 907 Added parameter HTTPExtra::viewport_refresh_seconds to send Refresh header to web browser. Made ViewPort window to respond to viewport_refresh_seconds parameter General HTML improvements...checked with Amaya and lynx. Re-organized CSS info in HTTPD web pages. Got rid of httpuMimeType code which didn't do anything. git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPD/trunk@195 1faa4e14-9dd3-4be0-9f0e-ffe519881164 --- src/Authorisation.c | 2 -- src/Content.c | 16 +++++++--------- src/Expression.c | 2 -- src/Groups.c | 11 +++++------ src/Headers.c | 20 ++++++-------------- src/Parameters.c | 18 ++++++++++-------- src/Redirect.c | 7 ++----- src/SString.h | 12 ++++++------ src/Server.c | 5 ----- src/Sockets.c | 3 +-- src/Startup.c | 4 ---- src/Steer.c | 2 -- src/Thorns.c | 3 +++ src/base64.c | 4 ---- src/http.c | 1 - src/httpRequest.h | 2 +- 16 files changed, 41 insertions(+), 71 deletions(-) diff --git a/src/Authorisation.c b/src/Authorisation.c index e909eec..4a91759 100644 --- a/src/Authorisation.c +++ b/src/Authorisation.c @@ -10,8 +10,6 @@ #include "cctk.h" -#include -#include #include #ifdef HAVE_UNISTD_H diff --git a/src/Content.c b/src/Content.c index b32c516..1370c2e 100644 --- a/src/Content.c +++ b/src/Content.c @@ -13,9 +13,7 @@ #include "cctk.h" -#include #include -#include #ifdef HAVE_UNISTD_H #include @@ -23,9 +21,6 @@ #include "cctk_Version.h" -#include "cctk_Parameter.h" -#include "cctk_ActiveThorns.h" - #include "util_String.h" #include "util_Network.h" @@ -35,14 +30,11 @@ #include "Steer.h" #include "Cookies.h" -#include "Content.h" - -#include "cctk_Arguments.h" #include "cctk_Parameters.h" #include "SString_Namespace.h" -#define EMPTYSTRING {'\0'} +#include "Content.h" static const char *rcsid = "$Header$"; @@ -399,6 +391,9 @@ static int MainPage(const cGH *cctkGH, httpRequest *request, void *data) HTTP_Send(request, "Running CACTUS Status Information\n"); HTTP_SetHeadInfo( message); HTTP_SendString(request, message ); + HTTP_Send(request, "\n"); HTTP_Send(request, "\n\n"); /* Write out the main header part */ @@ -857,6 +852,9 @@ static int ControlPage(const cGH *cctkGH, httpRequest *request, void *data) HTTP_SetHeadInfo( message); HTTP_SendString(request, message ); + HTTP_Send(request, "\n" ); HTTP_Send(request, "\n\n"); diff --git a/src/Expression.c b/src/Expression.c index 883efb2..82b2e30 100644 --- a/src/Expression.c +++ b/src/Expression.c @@ -12,8 +12,6 @@ #include "cctk.h" #endif -#include -#include #include #include "Expression.h" diff --git a/src/Groups.c b/src/Groups.c index b16ff8a..a12269b 100644 --- a/src/Groups.c +++ b/src/Groups.c @@ -8,14 +8,8 @@ @version $Header$ @@*/ -#include -#include -#include - #include "cctk.h" -#include "util_String.h" - #include "httpRequest.h" #include "Content.h" @@ -118,6 +112,11 @@ static int GroupsPage(const cGH *cctkGH, httpRequest *request, void *data) HTTP_SetHeadInfo( message); HTTP_SendString(request, message ); + HTTP_Send(request,"\n"); + HTTP_Send(request,"\n\n"); /* HTTP_Write out the header part. */ diff --git a/src/Headers.c b/src/Headers.c index 97b50e9..f24ac49 100644 --- a/src/Headers.c +++ b/src/Headers.c @@ -56,6 +56,9 @@ static const char *cactus_styles = " a:link { color: #1B831D; }\n" " a:visited { color: #768000; }\n" " a:active { color: green; }\n" +" div.centered { text-align: center; } \n" +" div.centered table { margin: auto; } \n" +" span.hilite { color: red; } \n" " td.menu { color: black; background-color: #E5FFA2; \n" " text-align: left; vertical-align: top; width: 20ex; \n" " font-size: small; }\n" @@ -65,25 +68,12 @@ static const char *cactus_styles = " margin-top: 1.2em; margin-bottom: 0; } \n" " td.menu span.simulation_name { font-style: italic; } \n" " td.menu kbd { font-family: monospace; font-style: normal; } \n" -" .controls td { text-align: left; vertical-align: middle; } \n" -" .params th { text-align: right; } \n" -" .params td { text-align: center; vertical-align: middle; } \n" -" .params td.description { font-size: small; } \n" -" table.groups { background-color: #E9F4D3; } \n" -" .groups td { text-align: left; } \n" -" .paramtable td { text-align: left; vertical-align: middle; } \n" -" .paramtable td.description { font-size: small; } \n" -" .thornparams th { text-align: right; } \n" -" .thorns td { text-align: left; } \n" " .footer td { font-size: small; vertical-align: top; } \n" " .footer td.by { text-align: right; } \n" " .footer img { border: 0; } \n" -" div.banner, div.centered { text-align: center; } \n" +" div.banner { text-align: center; } \n" " div.banner table { margin: auto; } \n" " div.banner img { border: 0; } \n" -" div.centered table { margin: auto; } \n" -" td.authenticate { text-align: center; background-color: #E5FFA2; }\n" -" span.hilite { color: red; } \n" "\n"; static const char *cactus_footer = @@ -114,6 +104,8 @@ static const char * cactus_doctype = void HTTP_SetHeadInfo( String *header) { SetToCString( header, cactus_styles ); + ConcatCString( header, "\n"); } void HTTP_SetDoctype( String *header) { diff --git a/src/Parameters.c b/src/Parameters.c index 084a27e..c195fc7 100644 --- a/src/Parameters.c +++ b/src/Parameters.c @@ -17,23 +17,17 @@ #include "cctk.h" -#include "cctk_Parameter.h" -#include "cctk_ActiveThorns.h" - #include "util_String.h" #include "httpRequest.h" #include "Auth.h" #include "Steer.h" -#include "Cookies.h" #include "Content.h" -#include "cctk_Arguments.h" #include "cctk_Parameters.h" -#include "SStringHTML.h" #include "SString_Namespace.h" #include "SStringHTML_Namespace.h" @@ -358,10 +352,15 @@ static int ThornParameterPage(const cGH *cctkGH, httpRequest *request, void *dat HTTP_SetHeadInfo( message); HTTP_SendString(request, message ); - Truncate( message, 0 ); + + HTTP_Send(request, " \n"); HTTP_Send(request, "\n\n"); + Truncate( message, 0 ); if (CCTK_NumCompiledThorns()>0) { @@ -758,10 +757,13 @@ static int ParameterPage(const cGH *cctkGH, httpRequest *request, void *data) HTTP_SetHeadInfo( message); HTTP_SendString(request, message ); - Truncate( message, 0 ); + HTTP_Send(request, "\n"); HTTP_Send(request,"\n\n"); + Truncate( message, 0 ); /* Menu for this page */ first = 1; diff --git a/src/Redirect.c b/src/Redirect.c index 5502e5c..ced0287 100644 --- a/src/Redirect.c +++ b/src/Redirect.c @@ -8,10 +8,6 @@ @version $Id$ @@*/ -#include -#include -#include - #include "cctk.h" #ifdef CCTK_MPI @@ -114,7 +110,8 @@ int HTTP_SetupRedirect(int port, #ifdef HTTPD_DEBUG printf("alladdr is %s\n", alladdr); #endif - strcpy(httpmaster,alladdr); /* the 0th element is the master hostname */ + strncpy(httpmaster,alladdr, sizeof(httpmaster)); /* the 0th element is the master hostname */ + httpmaster[sizeof(httpmaster) - 1] = '\0'; /* so compare my addr to the list sequentially */ for(i=0;i -#ifdef __cplusplus -extern "C" -{ -#endif typedef struct String_tag String; /* The abstract type for a String */ -typedef char SSCHAR; /* but could be Unicode */ +typedef char SSCHAR; /* Could be Unicode... */ typedef enum { SSFALSE, SSTRUE } SSBOOL; +#ifdef __cplusplus +extern "C" +{ +#endif /* String creation and deletion */ String *String_New( void ); String *String_Copy( const String *other ); diff --git a/src/Server.c b/src/Server.c index dee7f10..4f7a9b4 100644 --- a/src/Server.c +++ b/src/Server.c @@ -8,16 +8,11 @@ @version $Header$ @@*/ -#include #include #include #include "cctk.h" -#include "cctk_Constants.h" -#include "cctk_Groups.h" -#include "cctk_GroupsOnGH.h" -#include "cctk_Parameter.h" #include "cctk_Parameters.h" #include "util_Hash.h" diff --git a/src/Sockets.c b/src/Sockets.c index b080ed0..7857df2 100644 --- a/src/Sockets.c +++ b/src/Sockets.c @@ -15,7 +15,6 @@ #include "util_Network.h" #include "SocketUtils.h" -#include #include #include #include @@ -226,7 +225,7 @@ int HTTP_Poll(cGH *cctkGH, long sec, long usec) fd_set read_fd_set = active_fd_set; struct sockaddr_in clientname; struct timeval timeout; - httpSocket *this, *next; + httpSocket *this; timeout.tv_sec = sec; diff --git a/src/Startup.c b/src/Startup.c index 1ca6bef..108eb3d 100644 --- a/src/Startup.c +++ b/src/Startup.c @@ -14,10 +14,6 @@ #include #endif -#include -#include - -#include "cctk_Parameter.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" diff --git a/src/Steer.c b/src/Steer.c index 4d2c379..ed87922 100644 --- a/src/Steer.c +++ b/src/Steer.c @@ -17,8 +17,6 @@ #include #endif -#include -#include #include #ifdef CCTK_MPI diff --git a/src/Thorns.c b/src/Thorns.c index b7c8463..2577418 100644 --- a/src/Thorns.c +++ b/src/Thorns.c @@ -131,6 +131,9 @@ static int ThornMainPage(const cGH *cctkGH, httpRequest *request, void *data) HTTP_SetHeadInfo( message); HTTP_SendString(request, message ); + HTTP_Send(request,"\n"); HTTP_Send(request,"\n\n"); /* HTTP_SendString out the header part. */ diff --git a/src/base64.c b/src/base64.c index 842ceb7..f209acf 100644 --- a/src/base64.c +++ b/src/base64.c @@ -54,12 +54,8 @@ * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#include #include -#include - -#include #include #define Assert(Cond) if (!(Cond)) abort() diff --git a/src/http.c b/src/http.c index fface5f..c9cdd4d 100644 --- a/src/http.c +++ b/src/http.c @@ -11,7 +11,6 @@ #include "cctk.h" #include "cctk_Parameters.h" -#include #include #ifdef HAVE_SYS_TIME_H diff --git a/src/httpRequest.h b/src/httpRequest.h index ebfa9d9..fe1c0eb 100644 --- a/src/httpRequest.h +++ b/src/httpRequest.h @@ -53,8 +53,8 @@ const char * HTTP_Arg_Name( const httpArg *arg ); const char * HTTP_Arg_Value( const httpArg *arg ); #ifdef __cplusplus } - #endif + #include "httpSString.h" #endif /* __HTTP_REQUEST_H__ */ -- cgit v1.2.3