{ "thorn_name": "CactusConnect/HTTPD", "url": "https://bitbucket.org/cactuscode/cactusconnect.git", "configuration": "# Configuration definitions for thorn HTTPD\n# $Header$\n\nREQUIRES SOCKET\n\n# This will disappear if we can function alias the stuff\nPROVIDES HTTPD\n{\n SCRIPT\n LANG\n}\n\nOPTIONAL MPI\n{\n}\n\nOPTIONAL PTHREADS\n{\n}\n", "interface": "# Interface definition for thorn HTTPD\n# $Header$\n\nImplements: HTTPD\nInherits: Socket\n\nUSES INCLUDE HEADER: SocketUtils.h\n\nINCLUDE HEADER: Auth.h in http_Auth.h\nINCLUDE HEADER: Cookies.h in http_Cookies.h\nINCLUDE HEADER: Steer.h in http_Steer.h\nINCLUDE HEADER: Content.h in http_Content.h\n\nCCTK_INT FUNCTION Send_Twitter_Msg(CCTK_STRING IN msg)\nUSES FUNCTION Send_Twitter_Msg\n\n", "param": "# Parameter definitions for thorn HTTPD\n# $Header$\n\nshares: Cactus\n\nUSES REAL cctk_final_time \n\nUSES REAL cctk_initial_time \n\nUSES INT cctk_itlast \n\nprivate:\n\n# Probably the most useful parameter\n\nINT port \"HTTP port number to use (can be overridden by shell variable HTTPD_PORT)\"\n{\n 1:65535 :: \"Any valid port\"\n} 5555\n\n# If you desperately need to set the port number by hand, turn hunting off.\nBOOLEAN hunt \"Should the server hunt for a port if the specified one is taken ?\"\n{\n} \"yes\"\n\n# This allows you to control the number of times all procs need to synchronise parameters\nINT steering_frequency \"How many iterations between steering events\" STEERABLE = ALWAYS\n{\n 0: :: \"Any number, 0 means don't steer\"\n} 1\n\n# Switching this off means all pages must be provided by other thorns.\nBOOLEAN provide_pages \"Should the server provide any pages ?\"\n{\n} \"yes\"\n\n# Setting this to true in the parameter file will start the simulation paused.\nBOOLEAN pause \"Pause ?\" STEERABLE = ALWAYS\n{\n} \"no\"\n\n# Username and password for controlling cactus\nSTRING user \"The username for Cactus Control \"\n{\n \".+\" :: \"Any name of one or more characters\"\n} \"anon\"\n\nSTRING password \"The password for Cactus Control\"\n{\n \".*\" :: \"Any password\"\n} \"anon\"\n\nKEYWORD encryption_scheme \"How the password is encrypted\"\n{\n \"none\" :: \"Not encrypted\"\n \"crypt\" :: \"crypt(3) (standard UNIX passwd format)\"\n} \"none\"\n\nBOOLEAN use_pthreads \"Use a threaded implementation if possible ?\"\n{\n} \"yes\"\n\nBOOLEAN verbose \"Print information about HTTP requests\" STEERABLE = ALWAYS\n{\n} \"no\"\n\n##################################################################\n# Tuning parameters\n\nINT timeout_seconds \"Polling timeout seconds\" STEERABLE = ALWAYS\n{\n 0: :: \"Any whole number\"\n} 0\n\nINT timeout_useconds \"Polling timeout micro-seconds\" STEERABLE = ALWAYS\n{\n 0: :: \"Any whole number\"\n} 0\n\nINT queue_length \"Listen queue length\"\n{\n 1: :: \"Any positive number\"\n} 4\n\nINT refresh_seconds \"Page refresh time seconds\" STEERABLE = ALWAYS\n{\n -1: :: \"-1 for no refresh, 0 for immediate refresh\"\n} -1\n\n###################################################################\n# You probably don't want to set this in a parameter file \n\nBOOLEAN terminate \"Kill the simulation ?\" STEERABLE = ALWAYS\n{\n} \"no\"\n\n###################################################################\n# Dynamic control\n\n\nBOOLEAN single_step \"Do one step then pause ?\" STEERABLE = ALWAYS\n{\n} \"no\"\n\n# Iterate until\n\nBOOLEAN until_it_active \"Use until_it parameter ?\" STEERABLE = ALWAYS\n{\n} \"no\"\n\nINT until_it \"Pause at this iteration\" STEERABLE = ALWAYS\n{\n : :: \"Any iteration\"\n} 0 \n\n# Run until\n\nBOOLEAN until_time_active \"Use until_time parameter ?\" STEERABLE = ALWAYS\n{\n} \"no\"\n\nREAL until_time \"Pause after this simulation time\" STEERABLE = ALWAYS\n{\n : :: \"Any time\"\n} 0\n\n# Run until expression\n\nBOOLEAN until_expression_active \"Use until_expression parameter ?\" STEERABLE = ALWAYS\n{\n} \"no\"\n\nSTRING until_expression \"Pause if this expression evaluates to true.\" STEERABLE = ALWAYS\n{\n \".*\" :: \"Any expression\"\n} \"iteration+40 < time*100\"\n", "schedule": "# Schedule definitions for thorn HTTPD\n# $Header$\n\nSCHEDULE GROUP HTTP_Startup AT startup\n{\n OPTIONS: GLOBAL\n} \"HTTP daemon startup group\"\n\nSCHEDULE HTTP_StartServer in HTTP_Startup\n{\n LANG: C\n OPTIONS: GLOBAL\n} \"Start HTTP server\"\n\nSCHEDULE GROUP HTTP_SetupPages in HTTP_Startup AFTER HTTP_StartServer\n{\n} \"Group to setup stuff which needs to be done between starting the server and the first time it serves pages\"\n\nSCHEDULE HTTP_FirstServ in HTTP_Startup AFTER HTTP_SetupPages\n{\n LANG: C\n OPTIONS: GLOBAL\n} \"Serve first pages at startup\"\n\nSCHEDULE HTTP_Work AT poststep BEFORE IOUtil_UpdateParFile\n{\n LANG: C\n OPTIONS: GLOBAL\n} \"Working routine\"\n\nif(provide_pages)\n{\n SCHEDULE HTTP_ContentWork AT poststep\n {\n LANG: C\n OPTIONS: GLOBAL\n } \"Content Working routine\"\n}\n\nSCHEDULE HTTP_Shutdown AT shutdown\n{\n LANG: C\n OPTIONS: GLOBAL\n} \"HTTP daemon shutdown\"\n", "src": { "SStringHTML_Namespace.h": " /*@@\n @file SStringHTMLNamespace.h\n @date 02.04.2004\n @author Steve White\n @desc Extension to Strings module with function specific to HTML\n @enddesc\n @version $Header$\n @@*/\n#ifndef _SSTRINGHTML_NAMESPACE_H\n#define _SSTRINGHTML_NAMESPACE_H\n\n#include \"SStringHTML.h\"\n\n\n#define EncodeHTML( s ) \\\n\t\tStringEncodeHTML( s )\n#define SetToEncodedHTMLCString( s, c ) \\\n\t\tStringSetToEncodedHTMLCString( s, c )\n\n#endif\n", "make.code.defn": "# Main make.code.defn file for thorn httpd\n# $Header$\n\n# Source files in this directory\n\nMISC_SRC = Startup.c Expression.c Map.cc\n\nSERVER_SRC = Server.c Sockets.c http.c\n\nCONTENT_SRC = Content.c Headers.c Groups.c Parameters.c Thorns.c\n\nSTEERING_SRC = Steer.c\n\nAUTHENTICATION_SRC = Authorisation.c base64.c \n\nCOOKIES_SRC = Cookies.c\n\nREDIRECTION_SRC = Redirect.c\n\nSTRINGS_SRC = SString.c SStringHTML.c\n\nSRCS = $(MISC_SRC) \\\n $(SERVER_SRC) \\\n $(CONTENT_SRC) \\\n $(STEERING_SRC) \\\n $(AUTHENTICATION_SRC) \\\n $(COOKIES_SRC) \\\n $(REDIRECTION_SRC) \\\n $(STRINGS_SRC)\n\n", "httpd_Map.h": "#ifndef HTTPD_MAP_H_\n#define HTTPD_MAP_H_ 1\n\n#include \n\n#if __cplusplus\nextern \"C\" {\n#define VOID\n#else\n#define VOID void\n#endif\n\ntypedef void * uMap;\n\nuMap Httpd_MapCreate(VOID);\nvoid * Httpd_MapData(uMap map, size_t keylen, const char * key);\nint Httpd_MapStore(uMap map, size_t keylen, const char * key, void * data);\nvoid Httpd_MapDestroy(uMap map, void (*destroy)(void *));\n\n#if __cplusplus\n}\n#endif\n\n#endif\n", "Map.cc": "#include \n#include \n\n#include \"httpd_Map.h\"\n\ntypedef std::map iMap;\n\nextern \"C\" {\n\nuMap Httpd_MapCreate(void)\n{\n return new iMap;\n}\n\nvoid * Httpd_MapData(uMap map, size_t keylen, const char * key)\n{\n iMap& imap(*static_cast(map));\n const std::string ikey(key, keylen);\n iMap::iterator it(imap.find(ikey));\n\n if(it != imap.end())\n return it->second;\n else\n return NULL;\n}\n\nint Httpd_MapStore(uMap map, size_t keylen, const char * key, void * data)\n{\n iMap& imap(*static_cast(map));\n const std::string ikey(key, keylen);\n iMap::iterator it(imap.find(ikey));\n\n if(it != imap.end())\n it->second = data;\n else\n imap[ikey] = data;\n\n return 0;\n}\n\nvoid Httpd_MapDestroy(uMap map, void (*destroy)(void *))\n{\n iMap& imap(*static_cast(map));\n for(iMap::iterator it = imap.begin() ; it != imap.end() ; ++it)\n destroy(it->second);\n delete &imap;\n}\n\n}\n", "httpSString.h": " /*@@\n @header http_SString.h\n @date April 7 14:19:23 2004\n @author Steve White\n @desc \n Routines exported by the Content stuff.\n @enddesc\n @version $Header$\n @@*/\n\n#ifndef __HTTP_SSTRING_H__\n#define __HTTP_SSTRING_H__ 1\n\n#include \"SString.h\"\n\n#define EMPTYSTRING {'\\0'}\n\n#ifdef __cplusplus\nextern \"C\" \n{\n#endif\n\nint HTTP_SendString(httpRequest *request, const String* message);\nSSBOOL HTTP_GetHeaderValueString(const httpRequest *request,\n const String *header, String *value);\n#ifdef __cplusplus\n}\n#endif\n\n#endif \n", "base64.c": " /*@@\n @file base64.c\n @date 1995\n @author Various people, see below.\n @desc \n \n @enddesc\n @history \n @hdate Fri Sep 15 14:32:47 2000 @hauthor Tom Goodale\n @hdesc Put into the httpd thorn. \n @endhistory \n\n @version $Header$\n @@*/\n/*\n * Copyright (c) 1996 by Internet Software Consortium.\n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS\n * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE\n * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL\n * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR\n * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS\n * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\n * SOFTWARE.\n */\n\n/*\n * Portions Copyright (c) 1995 by International Business Machines, Inc.\n *\n * International Business Machines, Inc. (hereinafter called IBM) grants\n * permission under its copyrights to use, copy, modify, and distribute this\n * Software with or without fee, provided that the above copyright notice and\n * all paragraphs of this notice appear in all copies, and that the name of IBM\n * not be used in connection with the marketing of any product incorporating\n * the Software or modifications thereof, without specific, written prior\n * permission.\n *\n * To the extent it has a right to do so, IBM grants an immunity from suit\n * under its patents, if any, for the use, sale or manufacture of products to\n * the extent that such products are used for performing Domain Name System\n * dynamic updates in TCP/IP networks by means of the Software. No immunity is\n * granted for any product per se or for any other function of any product.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", AND IBM DISCLAIMS ALL WARRANTIES,\n * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,\n * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING\n * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN\n * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.\n */\n\n\n#include \n#include \n#include \n#include \n\n#define Assert(Cond) if (!(Cond)) abort()\n\n#include \"base64.h\"\n\nstatic const char Base64[] =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\nstatic const char Pad64 = '=';\n\n/* (From RFC1521 and draft-ietf-dnssec-secext-03.txt)\n The following encoding technique is taken from RFC 1521 by Borenstein\n and Freed. It is reproduced here in a slightly edited form for\n convenience.\n\n A 65-character subset of US-ASCII is used, enabling 6 bits to be\n represented per printable character. (The extra 65th character, \"=\",\n is used to signify a special processing function.)\n\n The encoding process represents 24-bit groups of input bits as output\n strings of 4 encoded characters. Proceeding from left to right, a\n 24-bit input group is formed by concatenating 3 8-bit input groups.\n These 24 bits are then treated as 4 concatenated 6-bit groups, each\n of which is translated into a single digit in the base64 alphabet.\n\n Each 6-bit group is used as an index into an array of 64 printable\n characters. The character referenced by the index is placed in the\n output string.\n\n Table 1: The Base64 Alphabet\n\n Value Encoding Value Encoding Value Encoding Value Encoding\n 0 A 17 R 34 i 51 z\n 1 B 18 S 35 j 52 0\n 2 C 19 T 36 k 53 1\n 3 D 20 U 37 l 54 2\n 4 E 21 V 38 m 55 3\n 5 F 22 W 39 n 56 4\n 6 G 23 X 40 o 57 5\n 7 H 24 Y 41 p 58 6\n 8 I 25 Z 42 q 59 7\n 9 J 26 a 43 r 60 8\n 10 K 27 b 44 s 61 9\n 11 L 28 c 45 t 62 +\n 12 M 29 d 46 u 63 /\n 13 N 30 e 47 v\n 14 O 31 f 48 w (pad) =\n 15 P 32 g 49 x\n 16 Q 33 h 50 y\n\n Special processing is performed if fewer than 24 bits are available\n at the end of the data being encoded. A full encoding quantum is\n always completed at the end of a quantity. When fewer than 24 input\n bits are available in an input group, zero bits are added (on the\n right) to form an integral number of 6-bit groups. Padding at the\n end of the data is performed using the '=' character.\n\n Since all base64 input is an integral number of octets, only the\n -------------------------------------------------\n following cases can arise:\n\n (1) the final quantum of encoding input is an integral\n multiple of 24 bits; here, the final unit of encoded\n output will be an integral multiple of 4 characters\n with no \"=\" padding,\n (2) the final quantum of encoding input is exactly 8 bits;\n here, the final unit of encoded output will be two\n characters followed by two \"=\" padding characters, or\n (3) the final quantum of encoding input is exactly 16 bits;\n here, the final unit of encoded output will be three\n characters followed by one \"=\" padding character.\n */\n\nint HTTP_b64_ntop(unsigned char *src, size_t srclength, \n char *target, size_t targsize)\n{\n size_t datalength = 0;\n unsigned char input[3];\n unsigned char output[4];\n size_t i;\n\n while (2 < srclength) {\n input[0] = *src++;\n input[1] = *src++;\n input[2] = *src++;\n srclength -= 3;\n\n output[0] = input[0] >> 2;\n output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);\n output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);\n output[3] = input[2] & 0x3f;\n Assert(output[0] < 64);\n Assert(output[1] < 64);\n Assert(output[2] < 64);\n Assert(output[3] < 64);\n\n if (datalength + 4 > targsize)\n return (-1);\n target[datalength++] = Base64[output[0]];\n target[datalength++] = Base64[output[1]];\n target[datalength++] = Base64[output[2]];\n target[datalength++] = Base64[output[3]];\n }\n\n /* Now we worry about padding. */\n if (0 != srclength) {\n /* Get what's left. */\n input[0] = input[1] = input[2] = '\\0';\n for (i = 0; i < srclength; i++)\n input[i] = *src++;\n\n output[0] = input[0] >> 2;\n output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);\n output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);\n Assert(output[0] < 64);\n Assert(output[1] < 64);\n Assert(output[2] < 64);\n\n if (datalength + 4 > targsize)\n return (-1);\n target[datalength++] = Base64[output[0]];\n target[datalength++] = Base64[output[1]];\n if (srclength == 1)\n target[datalength++] = Pad64;\n else\n target[datalength++] = Base64[output[2]];\n target[datalength++] = Pad64;\n }\n if (datalength >= targsize)\n return (-1);\n target[datalength] = '\\0'; /* Returned value doesn't count \\0. */\n return (datalength);\n}\n\n/* skips all whitespace anywhere.\n converts characters, four at a time, starting at (or after)\n src from base - 64 numbers into three 8 bit bytes in the target area.\n it returns the number of data bytes stored at the target, or -1 on error.\n */\n\nint HTTP_b64_pton(const char *src, unsigned char *target, size_t targsize)\n{\n size_t tarindex;\n int state, ch;\n char *pos;\n\n state = 0;\n tarindex = 0;\n\n while ((ch = *src++) != '\\0') {\n if (isspace(ch)) /* Skip whitespace anywhere. */\n continue;\n\n if (ch == Pad64)\n break;\n\n pos = strchr(Base64, ch);\n if (pos == 0) /* A non-base64 character. */\n return (-1);\n\n switch (state) {\n case 0:\n if (target) {\n if (tarindex >= targsize)\n return (-1);\n target[tarindex] = (pos - Base64) << 2;\n }\n state = 1;\n break;\n case 1:\n if (target) {\n if (tarindex + 1 >= targsize)\n return (-1);\n target[tarindex] |= (pos - Base64) >> 4;\n target[tarindex+1] = ((pos - Base64) & 0x0f)\n << 4 ;\n }\n tarindex++;\n state = 2;\n break;\n case 2:\n if (target) {\n if (tarindex + 1 >= targsize)\n return (-1);\n target[tarindex] |= (pos - Base64) >> 2;\n target[tarindex+1] = ((pos - Base64) & 0x03)\n << 6;\n }\n tarindex++;\n state = 3;\n break;\n case 3:\n if (target) {\n if (tarindex >= targsize)\n return (-1);\n target[tarindex] |= (pos - Base64);\n }\n tarindex++;\n state = 0;\n break;\n default:\n abort();\n }\n }\n\n /*\n * We are done decoding Base-64 chars. Let's see if we ended\n * on a byte boundary, and/or with erroneous trailing characters.\n */\n\n if (ch == Pad64) { /* We got a pad char. */\n ch = *src++; /* Skip it, get next. */\n switch (state) {\n case 0: /* Invalid = in first position */\n case 1: /* Invalid = in second position */\n return (-1);\n\n case 2: /* Valid, means one byte of info */\n /* Skip any number of spaces. */\n for ( ; ch != '\\0'; ch = *src++)\n if (!isspace(ch))\n break;\n /* Make sure there is another trailing = sign. */\n if (ch != Pad64)\n return (-1);\n ch = *src++; /* Skip the = */\n /* Fall through to \"single trailing =\" case. */\n /* FALLTHROUGH */\n\n case 3: /* Valid, means two bytes of info */\n /*\n * We know this char is an =. Is there anything but\n * whitespace after it?\n */\n for ( ; ch != '\\0'; ch = *src++)\n if (!isspace(ch))\n return (-1);\n\n /*\n * Now make sure for cases 2 and 3 that the \"extra\"\n * bits that slopped past the last full byte were\n * zeros. If we don't check them, they become a\n * subliminal channel.\n */\n if (target && target[tarindex] != 0)\n return (-1);\n }\n } else {\n /*\n * We ended by seeing the end of the string. Make sure we\n * have no partial bytes lying around.\n */\n if (state != 0)\n return (-1);\n }\n\n return (tarindex);\n}\n", "SString.h": " /*@@\n @file SString.h\n @date 02.04.2004\n @author Steve White\n @desc C Module for generic operations on strings\n @enddesc\n @version $Header$\n @@*/\n#ifndef _SSTRING_H\n#define _SSTRING_H\n\n#include \n\ntypedef struct String_tag String; /* The abstract type for a String */\n\ntypedef char SSCHAR; /* Could be Unicode... */\n\ntypedef enum { SSFALSE, SSTRUE } SSBOOL;\n\n#ifdef __cplusplus\nextern \"C\" \n{\n#endif\n /* String creation and deletion */\nString *String_New( void );\nString *String_Copy( const String *other );\nString *String_Make( const SSCHAR *other );\nvoid String_Delete( String * );\n /* Number of characters in string */\nsize_t StringLength( const String * );\n /* Accessors */\nSSCHAR StringNthChar( const String *, size_t n );\nString * StringSetNthChar( String *, size_t n, SSCHAR c );\n /* Copying */\nString * StringSet( String *dest, const String *source );\nString * StringSetRange( String *dest, const String *source,\n size_t start, size_t length );\nString * StringSetToPartAfter( String *dest, const String *source, \n size_t position );\n /* Conversion to and from C string */\nString * StringSetToCString( String *s, const SSCHAR *c_str );\nString * StringConcatCString( String *s, const SSCHAR *c_str );\nint StringCompareCString( const String *s, const SSCHAR *c_str );\nString * StringInsertCString( String * s, const char * c_str,\n size_t position );\nString * StringSetToBuffer( String *s, const SSCHAR *buf,\n size_t len );\nconst SSCHAR * StringGetBuffer( const String * s );\nvoid StringCopyBuffer( const String * s, SSCHAR * buf,\n size_t bufsize );\n /* Searching */\nSSBOOL StringFindStringFrom( const String *s, const String *toFind,\n size_t *position );\nSSBOOL StringFindCharFrom( const String *s, SSCHAR theChar,\n size_t *position );\nsize_t StringSetNextToken( const String *s, String *token,\n const SSCHAR *delim, size_t index );\n /* Comparison */\nSSBOOL StringEquals( const String *a, const String *b );\nint StringCompare( const String *a, const String *b );\n /* Insertion and Concatenation */\nString * StringInsert( String * s, const String * other, size_t pos );\nString * StringConcat( String * s, const String * other);\nString * StringInsertChar( String * s, SSCHAR c, size_t pos );\n /* Deleting and Trimming */\nString * StringDeleteChar( String * s, size_t pos );\nString * StringDeleteRange( String * s, size_t begin, size_t end );\nString * StringTruncate( String *, size_t n );\nString * StringTrimLeading( String *, size_t n );\n /* For line reading and writing */\nvoid StringSetLineEndChars( String *str, const SSCHAR * );\n /* Printing to stdout */\nvoid StringPrint( const String *str );\nvoid StringFormatPrint( const String *str, const SSCHAR *format );\n /* Numeric conversions */\ndouble StringAsDouble( const String *str );\nlong StringAsLong( const String *str );\nunsigned long StringAsUnsignedLong( const String *str );\n\ntypedef enum SSFORMAT_TAG\n{\n SFMT_DEFAULT = 0,\n SFMT_LEFT_ALIGN = 1,\n SFMT_PAD_ZERO = 1<<1,\n SFMT_LOWERCASE = 1<<2,\n SFMT_ADD_SIGN_SPACE = 1<<3,\n SFMT_PRINT_SIGN = 1<<4,\n SFMT_ALT = 1<<5\n} SSFORMAT;\n\ntypedef enum SSDOUBLE_FORMAT_TAG \n{\n SFMT_EXPONENTIAL = 1<<6,\n SFMT_DISCRETIONARY_EXP = 1<<7\n} SSDOUBLE_FORMAT;\n\ntypedef enum SSINT_FORMAT_TAG\n{\n SFMT_HEX = 1<<6,\n SFMT_OCTAL = 1<<7\n} SSINT_FORMAT;\n#define SFMT_ALWAYS_POINT SFMT_ALT\n#define SFMT_DONT_TRIM_ZEROS SFMT_ALT\n\nString * StringConcatFormattedDecimal( String *s, long int d,\n int width, int precision, SSINT_FORMAT f );\nString * StringConcatFormattedUnsigned( String *s, unsigned long int n,\n int width, int precision, SSINT_FORMAT f );\nString * StringConcatFormattedDouble( String *s, double d,\n int width, int precision, SSDOUBLE_FORMAT f );\nString * StringConcatDecimal( String *str, long int d );\nString * StringConcatDouble( String *str, double d );\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n", "Content.h": " /*@@\n @header Content.h\n @date Sun Sep 17 14:19:23 2000\n @author Tom Goodale\n @desc \n Routines exported by the Content stuff. Was httpd_Content.h; still\n exported by that name.\n @enddesc\n @version $Header$\n @@*/\n\n#ifndef __HTTP_CONTENT_H__\n#define __HTTP_CONTENT_H__ 1\n\n#define HTTP_QUICKLINK 1\n\n#include \"SString.h\"\n#include \"httpRequest.h\"\n\n#ifdef __cplusplus\nextern \"C\" \n{\n#endif\n\nint HTTP_ContentLink(const char *URL, \n const char *name,\n const char *description,\n int flags);\n\nint HTTP_ContentSendFromFile(httpRequest *request, int filedes);\n\nint HTTP_ContentHeader(const cGH *cctkGH, int choice, int len, char *mess,\n const char *menu);\nint HTTP_ContentFooter(const cGH *cctkGH, int choice, int len, char *mess);\n\nint HTTP_SetContentHeaderString(const cGH *cctkGH, int choice, String *mess,\n const String *menu);\nint HTTP_SetContentFooterString(const cGH *cctkGH, int choice, String *mess);\n\nvoid HTTP_SetHeadInfo( String *header);\n\nvoid HTTP_SetDoctype( String *header);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* __HTTP_CONENT_H__ */\n", "Content.c": " /*@@\n @file Content.c\n @date Wed Sep 13 23:47:43 2000\n @author Tom Goodale\n @desc \n The actual content of the web pages.\n Note that this need not be in this thorn, since\n it should just use the interface defined in http_Request.h\n and should never touch the internals.\n @enddesc\n @version $Id$\n @@*/\n\n#include \"cctk.h\"\n#include \"cctk_Arguments.h\"\n\n#include \n#include \n\n#ifdef HAVE_UNISTD_H\n#include \n#endif\n\n#include \"cctk_Version.h\"\n\n#include \"util_String.h\"\n#include \"util_Network.h\"\n\n#include \"httpRequest.h\"\n\n#include \"Auth.h\"\n#include \"Steer.h\"\n#include \"Cookies.h\"\n\n#include \"cctk_Parameters.h\"\n\n#include \"SString_Namespace.h\"\n\n#include \"Content.h\"\n\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusConnect_HTTPD_Content_c)\n\n/********************************************************************\n ********************* Local Data Types ***********************\n ********************************************************************/\n\nstruct httpStaticPage\n{\n char *page;\n unsigned int length;\n char *mime_type;\n};\n\nstruct httpLink\n{\n struct httpLink *next;\n char *URL;\n char *name;\n char *description;\n int flags;\n};\n\n#define HOSTLENGTH 255\n\n/********************************************************************\n ********************* Local Routine Prototypes *********************\n ********************************************************************/\n\nstatic int RegisterImages(void);\n\nstatic int MainPage(const cGH *cctkGH, httpRequest *request, void *data);\nstatic int AboutPage(const cGH *cctkGH, httpRequest *request, void *data);\n\nstatic int ShowStaticPage(const cGH *cctkGH, httpRequest *request, void *data);\n\nstatic int CompareStrings(const void *string1, const void *string2);\n\nstatic int ControlPage(const cGH *cctkGH, httpRequest *request, void *data);\nstatic int ControlSet(const cGH *cctkGH, httpRequest *request);\nstatic int ControlTerminationPage(const cGH *cctkGH, httpRequest *request);\n\nstatic int CookieTestPage(const cGH *cctkGH, httpRequest *request, void *data);\n\n/********************************************************************\n ********************* Other Routine Prototypes *********************\n ********************************************************************/\n\nvoid HTTP_ContentWork(CCTK_ARGUMENTS);\nint HTTP_RegisterPages(void);\nint HTTPi_RegisterGroupsPages(void);\nint HTTPi_RegisterThornPages(void);\nint HTTPi_RegisterParameterPages(void);\n\n\n/********************************************************************\n ********************* Local Data *****************************\n ********************************************************************/\n\nstruct httpLink *ContentLinks = NULL;\n\nstatic const char *notauthorized_page =\n\"\\nError 401: Not Authorized\\n\\n\"\n\"\\nYou are not authorized to access this page\\n\\n\\n\";\n\n\n/********************************************************************\n ********************* External Routines **********************\n ********************************************************************/\nint\nHTTP_SendString( httpRequest *request, const String * message )\n{\n return HTTP_Send(request, GetBuffer( message ) );\n}\n\nvoid\nHTTP_SendOKHeader( httpRequest *request )\n{\n HTTP_SendOKRefreshHeader( request, -1 );\n}\n\nvoid\nHTTP_SendOKRefreshHeader( httpRequest *request, int secs )\n{\n /* Status message */\n HTTP_Send(request, \"HTTP/1.0 200 OK\\r\\n\");\n /* Content-Type */\n HTTP_Send(request, \"Content-Type: text/html\\r\\n\");\n\n if( secs >= 0 )\n {\n String * timeString = String_Make( \"Refresh: \" );\n ConcatDecimal( timeString, secs );\n ConcatCString( timeString, \"\\r\\n\" );\n HTTP_SendString( request, timeString );\n String_Delete( timeString );\n }\n HTTP_Send( request, \"\\r\\n\" );\n}\n\nvoid\nSSUtil_SplitFilename(const char **dir,const char **file, const String *message)\n{\n Util_SplitFilename((char **)dir,(char **)file,GetBuffer(message));\n}\n\nvoid\nCCTK_GetRunTitleString( String *s )\n{\n char buf[1024] = EMPTYSTRING;\n CCTK_RunTitle(sizeof(buf)-1,buf);\n SetToCString( s, buf );\n}\n\nvoid\nCCTK_GetParameterFilenameString( String *name )\n{\n char buf[1024] = EMPTYSTRING;\n CCTK_ParameterFilename(sizeof(buf)-1,buf);\n SetToCString( name, buf );\n}\n /*@@\n @routine HTTP_ContentWork\n @date Sat Sep 16 15:22:59 2000\n @author Tom Goodale\n @desc \n Does any work which needs to be done by the content pages.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nvoid HTTP_ContentWork(CCTK_ARGUMENTS)\n{\n#if 0\n HTTP_SteerDispatch();\n#endif\n}\n\n\n /*@@\n @routine HTTP_RegisterPages\n @date Wed Sep 13 23:47:43 2000\n @author Tom Goodale\n @desc \n Main page registration routine.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nint HTTP_RegisterPages(void)\n{\n DECLARE_CCTK_PARAMETERS\n#ifdef HTTP_DEBUG\n printf(\"Registering index.html\\n\");\n#endif\n\n /* Register the master page. */\n HTTP_RegisterPage(\"/index.html\", MainPage, NULL);\n\n /* Register parameter control stuff. */\n \n HTTP_RegisterPage(\"/control.html\", ControlPage, NULL);\n\n HTTP_ContentLink(\"/control.html\", \"Cactus Control\",\n \"Control Panel for this run\",\n HTTP_QUICKLINK);\n\n /* Register thorn pages */\n\n HTTPi_RegisterThornPages();\n\n /* Register the server description page */\n HTTP_RegisterPage(\"/About.html\", AboutPage, NULL);\n\n /* Register parameter stuff */\n \n HTTPi_RegisterParameterPages();\n\n /* Register Groups Pages */\n HTTPi_RegisterGroupsPages();\n\n HTTP_AuthAddUser(\"user\",user,password,encryption_scheme);\n\n /* Register images */\n RegisterImages();\n\n HTTP_RegisterPage(\"/cookies.html\", CookieTestPage, NULL);\n\n return 0;\n}\n\n /*@@\n @routine HTTP_ContentLink\n @date Sun Sep 17 13:17:56 2000\n @author Tom Goodale\n @desc \n Register content links.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nint HTTP_ContentLink(const char *URL, \n const char *name,\n const char *description,\n int flags)\n{\n int retval = -1;\n struct httpLink *last;\n struct httpLink *current;\n struct httpLink *hlink = (struct httpLink *)malloc(sizeof(struct httpLink));\n\n if(hlink)\n {\n hlink->URL = Util_Strdup(URL);\n hlink->name = Util_Strdup(name);\n hlink->description = Util_Strdup(description);\n hlink->flags = flags;\n hlink->next = NULL;\n\n /* Put on list */\n if(ContentLinks)\n {\n for(current=ContentLinks; current; current = current->next)\n {\n last = current;\n }\n last->next = hlink;\n }\n else\n {\n ContentLinks = hlink;\n }\n\n retval = 0;\n }\n\n return retval;\n}\n\n/********************************************************************\n ********************* Local Routines *************************\n ********************************************************************/\n\n /*@@\n @routine CompareStrings\n @date Thu Sep 14 18:57:52 2000\n @author Tom Goodale\n @desc \n Case independent string comparison to pass to qsort.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int CompareStrings(const void *string1, const void *string2)\n{\n return Util_StrCmpi(*(const char * const *)string1, *(const char * const *)string2);\n}\n\n /*@@\n @routine TimeListItem\n @date 10.04.2004\n @author Steve White\n @desc \n Reduce repetition in MainPage below\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic void\nTimeListItem( String *message, int time, const char *units )\n{\n ConcatCString(message, \"
  • \" );\n ConcatDecimal(message, time );\n ConcatCString(message, \" \" );\n ConcatCString(message, units );\n ConcatCString(message, \"
  • \\n\" );\n}\n\n/******************************************************************************\n ***************************** Main Page **************************************\n ******************************************************************************/\n\n\n /*@@\n @routine MainPage\n @date Wed Sep 13 23:47:43 2000\n @author Tom Goodale\n @desc \n Displays the main page.\n @enddesc \n @calls \n @calledby \n @history \n @hdate Thu Sep 14 10:54:22 2000 @hauthor Tom Goodale\n @hdesc Copied content format from original http thorn\n developed by Werner Benger, with the aesthetic\n enhancements of Gabrielle Allen, John Shalf and\n Ed Seidel.\n @endhistory \n\n@@*/\n\nstatic int MainPage(const cGH *cctkGH, httpRequest *request, void *data)\n{\n\n DECLARE_CCTK_PARAMETERS\n\n int retval = -1;\n String *message = String_New();\n String *title = String_New();\n String *menu = String_New();\n const char *dir = NULL;\n const char *file = NULL;\n char *this_user = NULL;\n struct httpLink *hlink = NULL;\n int seconds,minutes,hours,days,weeks,months,years,millenia;\n char host[HOSTLENGTH+1] = EMPTYSTRING;\n\n /* avoid compiler warning about unused parameter */\n data = data;\n\n HTTP_SendOKRefreshHeader( request, refresh_seconds );\n\n HTTP_SetDoctype( message );\n HTTP_SendString(request, message);\n /* Start the page */\n\n HTTP_Send(request, \"\\n\\n\");\n HTTP_Send(request, \"Running CACTUS Status Information\\n\");\n HTTP_SetHeadInfo( message);\n HTTP_SendString(request, message );\n HTTP_Send(request, \"\\n\");\n\n HTTP_Send(request, \"\\n\\n\");\n /* Write out the main header part */\n\n /* LIST COMPILED THORNS */\n {\n int i;\n int nthorns = CCTK_NumCompiledThorns();\n if( nthorns > 0 )\n {\n const char **thorns = (const char **)malloc(nthorns * sizeof(char *));\n if( thorns != NULL )\n {\n for(i=0; i < nthorns; i++)\n thorns[i] = CCTK_CompiledThorn (i);\n\n qsort(thorns, nthorns, sizeof(char *), CompareStrings);\n \n SetToCString( menu,\"

    Active Thorns:

    \\n\");\n for(i=0; i < nthorns; i++)\n if (CCTK_IsThornActive(thorns[i]))\n {\n ConcatCString( menu,\"\");\n ConcatCString( menu, thorns[i]);\n ConcatCString( menu,\"
    \\n\");\n }\n free(thorns);\n }\n }\n }\n\n HTTP_SetContentHeaderString(cctkGH, 0, message, menu);\n HTTP_SendString(request, message );\n\n HTTP_Send(request, \n \"
    \\n\"\n \"\\\"Cactus\\\"
    \\n\");\n\n CCTK_GetRunTitleString(title);\n\n /* Some blurb */\n SetToCString(message, \n \"
    \\n\"\n \"\\n\"\n \"\\n\"\n \"\\n\"\n \"\\n\"\n \"
    \\n\"\n \"

    \");\n Concat(message, title );\n ConcatCString(message, \n \"

    \\n\"\n \"

    This browser is connected to a Cactus simulation which \\n\"\n \"contains a web server thorn. This thorn provides information \\n\"\n \" and control for the simulation.

    \\n\"\n \"\\n\"\n \"\\n\"\n \"
    \\n\"\n \"

    Before controlling any features of the simulation, users \\n\"\n \"must authenticate.

    \\n\"\n \"
    \\n\"\n \"
    \\n\"\n \"
    \\n\");\n\n HTTP_SendString(request, message );\n\n HTTP_Send(request, \n \"\\n\"\n \"\\n\"\n \"\\n\"\n \"\\n\\n
    \\n\");\n\n /* AVAILABLE OPTIONS */\n\n if(ContentLinks)\n {\n SetToCString(message, \n \"

    Available options:

    \\n\"\n \"
    \\n\");\n\n for(hlink = ContentLinks; hlink; hlink=hlink->next)\n {\n ConcatCString(message, \"
    URL );\n ConcatCString(message, \"\\\">\" );\n ConcatCString(message, hlink->name );\n ConcatCString(message, \"
    \\n
    \" );\n ConcatCString(message, hlink->description );\n ConcatCString(message, \"
    \\n\" );\n }\n \n ConcatCString(message, \"
    \\n\" );\n HTTP_SendString(request, message );\n }\n\n HTTP_Send(request, \n \"
    \\n\");\n\n\n /* CONFIGURATION DETAILS */\n\n SetToCString(message, \n \"

    Simulation:

    \\n\"\n \"
      \\n\"\n \"
    • Flesh version \");\n ConcatCString(message, CCTK_FullVersion() );\n ConcatCString(message, \n \"
    • \\n\"\n \"
    • Flesh compiled on \");\n ConcatCString(message, CCTK_CompileDate() );\n ConcatCString(message, \n \"\\n\"\n \" at \");\n ConcatCString(message, CCTK_CompileTime() );\n ConcatCString(message, \n \"
    • \\n\");\n\n HTTP_SendString(request, message );\n\n seconds = CCTK_RunTime();\n minutes = seconds/60;\n seconds = seconds-minutes*60;\n hours = minutes/60;\n minutes = minutes-hours*60;\n days = hours/24;\n hours = hours-days*24;\n weeks = days/7;\n days=days-weeks*7;\n months = weeks/4;\n weeks=weeks-months*4;\n years = months/12;\n months=months-years*12;\n millenia=years/1000;\n years=years-millenia*1000;\n\n SetToCString(message, \"
    • Time since start up\\n
        \");\n if (millenia)\n {\n TimeListItem( message, millenia, \"millenia\" );\n }\n if (years)\n {\n TimeListItem( message, years, \"years\" );\n }\n if (months)\n {\n TimeListItem( message, months, \"months\" );\n }\n if (weeks)\n {\n TimeListItem( message, weeks, \"weeks\" );\n }\n if (days)\n {\n TimeListItem( message, days, \"days\" );\n }\n if (hours)\n {\n TimeListItem( message, hours, \"hours\" );\n }\n if (minutes)\n {\n TimeListItem( message, minutes, \"minutes\" );\n }\n if (seconds)\n {\n TimeListItem( message, seconds, \"seconds\" );\n }\n\n ConcatCString(message, \"
    • \\n
    • Parameter filename \" );\n HTTP_SendString(request, message );\n\n CCTK_GetParameterFilenameString(message);\n SSUtil_SplitFilename(&dir,&file,message);\n HTTP_Send(request, file);\n\n HTTP_Send(request, \"
    • \\n\");\n\n if (cctkGH && cctkGH->cctk_iteration)\n {\n SetToCString(message, \"
    • Estimated time per iteration:
        \\n\");\n ConcatCString(message, \"
      • \");\n ConcatDouble(message, CCTK_RunTime()/(double)cctkGH->cctk_iteration );\n ConcatCString(message, \" seconds
    • \\n\");\n\n HTTP_SendString(request, message );\n\n SetToCString(message, \"
    • Estimated time to completion:\\n
        \");\n\n if (cctk_final_timecctk_iteration)*CCTK_RunTime()/\n cctkGH->cctk_iteration;\n }\n else\n {\n seconds = (cctk_final_time-cctkGH->cctk_time)/cctkGH->cctk_delta_time*\n CCTK_RunTime()/cctkGH->cctk_iteration;\n }\n\n minutes = seconds/60;\n seconds = seconds-minutes*60;\n hours = minutes/60;\n minutes = minutes-hours*60;\n days = hours/24;\n hours = hours-days*24;\n weeks = days/7;\n days=days-weeks*7;\n months = weeks/4;\n weeks=weeks-months*4;\n years = months/12;\n months=months-years*12;\n millenia=years/1000;\n years=years-millenia*1000;\n \n\n if (millenia)\n {\n TimeListItem( message, millenia, \"millenia\" );\n }\n if (years)\n {\n TimeListItem( message, years, \"years\" );\n }\n if (months)\n {\n TimeListItem( message, months, \"months\" );\n }\n if (weeks)\n {\n TimeListItem( message, months, \"months\" );\n }\n if (days)\n {\n TimeListItem( message, days, \"days\" );\n }\n if (hours)\n {\n TimeListItem( message, hours, \"hours\" );\n }\n if (minutes)\n {\n TimeListItem( message, minutes, \"minutes\" );\n }\n if (seconds)\n {\n TimeListItem( message, seconds, \"seconds\" );\n }\n \n ConcatCString(message, \"
    • \\n\");\n\n HTTP_SendString(request, message );\n }\n\n Util_GetHostName(host,HOSTLENGTH);\n host[HOSTLENGTH] = 0;\n\n if (CCTK_nProcs(cctkGH) == 1)\n {\n SetToCString(message, \"
    • Single processor run
    • \\n\"\n \"
    • Running on \" );\n ConcatCString(message, host);\n ConcatCString(message, \"
    • \\n\");\n }\n else\n {\n SetToCString(message, \"
    • Multiprocessor run on \" );\n ConcatDecimal(message, CCTK_nProcs(cctkGH));\n ConcatCString(message, \" CPUs
    • \\n\"\n \"
    • Processor 0 running on \");\n ConcatCString(message, host);\n ConcatCString(message, \"
    • \\n\");\n }\n HTTP_SendString(request, message );\n\n this_user = getenv (\"USER\");\n if (this_user)\n {\n SetToCString(message, \"
    • Started by \");\n ConcatCString(message, this_user);\n ConcatCString(message, \"
    • \\n\");\n HTTP_SendString(request, message );\n }\n\n HTTP_Send(request, \"
    \\n\");\n\n /* Finish table started by blurb */\n HTTP_Send(request, \"
    \\n\\n\");\n \n /* Write out the footer part. */\n\n HTTP_SetContentFooterString(cctkGH, 0, message);\n retval = HTTP_SendString(request, message );\n\n String_Delete( message );\n String_Delete( title );\n String_Delete( menu );\n\n return retval;\n}\n\n/******************************************************************************\n ***************************** Images *****************************************\n ******************************************************************************/\n\n#include \"images/wwwcactuscodeorg.h\"\n#include \"images/www.h\"\n\n /*@@\n @routine RegisterImages\n @date Wed Sep 13 23:47:43 2000\n @author Tom Goodale\n @desc \n Registers images. Images are static pages, so it\n registers a function which takes a data structure and\n displays it.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int RegisterImages(void)\n{\n struct httpStaticPage *image2 = NULL;\n struct httpStaticPage *image\n = (struct httpStaticPage *)malloc(sizeof(struct httpStaticPage));\n\n if(image)\n {\n image->page = (char *)malloc(sizeof(wwwcactuscodeorg));\n memcpy(image->page, wwwcactuscodeorg, sizeof(wwwcactuscodeorg));\n image->length = sizeof(wwwcactuscodeorg);\n image->mime_type = (char *)malloc(strlen(\"image/jpeg\")+1);\n strcpy(image->mime_type, \"image/jpeg\");\n\n#ifdef HTTP_DEBUG\n printf(\"Registering /Images/wwwcactuscodeorg.jpg\\n\");\n#endif\n\n HTTP_RegisterPage(\"/Images/wwwcactuscodeorg.jpg\", ShowStaticPage, (void *)image);\n }\n\n image2 = (struct httpStaticPage *)malloc(sizeof(struct httpStaticPage));\n\n if(image2)\n {\n image2->page = (char *)malloc(sizeof(www));\n memcpy(image2->page, www, sizeof(www));\n image2->length = sizeof(www);\n image2->mime_type = (char *)malloc(strlen(\"image/gif\")+1);\n strcpy(image2->mime_type, \"image/gif\");\n\n HTTP_RegisterPage(\"/Images/www.gif\", ShowStaticPage, (void *)image2);\n }\n\n return 0;\n}\n\n /*@@\n @routine ShowStaticPages\n @date Wed Sep 13 23:47:43 2000\n @author Tom Goodale\n @desc \n Displays a static page.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int ShowStaticPage(const cGH *cctkGH, httpRequest *request, void *data)\n{\n int retval = -1;\n\n /* avoid compiler warning about unused parameter */\n cctkGH = cctkGH;\n\n if(data)\n {\n struct httpStaticPage *page = (struct httpStaticPage *)data;\n String *message = String_New();\n\n HTTP_Send(request, \"HTTP/1.0 200 OK\\r\\n\"); \n\n SetToCString(message, \"Content-Length: \");\n ConcatDecimal(message, page->length );\n ConcatCString(message, \"\\r\\nContent-Type: \");\n ConcatCString(message, page->mime_type );\n ConcatCString(message, \"\\r\\n\\r\\n\");\n\n HTTP_SendString(request, message);\n\n retval = HTTP_Write(request, page->page, page->length);\n\n String_Delete( message );\n }\n \n return retval;\n}\n\n#define USER_LENGTH 255\n /*@@\n @routine ControlPage\n @date Sun Sep 17 14:37:59 2000\n @author Tom Goodale\n @desc \n Cactus Control Panel\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int ControlPage(const cGH *cctkGH, httpRequest *request, void *data)\n{\n DECLARE_CCTK_PARAMETERS\n\n int notauthorised = 0;\n char thisuser[USER_LENGTH+1] = EMPTYSTRING;\n\n data = data; /* avoid compiler warning about unused parameter */\n\n notauthorised = HTTP_AuthenticateBasic(request, \"user\", thisuser,\n sizeof(thisuser));\n\n if(!notauthorised)\n {\n /* Ok the person is authorised. */\n if(HTTP_NumArguments( request ) == 0)\n {\n String *message = String_New();\n /* No arguments, so just display the page */\n HTTP_Send(request,\"HTTP/1.0 200 Ok\\r\\n\"); \n\n HTTP_Send(request,\"WWW-Authenticate: Basic realm=\\\"Cactus Control\\\"\\r\\n\"); \n\n HTTP_CookieSend(request,\"user\", thisuser, \"/\", NULL, NULL, 0);\n \n HTTP_Send(request,\"Content-Type: text/html\\r\\n\\r\\n\");\n\n HTTP_SetDoctype( message );\n HTTP_SendString(request, message);\n /* Start the page */\n HTTP_Send(request, \"\\n\");\n HTTP_Send(request, \"Cactus Control and Status Page\\n\");\n\n HTTP_SetHeadInfo( message);\n HTTP_SendString(request, message );\n HTTP_Send(request, \"\\n\" );\n\n HTTP_Send(request, \"\\n\\n\");\n \n HTTP_SetContentHeaderString(cctkGH, 0,message,NULL);\n\n ConcatCString(message, \"

    Control and Status Page

    \\n\");\n\n HTTP_SendString(request, message);\n\n HTTP_Send(request,\n \"

    This page is the control center for interacting with\\n\"\n \" the current simulation. It is possible to steer certain\\n\"\n \" parameters, as well as pause, restart, or terminate the\"\n \" simulation.

    \\n\");\n\n HTTP_Send(request, \n \"
    \\n\"\n \"
    \\n\");\n\n HTTP_Send(request, \n \"

    Run Control

    \\n\"\n \"

    Select if the run should be paused, running normally, \"\n \"or terminated.\\n\"\n \" You may also single step to the next iteration.

    \\n\");\n\n HTTP_Send(request,\n \"\\n\"\n \"\\n\");\n \n SetToCString(message, \n \"\\n\");\n HTTP_SendString(request, message);\n \n SetToCString(message, \n \"\\n\");\n HTTP_SendString(request, message);\n \n HTTP_Send(request,\n \"\\n\");\n\n HTTP_Send(request,\n \"\\n\");\n \n HTTP_Send(request,\n \"
    PAUSE RUN TERMINATE
    \\n\"\n \"\\n\"\n \"\\n\"\n \"\\n\"\n \"\\n\"\n \"
    \\n\");\n\n HTTP_Send(request, \n \"

    Run Until

    \\n\"\n \"

    The following parameters allow you to select an iteration\\n\"\n \"number or physical time at which the code will pause.\\n\"\n \" You may also choose to pause if a particular expression made up\\n\"\n \" of grid scalars, simulation time and iteration is true. \\n\"\n \" Note that even if 'run' is selected above, the settings here have\"\n \" precedence.

    \\n\");\n\n SetToCString(message,\n \"\\n\");\n\n ConcatCString(message,\"\"\n \"\\n\"\n \"\\n\"\n \"\\n\");\n ConcatCString(message, \n \"\"\n \"\\n\"\n \"\\n\"\n \"\\n\");\n ConcatCString(message, \n \"\\n\"\n \"\\n\"\n \"\\n\"\n \"\\n\");\n\n ConcatCString(message,\"
    Iteration
    Time
    Expression
    \\n\");\n \n HTTP_SendString(request, message);\n\n HTTP_Send(request,\n \"
    \\n\"\n \"
    \\n\");\n \n /* Write out the footer part. */\n \n HTTP_SetContentFooterString(cctkGH, 0, message);\n HTTP_SendString(request, message);\n\n String_Delete( message );\n }\n else\n {\n /* Arguments, so control simulation */\n ControlSet(cctkGH, request);\n }\n }\n else\n {\n /* Not authorised */\n HTTP_Send(request,\"HTTP/1.0 401 Unauthorized\\r\\n\"); \n\n HTTP_Send(request,\"WWW-Authenticate: Basic realm=\\\"Cactus Control\\\"\\r\\n\"); \n\n HTTP_CookieCancel(request,\"user\", \"/\");\n\n HTTP_Send(request,\"Content-Type: text/html\\r\\n\\r\\n\");\n \n HTTP_Send(request, notauthorized_page);\n }\n\n return 0;\n}\n\n /*@@\n @routine ControlSet\n @date Sun Sep 17 14:39:50 2000\n @author Tom Goodale\n @desc \n Set the status of the simulation based on the controls.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int ControlSet(const cGH *cctkGH, httpRequest *request)\n{\n DECLARE_CCTK_PARAMETERS;\n\n String *message = String_New();\n const char *value = HTTP_ArgumentValue(request,\"runstate\");\n\n if(value)\n {\n switch(*value)\n {\n case 'T' : HTTP_SteerQueue(CCTK_THORNSTRING, \"terminate\", \"yes\");\n if(pause)\n {\n HTTP_SteerQueue(CCTK_THORNSTRING, \"pause\", \"no\");\n }\n ControlTerminationPage(cctkGH, request);\n break;\n case 'P' : HTTP_SteerQueue(CCTK_THORNSTRING, \"pause\", \"yes\");\n break;\n case 'R' : HTTP_SteerQueue(CCTK_THORNSTRING, \"pause\", \"no\");\n break;\n default :\n CCTK_VWarn(1, __LINE__,__FILE__,CCTK_THORNSTRING,\n \"Unknown runstate \\\"%s\\\"\", value );\n }\n }\n\n /* Is single stepping switched on ? */\n value = HTTP_ArgumentValue(request,\"step\");\n \n if(value)\n {\n HTTP_SteerQueue(CCTK_THORNSTRING, \"single_step\", \"yes\");\n }\n\n /****************************************************************************\n *************** Is running until an iteration switched on ? ****************\n */\n value = HTTP_ArgumentValue(request,\"until_it_active\");\n \n if(value)\n {\n /* Value exists, so must be yes */\n if(!until_it_active)\n {\n HTTP_SteerQueue(CCTK_THORNSTRING, \"until_it_active\", \"yes\");\n }\n }\n else\n {\n /* Value doesn't exist, so must be no */\n if(until_it_active)\n {\n HTTP_SteerQueue(CCTK_THORNSTRING, \"until_it_active\", \"no\");\n }\n } \n\n /* Now look at the value and steer it if it's changed */\n value = HTTP_ArgumentValue(request,\"iteration\");\n\n if(value)\n {\n if(atoi(value) != until_it)\n {\n HTTP_SteerQueue(CCTK_THORNSTRING, \"until_it\", value);\n }\n }\n\n /****************************************************************************\n *************** Is running until a particular time switched on ? ***********\n */\n value = HTTP_ArgumentValue(request,\"until_time_active\");\n \n if(value)\n {\n /* Value exists, so must be yes */\n if(!until_time_active)\n {\n HTTP_SteerQueue(CCTK_THORNSTRING, \"until_time_active\", \"yes\");\n }\n }\n else\n {\n /* Value doesn't exist, so must be no */\n if(until_time_active)\n {\n HTTP_SteerQueue(CCTK_THORNSTRING, \"until_time_active\", \"no\");\n }\n } \n\n /* Now look at the value and steer it if it's changed */\n value = HTTP_ArgumentValue(request,\"time\");\n\n if(value)\n {\n if(atof(value) != until_time)\n {\n HTTP_SteerQueue(CCTK_THORNSTRING, \"until_time\", value);\n }\n }\n \n /****************************************************************************\n *************** Is running until an expression is true switched on ? *******\n */\n value = HTTP_ArgumentValue(request,\"until_expression_active\");\n \n if(value)\n {\n /* Value exists, so must be yes */\n if(!until_expression_active)\n {\n HTTP_SteerQueue(CCTK_THORNSTRING, \"until_expression_active\", \"yes\");\n }\n }\n else\n {\n /* Value doesn't exist, so must be no */\n if(until_expression_active)\n {\n HTTP_SteerQueue(CCTK_THORNSTRING, \"until_expression_active\", \"no\");\n }\n } \n\n /* Now look at the value and steer it if it's changed */\n value = HTTP_ArgumentValue(request,\"expression\");\n\n if(value)\n {\n if(!CCTK_Equals(value,until_expression))\n {\n HTTP_SteerQueue(CCTK_THORNSTRING, \"until_expression\", value);\n }\n }\n\n /****************************************************************************\n **************** Now redirect the browser to the normal page ***************\n */\n /* SW: I don't think this is working right. On my browsers, it just\n * displays the ControlTerminationPage, with the following lines\n * of text rendered at the bottom. */\n\n /* Status message */\n if(HTTP_MajorVersion( request ) < 1 || \n (HTTP_MajorVersion( request ) == 1 && HTTP_MinorVersion( request ) < 1))\n {\n /* Older browsers don't understand 303 */\n SetToCString(message,\"HTTP/1.0 302 Found\\r\\n\");\n }\n else\n {\n SetToCString(message,\"HTTP/1.0 303 See Other\\r\\n\");\n }\n \n ConcatCString(message, \"Location: /control.html\\r\\n\\r\\n\");\n \n HTTP_SendString(request, message);\n\n String_Delete( message );\n\n return 0;\n}\n\n /*@@\n @routine ControlTerminationPage\n @date Sun Sep 17 14:40:16 2000\n @author Tom Goodale\n @desc \n Page to be shown on termination of Cactus.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int ControlTerminationPage(const cGH *cctkGH, httpRequest *request)\n{\n int retval = -1;\n String *message = String_New();\n HTTP_SendOKHeader( request );\n\n HTTP_SetDoctype( message );\n HTTP_SendString(request, message);\n /* Start the page */\n HTTP_Send(request, \"\\n\");\n HTTP_Send(request, \"Running CACTUS Status Information : Terminated\\n\");\n\n HTTP_SetHeadInfo( message);\n HTTP_SendString(request, message );\n\n HTTP_Send(request, \"\\n\\n\");\n\n /* Write out the main header part */\n HTTP_SetContentHeaderString(cctkGH,1,message,NULL);\n HTTP_SendString(request, message);\n\n HTTP_Send(request, \"

    Simulation Home Page

    \\n\");\n\n /* Some blurb */\n HTTP_Send(request,\n \"
    \\n\"\n \"
    \\n\"\n \"

    Simulation web server:

    \\n\" \n \"

    This browser is connected to a Cactus simulation which \\n\"\n \"contains a web server thorn. This thorn allows you to monitor \\n\"\n \"the simulation,\\n\"\n \"and view and change parameters

    \\n\"\n \"

    Depending on which other thorns are active, there may be \\n\"\n \"additional features available, such as the viewing and \\n\"\n \"downloading of output files

    \\n\");\n\n /* CONFIGURATION DETAILS */\n\n SetToCString(message,\n \"

    Simulation:

    \\n\"\n \"
    • Flesh version \");\n ConcatCString(message, CCTK_FullVersion() );\n ConcatCString(message,\n \"
    • \\n\"\n \"
    • Flesh compiled on \" __DATE__\" \\n\"\n \"at \"__TIME__\"
    • \\n\");\n\n HTTP_SendString(request, message);\n\n if (cctkGH)\n {\n if (CCTK_nProcs(cctkGH) == 1)\n {\n SetToCString(message,\"
    • Single processor run
    • \\n\");\n }\n else\n {\n SetToCString(message,\"
    • Multiprocessor run on \");\n ConcatDecimal( message, CCTK_nProcs(cctkGH) );\n ConcatCString( message, \" CPUs
    • \\n\");\n }\n HTTP_SendString(request, message);\n }\n\n HTTP_Send(request,\"
    \\n\");\n\n /************************************************************************/\n\n /* NEW COLUMN */\n\n HTTP_Send(request, \"
    \");\n\n /************************************************************************/\n\n /* CURRENT STATE OF SIMULATION */\n\n if (cctkGH)\n {\n\n SetToCString(message, \n \"

    Current state:

    \\n\"\n \"
    • Physical time \");\n ConcatDouble(message, cctkGH->cctk_time );\n ConcatCString(message, \n \"
    • \\n\"\n \"
    • Iteration number \");\n ConcatDecimal(message, cctkGH->cctk_iteration );\n ConcatCString(message, \"
    • \\n\");\n }\n else\n {\n SetToCString(message, \"
    • Current cactus state is unknown
    • \\n\");\n }\n\n HTTP_SendString(request, message);\n HTTP_Send(request, \"
    • This Cactus run is over.
    • \\n\");\n\n HTTP_Send(request, \"
    \");\n\n /* LIST COMPILED THORNS */\n {\n int i;\n int nthorns = CCTK_NumCompiledThorns();\n const char **thorns = (const char **)malloc(nthorns * sizeof(char *));\n\n for(i=0; i < nthorns; i++)\n {\n thorns[i] = CCTK_CompiledThorn (i);\n }\n\n /* Sort the thorns */\n qsort(thorns, nthorns, sizeof(char *), CompareStrings);\n\n SetToCString(message, \n \"

    Compiled thorns:

    \\n\"\n \"

    This list shows all thorns compiled into the executable; those \\n\"\n \"thorns which have been activated in the parameter file for this \\n\"\n \"simulation are shown in red

    \\n\"\n \"
      \\n\");\n\n for(i=0; i < nthorns; i++)\n {\n ConcatCString(message, \"
    • \");\n if (CCTK_IsThornActive(thorns[i]))\n {\n ConcatCString(message, \" \");\n ConcatCString(message, thorns[i]);\n ConcatCString(message, \" \");\n }\n else\n {\n ConcatCString(message, thorns[i]);\n }\n ConcatCString(message, \"
    • \\n\");\n }\n ConcatCString(message, \"
    \\n\");\n\n free(thorns);\n }\n\n HTTP_SendString(request, message);\n \n\n /* Finish table started by blurb */\n HTTP_Send(request, \"
    \\n\");\n \n /* Write out the footer part. */\n\n HTTP_SetContentFooterString(cctkGH,0,message);\n retval = HTTP_SendString(request, message);\n\n String_Delete( message );\n return retval;\n}\n\n /*@@\n @routine HTTP_ContentSendFromFile\n @date Sun Sep 17 17:35:57 2000\n @author Tom Goodale\n @desc \n Reads data from the filedescriptor and sends it to the HTTP request.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nint HTTP_ContentSendFromFile(httpRequest *request, int filedes)\n{\n int bytes_sent = 0;\n int n_bytes = 0;\n char buffer[4098] = EMPTYSTRING;\n\n bytes_sent = 0;\n while((n_bytes = read(filedes, buffer,sizeof(buffer))) > 0)\n {\n HTTP_Write(request, buffer, n_bytes);\n bytes_sent += n_bytes;\n }\n\n if(n_bytes == -1)\n {\n bytes_sent = -bytes_sent;\n }\n\n return bytes_sent;\n}\n\n\n /*@@\n @routine AboutPage\n @date Sun Sep 17 2000\n @author Gabrielle Allen\n @desc \n Displays a page about the web server\n @enddesc \n @calls \n @calledby \n@@*/\nstatic int AboutPage(const cGH *cctkGH, httpRequest *request, void *data)\n{\n int retval = -1;\n String *message = String_New();\n\n /* avoid compiler warning about unused parameter */\n data = data;\n\n HTTP_SendOKHeader( request );\n\n HTTP_SetDoctype( message );\n HTTP_SendString(request, message);\n /* Start the page */\n SetToCString(message, \"\\nAbout Cactus Server\\n\");\n HTTP_SetHeadInfo( message);\n HTTP_SendString(request, message );\n\n HTTP_Send(request, \"\\n\\n\");\n HTTP_SetContentHeaderString(cctkGH,0,message,NULL);\n HTTP_SendString(request, message);\n\n HTTP_Send(request, \"

    About this Web Server

    \\n\");\n\n SetToCString(message, \"

    These web pages are served by a simulation \\n\"\n \"which is using the Cactus Code and Computational ToolKit, \\n\"\n \"a freely available, parallel, collaborative,\"\n \" portable and \\n\"\n \"modular programming environment for HPC.

    \\n\"\n \"

    The HTTPD module, or thorn \"\n \"which is serving these pages\\n\"\n \" can be added to any Cactus application to provide on-line \\n\"\n \"monitoring and control of simulations from any web browser.

    \\n\"\n \"

    This HTTPD server and thorn interface has been designed and \\n\"\n \"and implemented by Tom Goodale, based on the original idea and \\n\"\n \"implementation by Werner Benger.

    \\n\");\n\n retval = HTTP_SendString(request, message);\n\n SetToCString(message, \"

    For more information about Cactus, visit our \"\n \"permanent home page at \\n\"\n \"www.cactuscode.org

    \\n\");\n\n retval = HTTP_SendString(request, message);\n\n /* Write out the footer part. */\n \n HTTP_SetContentFooterString(cctkGH,0,message);\n retval = HTTP_SendString(request, message);\n\n String_Delete( message);\n return retval;\n}\n\n\n /*@@\n @routine CookieTestPage\n @date Mon Sep 18 23:28:19 2000\n @author Tom Goodale\n @desc \n Test and example page for cookies. This will disappear\n soon.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int CookieTestPage(const cGH *cctkGH, httpRequest *request, void *data)\n{\n int retval = -1;\n String *message = String_New();\n const char *value = NULL;\n char *value2 = NULL;\n\n /* avoid compiler warning about unused parameter */\n data = data;\n\n /* Status message */\n HTTP_Send(request,\"HTTP/1.0 200 OK\\r\\n\");\n\n /* Cookie */\n HTTP_CookieSend(request, \"user1\", \"foobar4\", NULL,NULL,NULL,0);\n\n HTTP_CookieSend(request, \"user2\", \"foobar3\", NULL,NULL,NULL,0);\n\n HTTP_CookieSend(request, \"user3\", \"foobar2\", NULL,NULL,NULL,0);\n\n HTTP_CookieSend(request, \"user4\", \"foobar1\", NULL,NULL,NULL,0);\n\n HTTP_Send(request,\"Content-Type: text/html\\r\\n\\r\\n\");\n\n HTTP_SetDoctype( message );\n HTTP_SendString(request, message);\n /* Start the page */\n HTTP_Send(request, \"Cookie Test\\n\");\n HTTP_SetHeadInfo( message);\n HTTP_SendString(request, message );\n\n HTTP_Send(request, \"\\n\\n\");\n\n HTTP_SetContentHeaderString(cctkGH,0,message,NULL);\n HTTP_SendString(request, message);\n\n HTTP_Send(request, \"

    Cookie Test

    \\n\");\n\n HTTP_Send(request, \"
    \");\n\n value = HTTP_HeaderValue(request, \"Cookie\");\n\n SetToCString(message, \"

    Cookie was '\");\n ConcatCString(message, value);\n ConcatCString(message, \"'

    \\n\");\n\n HTTP_SendString(request, message);\n\n value2 = HTTP_CookieGet(request,\"user3\");\n\n SetToCString(message, \"

    Cookie from decoder was '\");\n ConcatCString(message, value2);\n ConcatCString(message, \"'

    \\n\");\n\n free(value2);\n\n HTTP_SendString(request, message);\n\n HTTP_Send(request,\"
    \\n\");\n \n /* Write out the footer part. */\n\n HTTP_SetContentFooterString(cctkGH,0,message);\n retval = HTTP_SendString(request, message);\n\n String_Delete( message );\n return retval;\n}\n", "Auth.h": " /*@@\n @header Auth.h\n @date Fri Sep 15 13:20:01 2000\n @author Tom Goodale\n @desc \n Was httpd_Auth.h; still exported by that name.\n @enddesc\n @version $Header$\n @@*/\n\n#ifndef __HTTP_AUTH_H__\n#define __HTTP_AUTH_H__ 1\n\n#include \"httpRequest.h\"\n\n#ifdef __cplusplus\nextern \"C\" \n{\n#endif\n\nint HTTP_AuthAddUser(const char *database, \n const char *name,\n const char *password,\n const char *encryption_scheme);\n\nint HTTP_AuthenticateBasic(httpRequest *request,\n const char *database,\n char *user,\n int length);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* __HTTP_AUTH_H__ */\n", "Groups.c": " /*@@\n @file Groups.c\n @date Wed Sep 14 23:47:43 2000\n @author Gabrielle Allen\n @desc \n Pages about groups\n @enddesc\n @version $Header$\n @@*/\n\n#include \n\n#include \"cctk.h\"\n\n#include \"httpRequest.h\"\n#include \"Content.h\"\n\n#include \"SString_Namespace.h\"\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusConnect_HTTPD_Groups_c)\n\n/********************************************************************\n ********************* Local Data Types ***********************\n ********************************************************************/\n\n/********************************************************************\n ********************* Local Routine Prototypes *********************\n ********************************************************************/\n\nstatic int GroupsPage(const cGH *cctkGH, httpRequest *request, void *data);\n\n/*static int watch[1024];*/\n\n/********************************************************************\n ********************* Other Routine Prototypes *********************\n ********************************************************************/\n\nint HTTPi_RegisterGroupsPages(void);\n\n/********************************************************************\n ********************* Local Data *****************************\n ********************************************************************/\n\n/********************************************************************\n ********************* External Routines **********************\n ********************************************************************/\n\n /*@@\n @routine HTTPi_RegisterGroupPages\n @date Wed Sep 14 11:29:43 2000\n @author Gabrielle Allen\n @desc \n Httpd utils registration routine.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nint HTTPi_RegisterGroupsPages(void)\n{\n /* Register the group info page. */\n HTTP_RegisterPage(\"/Groups\", GroupsPage, NULL);\n\n HTTP_ContentLink(\"/Groups/index.html\", \"Groups and Variables\",\n \"Information about grid variables and groups\",\n HTTP_QUICKLINK);\n return 0;\n}\n\n/********************************************************************\n ********************* Local Routines *************************\n ********************************************************************/\n\n\n/******************************************************************************\n ***************************** Groups Page **************************************\n ******************************************************************************/\n\n /*@@\n @routine GroupsPage\n @date Thu Sep 14 23:47:43 2000\n @author Gabrielle Allen\n @desc \n Displays the group description page.\n @enddesc \n @calls \n @calledby \n@@*/\nstatic int GroupsPage(const cGH *cctkGH, httpRequest *request, void *data)\n{\n int retval;\n String *message = String_New();\n int i,j;\n int ngroups,nvars;\n cGroup gdata;\n char *groupname;\n\n /* avoid compiler warning about unused parameter */\n data = data;\n\n HTTP_SendOKHeader( request );\n\n /* Start the page */\n HTTP_SetDoctype( message );\n HTTP_SendString(request, message);\n\n HTTP_Send(request,\"\\n\");\n HTTP_Send(request,\"Cactus Simulation Group Information\\n\");\n\n HTTP_SetHeadInfo( message);\n HTTP_SendString(request, message );\n\n HTTP_Send(request,\"\\n\");\n\n HTTP_Send(request,\"\\n\\n\");\n\n /* HTTP_Write out the header part. */\n\n HTTP_SetContentHeaderString(cctkGH,0,message,NULL);\n\n retval = HTTP_SendString(request, message);\n\n ngroups = CCTK_NumGroups();\n \n retval = HTTP_Send(request, \"

    Groups and Grid Variables

    \\n\"\n \"

    These pages describe the grid variables and groups \\n\"\n \"active in this simulation.

    \\n\");\n\n SetToCString(message,\n \"

    This simulation contains \");\n ConcatDecimal(message, CCTK_NumGroups());\n ConcatCString(message,\n \" groups, and \");\n ConcatDecimal(message, CCTK_NumVars());\n ConcatCString(message,\n \" variables, \"\n \"set in \");\n ConcatDecimal(message, CCTK_MaxDim());\n ConcatCString(message,\n \"-space dimensions. \\nGroups for which storage is currently\\n\"\n \"assigned are written in red. \\n\"\n \"The numbers in square brackets are the group and variable indices.\"\n \"

    \\n\");\n retval = HTTP_SendString(request, message);\n\n retval = HTTP_Send(request,\"
    \\n\");\n\n retval = HTTP_Send(request,\"
    \\n\"\n \"\\n\"\n \"\"\n \"\\n\");\n\n for(i=0; i < ngroups; i++)\n {\n SetToCString(message,\"\");\n\n groupname = CCTK_GroupName(i);\n if (CCTK_QueryGroupStorageI(cctkGH,i) > 0)\n {\n ConcatCString(message, \" \\n\"); \n }\n else\n {\n ConcatCString(message, \" \\n\");\n }\n\n free(groupname);\n\n HTTP_SendString(request, message);\n\n /* Group Description */\n\n SetToCString(message, \"\");\n\n nvars = CCTK_NumVarsInGroupI(i);\n SetToCString(message,\"\");\n HTTP_SendString(request, message);\n\n }\n\n HTTP_Send(request,\"
    GroupsGroup PropertiesVariables
    [\");\n ConcatDecimal(message, i);\n ConcatCString(message, \"] \");\n ConcatCString(message, groupname);\n ConcatCString(message, \"[\");\n ConcatDecimal(message, i);\n ConcatCString(message, \"] \");\n ConcatCString(message, groupname);\n ConcatCString(message, \"\");\n\n if (CCTK_GroupData(i,&gdata) > -1)\n {\n switch (CCTK_GroupTypeI(i))\n {\n case CCTK_SCALAR:\n ConcatCString(message,\"Grid scalar\");\n break;\n case CCTK_ARRAY:\n ConcatCString(message,\"Grid array\");\n break;\n case CCTK_GF:\n ConcatCString(message,\"Grid function\");\n break;\n } \n \n ConcatCString(message, \" \" );\n ConcatCString(message, CCTK_VarTypeName(gdata.vartype) );\n ConcatCString(message, \"
    \\n(\");\n ConcatDecimal(message, CCTK_VarTypeSize(gdata.vartype));\n ConcatCString(message, \" bytes)\");\n if (!(CCTK_GroupTypeI(i) == CCTK_SCALAR))\n {\n ConcatCString(message, \"
    \\nDimension \");\n ConcatDecimal(message, gdata.dim);\n ConcatCString(message, \"
    \\nTimelevels \");\n ConcatDecimal(message, gdata.numtimelevels);\n }\n HTTP_SendString(request, message);\n }\n\n HTTP_Send(request,\"
    \");\n for(j=CCTK_FirstVarIndexI(i); j < CCTK_FirstVarIndexI(i)+nvars; j++)\n {\n ConcatCString(message, \"[\" );\n ConcatDecimal(message, j);\n ConcatCString(message, \"] \" );\n ConcatCString(message, CCTK_VarName(j) );\n ConcatCString(message, \"
    \\n\" );\n }\n ConcatCString(message,\"
    \\n\");\n \n /* Write out the footer part. */\n\n HTTP_SetContentFooterString(cctkGH,0,message);\n retval = HTTP_SendString(request, message);\n\n String_Delete( message );\n\n return retval;\n}\n\n", "SStringHTML.c": " /*@@\n @file SStringHTML.c\n @date 02.04.2004\n @author Steve White\n @desc Extension to Strings module with function specific to HTML\n @enddesc\n @version $Header$\n @@*/\n#include \"SStringHTML.h\"\n\nstatic String *\nStringReplaceCharWithCString( String * str, SSCHAR c, const SSCHAR *cstr );\n\nString * \nStringSetToEncodedHTMLCString( String * str, const SSCHAR *c )\n{\n return StringEncodeHTML( StringSetToCString( str, c ) );\n}\n\nString * \nStringEncodeHTML( String * str )\n{\n StringReplaceCharWithCString( str, '&', \"&\" );\n StringReplaceCharWithCString( str, '<', \"<\" );\n StringReplaceCharWithCString( str, '>', \">\" );\n return str;\n}\n\nString *\nStringReplaceCharWithCString( String * str, SSCHAR c, const SSCHAR *cstr )\n{\n size_t position = 0;\n while( StringFindCharFrom( str, c, &position ) )\n {\n StringDeleteChar( str, position );\n StringInsertCString( str, cstr, position );\n position ++;\n }\n return str;\n}\n", "Server.c": " /*@@\n @file Server.c\n @date Wed Sep 13 20:10:24 2000\n @author Tom Goodale\n @desc \n Web serving and utility routines. \n @enddesc\n @version $Header$\n @@*/\n\n#include \n#include \n\n#include \"cctk.h\"\n\n#include \"cctk_Parameters.h\"\n\n#include \"httpd_Map.h\"\n#include \"util_String.h\"\n\n#include \"httpd.h\"\n\n#include \"Steer.h\"\n#include \"Expression.h\"\n\n#include \"SString_Namespace.h\"\n\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusConnect_HTTPD_Server_c)\n\n/********************************************************************\n ********************* Local Data Types ***********************\n ********************************************************************/\n\ntypedef struct\n{\n int (*function)(const cGH *, httpRequest *, void *);\n void *data;\n} httpPage;\n\n/********************************************************************\n ********************* Local Routine Prototypes *********************\n ********************************************************************/\n\nstatic httpPage *CreatePageData(int (*function)(const cGH *,httpRequest *, void *), void *data);\nstatic httpPage *FindPage(const char *path, const char **residual);\n\nstatic int StatusUntilIt (const cGH *cctkGH);\nstatic int StatusUntilTime (const cGH *cctkGH);\nstatic int StatusUntilExpression (cGH *cctkGH);\n\nstatic double evaluator(const char *name, void *data);\n\n\n/********************************************************************\n ********************* Other Routine Prototypes *********************\n ********************************************************************/\n\n/********************************************************************\n ********************* Local Data *****************************\n ********************************************************************/\n\nstatic uMap pages = NULL;\n\nstatic const char *notfound_page =\n\"\\n\\nError 404: Not Found\\n\\n\"\n\"\\nThe URI you requested could not be found\\n\\n\\n\";\n\nstatic const char *notimplemented_page =\n\"\\n\\nError 501: Not Implemented\\n\\n\"\n\"\\nThe requested method is not implemented\\n\\n\\n\";\n\n#define INITIAL_SIZE 16\n\n/********************************************************************\n ********************* External Routines **********************\n ********************************************************************/\n\n /*@@\n @routine HTTP_RequestGet\n @date Wed Sep 13 20:10:24 2000\n @author Tom Goodale\n @desc \n Routine to deal with a GET request.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\n\nint HTTP_RequestGET(cGH *cctkGH, httpRequest *request)\n{\n int retval = -1;\n const char *residual = NULL;\n httpPage *pagedata = FindPage(HTTP_URI( request ), &residual );\n HTTP_SetResidual( request, residual );\n\n if( pagedata )\n {\n retval = pagedata->function(cctkGH, request, pagedata->data);\n }\n\n if(retval < 0)\n {\n HTTP_Send(request,\"HTTP/1.0 404 Not Found\\r\\n\");\n \n HTTP_Send(request,\"Content-Type: text/html\\r\\n\\r\\n\");\n\n HTTP_Send(request, notfound_page);\n }\n\n return retval;\n}\n\n /*@@\n @routine HTTP_RequestUnsupported\n @date Thu Sep 14 12:18:56 2000\n @author Tom Goodale\n @desc \n \n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nint HTTP_RequestUnsupported(cGH *cctkGH, httpRequest *request)\n{\n cctkGH = cctkGH; /* avoid compiler warning about unused parameter */\n\n HTTP_Send(request,\"HTTP/1.0 501 Not Implemented\\r\\n\");\n\n HTTP_Send(request,\"Content-Type: text/html\\r\\n\\r\\n\");\n \n HTTP_Send(request, notimplemented_page );\n\n return 0;\n}\n\n /*@@\n @routine HTTP_RegisterPage\n @date Wed Sep 13 20:10:24 2000\n @author Tom Goodale\n @desc \n Routine to register a web page.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nint HTTP_RegisterPage(const char *path, int (*function)(const cGH *, httpRequest *, void *), void *data)\n{\n int retval = -1;\n\n /* Create the hash table if it's not already been created */\n if(! pages)\n {\n pages = Httpd_MapCreate();\n }\n\n if(Httpd_MapData(pages, strlen(path), path))\n {\n CCTK_VWarn(1, __LINE__,__FILE__,CCTK_THORNSTRING,\n \"Page exists already:\\n\\\"%s\\\"\", path);\n }\n else\n {\n httpPage *pagedata = CreatePageData(function, data);\n\n if(pagedata)\n {\n retval = Httpd_MapStore(pages, strlen(path), path, (void *)pagedata);\n }\n else\n {\n retval = -2;\n }\n }\n\n return retval;\n}\n\n\n /*@@\n @routine HTTP_UpdateState\n @date Sat Sep 16 21:12:23 2000\n @author Tom Goodale\n @desc \n Updates the state of the server from the latest parameter values.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nint HTTP_UpdateState(cGH *cctkGH, httpState *state)\n{\n DECLARE_CCTK_PARAMETERS\n int stepping = single_step;\n static int steering = 1; \n static int last_steered = -1;\n\n\n state->paused = (! stepping) && \n (pause || (cctkGH &&\n ((until_it_active && StatusUntilIt(cctkGH)) ||\n (until_time_active && StatusUntilTime(cctkGH)) ||\n (until_expression_active && StatusUntilExpression(cctkGH)))));\n\n /* If single step is selected, need to reset the parameter to force a pause\n * next time.\n */\n if(stepping)\n {\n HTTP_SteerQueue(CCTK_THORNSTRING, \"single_step\", \"no\");\n }\n\n if(cctkGH && ! state->paused)\n {\n if(steering)\n {\n if(steering_frequency > 0 &&\n steering_frequency+last_steered <= cctkGH->cctk_iteration)\n {\n /* Time to steer */\n state->steer = 1;\n last_steered = cctkGH->cctk_iteration;\n }\n else\n {\n state->steer = 0;\n }\n \n if(steering_frequency <= 0)\n {\n /* Once steering is switched off, can't restart it ! */\n steering = 0;\n }\n }\n }\n else\n {\n state->steer = 1;\n }\n\n state->terminate = terminate;\n if(!state->paused)\n { \n state->timeout_seconds = timeout_seconds;\n state->timeout_useconds = timeout_useconds;\n }\n else\n {\n state->timeout_seconds = -1;\n state->timeout_useconds = -1;\n }\n\n return 0;\n}\n\n /*@@\n @routine HTTP_Terminate\n @date Sat Sep 16 21:40:27 2000\n @author Tom Goodale\n @desc \n Terminate the simulation.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nint HTTP_Terminate(cGH *cctkGH)\n{\n HTTP_SteerQueue(\"Cactus\",\"terminate_next\",\"yes\");\n\n return 0;\n}\n\n/********************************************************************\n ********************* Local Routines *************************\n ********************************************************************/\n\n /*@@\n @routine CreatePageData\n @date Wed Sep 13 20:10:24 2000\n @author Tom Goodale\n @desc \n Creates a httpPage structure.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic httpPage *CreatePageData(int (*function)(const cGH *, httpRequest *, void *), void *data)\n{\n httpPage *pagedata = (httpPage *)malloc(sizeof(httpPage));\n\n if(pagedata)\n {\n pagedata->function = function;\n pagedata->data = data;\n }\n\n return pagedata;\n}\n\n /*@@\n @routine FindPage\n @date Wed Sep 13 20:10:24 2000\n @author Tom Goodale\n @desc \n Finds a page, if it exists.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic httpPage *FindPage(const char *path, const char **residual)\n{\n httpPage *pagedata = NULL;\n\n#ifdef HTTP_DEBUG\n printf (\"Searching for '%s'\\n\", path);\n#endif\n\n if(pages && path)\n {\n String *temp = String_New();\n /* Check for index.html */\n if(strlen(path) == 0 || strcmp( path, \"/\") == 0 )\n {\n#ifdef HTTP_DEBUG\n printf(\"Looking for '%sindex.html'\\n\", path);\n#endif\n SetToCString( temp, path);\n ConcatCString( temp,\"index.html\");\n\n pagedata = Httpd_MapData(pages, Length(temp), GetBuffer(temp));\n }\n else if((pagedata = Httpd_MapData(pages, strlen(path), path)))\n {\n /* Or exact path */\n }\n else\n {\n#ifdef HTTP_DEBUG\n printf(\"Looking for '%s/index.html'\\n\", path);\n#endif\n SetToCString( temp, path);\n ConcatCString( temp,\"/index.html\");\n\n pagedata = Httpd_MapData(pages, Length(temp), GetBuffer(temp));\n\n }\n *residual = NULL;\n\n if(!pagedata && strlen( path ) > 0)\n {\n const char *position;\n /* Ok, now cycle through. Know it doesn't end with a slash */\n for(position = path+strlen(path)-1; position >= path; position--)\n {\n if(*position == '/')\n {\n#ifdef HTTP_DEBUG\n printf(\"Looking for '%s' less '%s' \\n\", path, position);\n#endif\n if((pagedata = Httpd_MapData(pages, position-path, path)))\n {\n *residual = position+1;\n break;\n }\n }\n }\n }\n String_Delete( temp );\n temp = NULL;\n }\n\n return pagedata;\n}\n\n /*@@\n @routine StatusUntilIt\n @date Tue Sep 19 22:59:34 2000\n @author Tom Goodale\n @desc \n Is the iteration greater than the desired stop value ?\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int StatusUntilIt (const cGH *cctkGH)\n{\n DECLARE_CCTK_PARAMETERS\n\n\n return (cctkGH && until_it <= cctkGH->cctk_iteration);\n}\n\n\n /*@@\n @routine StatusUntilTime\n @date Tue Sep 19 23:00:16 2000\n @author Tom Goodale\n @desc \n Is the simulation time greater than the stop value ?\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int StatusUntilTime (const cGH *cctkGH)\n{\n DECLARE_CCTK_PARAMETERS\n\n\n return (cctkGH && until_time <= cctkGH->cctk_time);\n}\n\n\n /*@@\n @routine StatusUntilExpression\n @date Tue Sep 19 23:00:47 2000\n @author Tom Goodale\n @desc \n Is the stop expression true ?\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int StatusUntilExpression (cGH *cctkGH)\n{\n DECLARE_CCTK_PARAMETERS\n static char *parsed_expression = NULL;\n static int times_set = -1;\n int retval = 0;\n\n /* See if we need to parse the expression again. */\n int new_times_set = CCTK_ParameterQueryTimesSet(\"until_expression\",\n CCTK_THORNSTRING);\n \n if(new_times_set > times_set)\n {\n times_set = new_times_set;\n if(parsed_expression)\n {\n free(parsed_expression);\n }\n parsed_expression = HTTP_ExpressionParse(until_expression);\n }\n\n if(parsed_expression && strlen(parsed_expression) > 0 && cctkGH)\n {\n /* Make a copy */\n char *copy = Util_Strdup(parsed_expression);\n \n /* Evaluate the expression */\n retval = HTTP_ExpressionEvaluate(copy, evaluator, cctkGH);\n\n /* Free the copy */\n free(copy);\n }\n\n return retval;\n}\n\n\n /*@@\n @routine evaluator\n @date Tue Sep 19 23:07:20 2000\n @author Tom Goodale\n @desc \n Takes the name of a gridscalar and returns its value.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic double evaluator(const char *expression, void *data)\n{\n double retval = 0.0;\n cGH *cctkGH = (cGH *)data;\n int varindex = CCTK_VarIndex(expression);\n\n if(varindex > -1)\n {\n int vartype = CCTK_VarTypeI(varindex);\n int *pointer = CCTK_VarDataPtrI(cctkGH, 0, varindex);\n \n switch(vartype)\n {\n case CCTK_VARIABLE_BYTE :\n retval = *((CCTK_BYTE *)pointer);\n break;\n case CCTK_VARIABLE_INT :\n retval = *((CCTK_INT *)pointer);\n break;\n case CCTK_VARIABLE_REAL :\n retval = *((CCTK_REAL *)pointer);\n break;\n default :\n CCTK_WARN( 0, \"Unsupported variable type\" );\n retval = 0.0;\n }\n }\n else if(CCTK_Equals(expression,\"time\"))\n {\n retval = cctkGH->cctk_time;\n }\n else if(CCTK_Equals(expression,\"iteration\"))\n {\n retval = cctkGH->cctk_iteration;\n } \n else\n {\n retval = strtod(expression,NULL);\n }\n\n return retval;\n}\n", "SStringIO.h": " /*@@\n @file SStringIO.h\n @date 02.04.2004\n @author Steve White\n @desc Extensions to Strings module involvint file IO\n @enddesc\n @version $Header$\n @@*/\n#ifndef _SSTRINGIO_H\n#define _SSTRINGIO_H\n\n#include \"SString.h\"\n#include \n\n#ifdef __cplusplus\nextern \"C\"\n{\n#endif\n\t\t\t\t/* File utilities */\nString *\tStringReadToDelimiter( String *str, FILE * file, char delim );\nString *\tStringReadToEndOfLine( String *str, FILE * is );\nString *\tStringReadLine( String *str, FILE * is );\n\nvoid\t\tStringPrintToFile( const String *str, FILE * is );\nvoid\t\tStringFormatPrintToFile( const String *str, const char *format,\n\t\t\t\t\tFILE * is );\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n", "httpRequest.h": " /*@@\n @header httpRequest.h\n @date Wed Sep 13 23:49:30 2000\n @author Tom Goodale\n @desc \n Was http_Request.h\n @enddesc\n @version $Header$\n @@*/\n\n\n#ifndef __HTTP_REQUEST_H__\n#define __HTTP_REQUEST_H__ 1\n\ntypedef struct HTTPSocketTag httpSocket;\ntypedef struct HTTPArg httpArg;\n/* This is the main structure for storing data about a request. */\ntypedef struct httpRequestTag httpRequest;\n\n\n#ifdef __cplusplus\nextern \"C\" \n{\n#endif\n\nint HTTP_RegisterPage(const char *path,\n int (*function)(const cGH *, httpRequest *, void *),\n void *data);\n\nconst char *HTTP_ArgumentValue(const httpRequest *request, const char *arg);\nconst httpArg *HTTP_ArgumentWalk(httpRequest *request, int first);\n\nconst char *HTTP_HeaderValue(const httpRequest *request, const char *header);\n\nint HTTP_Write(httpRequest *request, const char *buffer, size_t count);\nint HTTP_Read(httpRequest *request, char *buffer, size_t count);\n\nint HTTP_Send( httpRequest *request, const char * message );\nvoid HTTP_SendOKHeader( httpRequest *request);\nvoid HTTP_SendOKRefreshHeader( httpRequest *request, int secs );\n\nunsigned long int HTTP_Port(void);\n\nunsigned int HTTP_MajorVersion( const httpRequest *request );\nunsigned int HTTP_MinorVersion( const httpRequest *request );\nconst char * HTTP_URI( const httpRequest *request );\nvoid HTTP_SetResidual( httpRequest *request, const char *residual );\nconst char * HTTP_Residual( const httpRequest *request );\nunsigned int HTTP_NumArguments( const httpRequest *request );\nconst char * HTTP_GetArgument( const httpRequest *request, unsigned int index );\nhttpSocket * HTTP_Connection( const httpRequest *request );\nconst char * HTTP_ArgName( const httpArg *arg );\nconst char * HTTP_ArgValue( const httpArg *arg );\n#ifdef __cplusplus\n}\n#endif\n\n#include \"httpSString.h\"\n\n#endif /* __HTTP_REQUEST_H__ */\n", "SStringIO_Namespace.h": " /*@@\n @file SStringIO_Namespace.h\n @date 02.04.2004\n @author Steve White\n @desc Extensions to Strings module involvint file IO\n @enddesc\n @version $Header$\n @@*/\n#ifndef _SSTRINGIO_NAMESPACE_H\n#define _SSTRINGIO_NAMESPACE_H\n\n#include \"SStringIO.h\"\n\n#define ReadToDelimiter( a, f, d )\tStringReadToDelimiter( a, f, d )\n#define ReadToEndOfLine( a, f )\t\tStringReadToEndOfLine( a, f )\n#define ReadLine( a, f )\t\tStringReadLine( a, f )\n#define PrintToFile( a, f )\t\tStringPrintToFile( a, f )\n#define FormatPrintToFile( a, s, f )\tStringFormatPrintToFile( a, s, f )\n\n#endif\n", "httpd.h": " /*@@\n @header httpd.h\n @date Wed Sep 13 20:15:23 2000\n @author Tom Goodale\n @desc \n \n @enddesc\n @version $Header$\n @@*/\n\n#include \"httpRequest.h\"\n\n#ifndef __HTTPD_H__\n#define __HTTPD_H__ 1\n\ntypedef struct\n{\n int steer;\n int paused;\n int terminate;\n int timeout_seconds;\n int timeout_useconds;\n} httpState;\n\n#ifdef __cplusplus\nextern \"C\" \n{\n#endif\n\nint HTTP_ReadFromClient (cGH *cctkGH, void *connection);\n\nint HTTP_SetupServer(int port, int queue_size, int hunt);\nint HTTP_ShutdownServer(void);\n\nint HTTP_Poll(cGH *cctkGH, long sec, long usec);\n\n/* Request stuff */\nint HTTP_RequestGET(cGH *cctkGH, httpRequest *request);\nint HTTP_RequestUnsupported(cGH *cctkGH, httpRequest *request);\n\n/* State stuff */ \nint HTTP_UpdateState(cGH *cctkGH, httpState *state);\nint HTTP_Terminate(cGH *cctkGH);\n\n/* Content stuff */\nint HTTP_RegisterPages(void);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* __HTTP_H__ */\n", "SString.c": "/*@@\n @file SString.c\n @date 02.04.2004\n @author Steve White\n @desc Module for generic operations on strings\n @enddesc\n @version $Header$\n @@*/\n\n#include \"SString.h\"\n#include \"SStringIO.h\"\n\n#include \n#include \n\n#include \"util_String.h\"\n\n#ifndef MIN\n#define MIN( a, b ) ( (a) < (b) ? (a) : (b) )\n#endif\n#ifndef MAX\n#define MAX( a, b ) ( (a) > (b) ? (a) : (b) )\n#endif\n\ntypedef enum { MAKE_NULL_ALLOC, NEW_NULL_ALLOC, BUFFER_NULL_ALLOC }\nSSTRING_ERROR;\nstatic void String_HandleSeriousError( SSTRING_ERROR );\n\n#define LINE_END_BUFSIZE 3\n\ntypedef struct String_tag\n{\n size_t length;\n SSCHAR *chars;\n SSCHAR line_end[LINE_END_BUFSIZE];\n} String_placeholder;\n\nstatic SSCHAR kLineEndChar = '\\n';\n\nstatic SSBOOL BufferForThisManyChars( String *s, size_t size );\n\nsize_t\nStringLength( const String * s )\n{\n return s->length;\n}\n\nconst SSCHAR *\nStringGetBuffer( const String * s )\n{\n return s->chars;\n}\n\nvoid\nStringCopyBuffer( const String * s, SSCHAR * buf, size_t bufSize )\n{\n strncpy( buf, s->chars, bufSize );\n buf[bufSize-1] = '\\0';\n}\n\n/*\n * Returns 0 if index is not in the string\n */\nSSCHAR\nStringNthChar( const String * s, size_t n )\n{\n if( n < s->length )\n {\n return s->chars[n];\n }\n else\n {\n return '\\0';\n }\n}\n\nString *\nString_New()\n{\n String *s = (String *)calloc( 1, sizeof( String ) );\n if( s != NULL )\n {\n BufferForThisManyChars( s, 0 );\n }\n else\n {\n String_HandleSeriousError( NEW_NULL_ALLOC );\n } \n return s;\n}\n\nString *\nString_Make( const SSCHAR * c_string )\n{\n String *s = (String *)calloc( 1, sizeof( String ) );\n if( s != NULL )\n {\n if( c_string != NULL )\n {\n size_t len = strlen( c_string );\n s->chars = strdup( c_string );\n s->length = len;\n }\n else\n {\n BufferForThisManyChars( s, 0 );\n }\n s->line_end[0] = kLineEndChar;\n }\n else\n {\n String_HandleSeriousError( MAKE_NULL_ALLOC );\n }\n return s;\n}\n\n/* note this is a little ambiguous.\n * needs to be made clear this makes a new string\n */\nString *\nString_Copy( const String * other )\n{\n String *s = StringSetToCString( String_New(),\n StringGetBuffer( other ) );\n memcpy( s->line_end, other->line_end, LINE_END_BUFSIZE\n * sizeof( SSCHAR ) );\n return s;\n}\n\nvoid\nString_Delete( String * s )\n{\n if( s != NULL )\n {\n free( s->chars );\n }\n free( s );\n}\n\nString *\nStringTruncate( String * s, size_t n )\n{\n if( n < s->length )\n {\n s->chars[n] = '\\0';\n s->length = n;\n }\n return s;\n}\n\nString *\nStringTrimLeading( String * s, size_t n )\n{\n const size_t orig_len = StringLength( s );\n\n if( orig_len > 0 && n > 0 )\n {\n const size_t position = MIN( orig_len, n ) - 1;\n const size_t new_len = orig_len - position;\n \n memmove( s->chars, s->chars + position, new_len );\n s->chars[new_len] = '\\0';\n s->length = new_len;\n }\n return s;\n}\n\nString *\nStringSetNthChar( String * s, size_t n, SSCHAR c )\n{\n if( n < s->length )\n {\n if( c == '\\0' )\n {\n StringTruncate( s, n );\n }\n else\n {\n s->chars[n] = c;\n }\n }\n return s;\n}\n/* Allocates if there is no buffer\n * Re-allocates (without changing remaining string) if there is a buffer\n * Puts a null char at the location of the corresponding size\n * DOES NOT pad with zeros, or initialize the buffer beyond this\n */\nSSBOOL\nBufferForThisManyChars( String *s, size_t size )\n{\n const size_t blocksize = sizeof( SSCHAR ) * ( size + 1 );\n\n if( s->chars == NULL )\n {\n s->chars = (SSCHAR *)malloc( blocksize );\n }\n else if( s->length < size )\n {\n s->chars = (SSCHAR *)realloc( s->chars, blocksize );\n }\n else if( s->length > ( size << 1 ) ) /* Don't resize if larger\n but in ballpark */\n {\n s->length = 0;\n s->chars = (SSCHAR *)malloc( blocksize );\n }\n\n if( s->chars != NULL )\n {\n s->length = size;\n if( s->chars != NULL )\n s->chars[size] = '\\0';\n }\n else\n {\n String_HandleSeriousError( BUFFER_NULL_ALLOC );\n }\n\n return s->chars != NULL;\n}\n\nString *\nStringSetToCString( String * s, const SSCHAR *c_string )\n{\n return StringSetToBuffer( s, c_string, strlen( c_string ) );\n}\n\nsize_t\nStringSetNextToken( const String *s, String *token,\n const SSCHAR *delim, size_t start )\n{\n if( start < s->length )\n {\n const size_t ndelims = strlen( delim );\n size_t next = s->length;\n size_t d;\n\n for( d = 0; d < ndelims; d++ )\n {\n size_t nextDelim = start;\n if( StringFindCharFrom( s, delim[d], &nextDelim ) )\n next = MIN( nextDelim, next ); \n }\n\n StringSetRange( token, s, start, next - start );\n\n return next < s->length ? next + 1 : next;\n }\n else\n {\n return 0;\n }\n}\n\nString *\nStringConcatCString( String * s, const SSCHAR *c_string )\n{\n const size_t orig_len = s->length;\n if( BufferForThisManyChars( s, orig_len + strlen( c_string ) ) )\n {\n strcpy( s->chars + orig_len, c_string );\n }\n return s;\n}\n\nString *\nStringSetToBuffer( String * s, const SSCHAR *buf, size_t len )\n{\n if( s != NULL && buf != NULL )\n if( BufferForThisManyChars( s, len ) )\n {\n strncpy( s->chars, buf, len );\n s->chars[ len ] = '\\0';\n }\n return s;\n}\n\nString *\nStringSet( String * s, const String * other )\n{\n return StringSetToCString( s, StringGetBuffer( other ) );\n}\n/*\n * Take care! What if this String's buffer is the same as the other's?\n * For now, this can happen only if the other String is the same as this\n * String.\n *\n * This needs thought for every String that takes a String argument,\n * and for the ones that take C strings as well.\n */\nString *\nStringSetRange( String * s, const String * other,\n size_t first, size_t length )\n{\n const size_t other_length = other->length;\n const size_t veryFirst = MIN( first + 1, other_length ) - 1,\n minLength = MIN( first + length, other_length ),\n newLength = minLength - veryFirst;\n\n return StringSetToBuffer( s, other->chars + veryFirst, newLength );\n}\n\nString *\nStringSetToPartAfter( String * s, const String * other, size_t position )\n{\n return StringSetRange( s, other,\n position + 1, StringLength( other ) - position );\n}\n\n/*\n * Last argument 'position' is both input and output.\n * Specifies where to begin search: pass 0 to search whole string\n * On output, is position where char was found.\n */\nSSBOOL\nStringFindCharFrom( const String *s, SSCHAR theChar, size_t * position )\n{\n SSCHAR * charPtr;\n\n if( s->length > 0\n && position\n && *position < s->length\n && ( charPtr = (SSCHAR *)strchr( s->chars + *position, theChar ) )\n != NULL )\n {\n *position = ( charPtr - s->chars ) / sizeof( SSCHAR );\n return SSTRUE;\n }\n return SSFALSE;\n}\n\nSSBOOL\nStringFindStringFrom( const String * s, const String * other,\n size_t * position )\n{\n SSCHAR * charPtr;\n\n if( s->length >= other->length\n && position\n && *position < s->length\n && s->length > 0\n && other->length > 0\n && ( charPtr = (SSCHAR *)strstr( s->chars + *position, other->chars ) )\n != NULL )\n {\n *position = ( charPtr - s->chars ) / sizeof( SSCHAR );\n return SSTRUE;\n }\n return SSFALSE;\n}\n\nSSBOOL\nStringEquals( const String * a, const String * b )\n{\n if( a->length > 0 )\n {\n return strncmp( a->chars, b->chars, a->length ) == 0;\n }\n else if( b->length == 0 )\n {\n return SSTRUE;\n }\n return SSFALSE;\n}\n\nint\nStringCompare( const String * a, const String * b )\n{\n return StringCompareCString( a, b->chars );\n}\n\nint\nStringCompareCString( const String * a, const char * b )\n{\n const size_t length = MIN( a->length, strlen( b ) );\n\n if( length > 0 )\n {\n return strncmp( a->chars, b, length );\n }\n else if( strlen( b ) == 0 )\n {\n return 0;\n }\n else /* b is empty but a isn't */\n {\n return 1;\n }\n}\n\nString *\nStringInsert( String * s, const String * other, size_t position )\n{\n const size_t oldLength = s->length, otherLength = other->length;\n String *old = String_Copy( s );\n\n if( otherLength > 0\n && position <= oldLength\n && BufferForThisManyChars( s, oldLength + otherLength ) )\n {\n if( position != 0 )\n {\n strncpy( s->chars, old->chars, position );\n }\n\n strncpy( s->chars + position, other->chars, otherLength );\n\n if( position < oldLength )\n {\n strncpy( s->chars + position + otherLength,\n old->chars + position, oldLength - position );\n }\n s->chars[s->length] = '\\0';\n }\n String_Delete( old );\n\n return s;\n}\n\nString *\nStringInsertCString( String * s, const char * c_string, size_t position )\n{\n String *other = String_Make( c_string );\n StringInsert( s, other, position );\n String_Delete( other );\n return s;\n}\n/*\n * What to do if position is off end of string? We do nothing\n */\nString *\nStringInsertChar( String * s, SSCHAR c, size_t position )\n{\n if( position <= s->length )\n {\n BufferForThisManyChars( s, s->length + 1 );\n if( position + 2 < s->length )\n {\n s->chars[s->length] = '\\0';\n memmove( s->chars + position + 1, s->chars + position,\n s->length - 1 - position );\n s->chars[position] = c;\n }\n }\n return s;\n}\n\nString *\nStringDeleteChar( String * s, size_t position )\n{\n return StringDeleteRange( s, position, position );\n}\n\nString *\nStringDeleteRange( String * s, size_t begin, size_t end )\n{\n if( begin <= end && end < s->length )\n {\n if( end + 1 < s->length )\n {\n memmove( s->chars + begin, s->chars + end + 1,\n ( s->length - end ) - 1 );\n }\n s->length -= end - begin + 1;\n s->chars[s->length] = '\\0';\n }\n return s;\n}\n\nString *\nStringConcat( String * s, const String * other )\n{\n return StringInsert( s, other, s->length );\n}\n\n/*\n * On unix the default \\n works; on the Mac, you might want \\r\n */\nvoid\nStringSetLineEndCharacter( String * s, const SSCHAR *end )\n{\n strncpy( s->line_end, end, LINE_END_BUFSIZE );\n s->line_end[LINE_END_BUFSIZE - 1] = '\\0';\n}\n\nString *\nStringReadToEndOfLine( String * s, FILE * file )\n{\n return StringReadToDelimiter( s, file, kLineEndChar );\n}\n\nString *\nStringReadToDelimiter( String * s, FILE * file, SSCHAR delim )\n{\n int next;\n\n while( ( next = fgetc( file ) ) != EOF \n && (SSCHAR)next != delim )\n {\n StringInsertChar( s, (SSCHAR)next, s->length );\n }\n\n return s;\n}\n\nvoid\nStringPrint( const String * s )\n{\n fprintf( stdout, \"%s\", s->chars );\n}\n\nvoid\nStringPrintToFile( const String * s, FILE * file )\n{\n fprintf( file, \"%s\", s->chars );\n}\n\nvoid\nStringFormatPrint( const String * s, const SSCHAR *format )\n{\n fprintf( stdout, format, s->chars );\n}\n\nvoid\nStringFormatPrintToFile( const String * s, const SSCHAR *format, FILE * file )\n{\n fprintf( file, format, s->chars );\n}\n\n#define DECIMALBUFSIZE 64\nString *\nStringConcatDecimal( String * s, long d )\n{\n char buf[DECIMALBUFSIZE] = { '\\0' };\n Util_snprintf( buf, sizeof( buf ), \"%ld\", d );\n return StringConcatCString( s, buf );\n}\n\nString *\nStringConcatDouble( String * s, double d )\n{\n char buf[DECIMALBUFSIZE] = { '\\0' };\n Util_snprintf( buf, sizeof( buf ), \"%f\", d );\n return StringConcatCString( s, buf );\n}\n/*\n *\n * 0) It's inappropritate to handle string and character convesions.\n * And there are some very specific-use conversions, such as 't'\n *\n * 1) I'm not sure I completely understand all the conversions. \n * specifically, I don't get G and g.\n *\n * 2) There are several standards, including C99 and SUSv2\n *\n * 3) I haven't done long long or long double\n *\n * 4) Mixed up notions of unsigned with hex and octal...wrong?\n *\n * \n * \n */\nstatic void\naddNumericMods( char * format, SSFORMAT f )\n{\n strcat( format, \"%\" );\n if( f & SFMT_LEFT_ALIGN )\n {\n strcat( format, \"-\" );\n }\n if( f & SFMT_PRINT_SIGN )\n {\n strcat( format, \"+\" );\n }\n if( f & SFMT_ADD_SIGN_SPACE )\n {\n strcat( format, \" \" );\n }\n if( f & SFMT_PAD_ZERO )\n {\n strcat( format, \"0\" );\n }\n if( f & SFMT_ALT )\n {\n strcat( format, \"#\" );\n }\n}\n#define EMPTYSTRING { '\\0' }\nString *\nStringConcatFormattedDecimal( String *s, long int d,\n int width, int precision, SSINT_FORMAT f )\n{\n char buf[DECIMALBUFSIZE] = EMPTYSTRING;\n char format[16] = EMPTYSTRING;\n addNumericMods( format, f );\n strcat( format, \"*.*ld\" );\n Util_snprintf( buf, sizeof( buf ), format, width, precision, d );\n return StringConcatCString( s, buf );\n}\n\nString *\nStringConcatFormattedUnsigned( String *s, unsigned long int n,\n int width, int precision, SSINT_FORMAT f )\n{\n char buf[DECIMALBUFSIZE] = EMPTYSTRING;\n char format[16] = EMPTYSTRING;\n addNumericMods( format, f );\n strcat( format, \"*.*l\" );\n if( f & SFMT_HEX )\n {\n if( f & SFMT_LOWERCASE )\n {\n strcat( format, \"x\" );\n }\n else\n {\n strcat( format, \"X\" );\n }\n }\n else if( f & SFMT_OCTAL )\n {\n strcat( format, \"o\" );\n }\n else\n {\n strcat( format, \"u\" );\n }\n Util_snprintf( buf, sizeof( buf ), format, width, precision, n );\n return StringConcatCString( s, buf );\n}\n\nString *\nStringConcatFormattedDouble( String *s, double d,\n int width, int precision, SSDOUBLE_FORMAT f )\n{\n char buf[DECIMALBUFSIZE] = EMPTYSTRING;\n char format[16] = EMPTYSTRING;\n addNumericMods( format, f );\n if( f & SFMT_ALWAYS_POINT )\n {\n strcat( format, \"#\" );\n }\n strcat( format, \"*.*\" );\n if( f & SFMT_EXPONENTIAL )\n {\n if( f & SFMT_LOWERCASE )\n {\n strcat( format, \"e\" );\n }\n else\n {\n strcat( format, \"E\" );\n }\n }\n if( f & SFMT_DISCRETIONARY_EXP )\n {\n if( f & SFMT_LOWERCASE )\n {\n strcat( format, \"g\" );\n }\n else\n {\n strcat( format, \"G\" );\n }\n }\n else\n {\n strcat( format, \"f\" );\n }\n Util_snprintf( buf, sizeof( buf ), format, width, precision, d );\n return StringConcatCString( s, buf );\n}\n\nvoid\nString_HandleSeriousError( SSTRING_ERROR e )\n{\n /* to be filled in on a per-implementation basis */\n}\n\n", "Headers.c": " /*@@\n @file Headers.c\n @date Wed Sep 17 23:47:43 2000\n @author Gabrielle Allen\n @desc \n Functions to return standard headers and footers for HTML pages\n @enddesc\n @version $Header$\n @@*/\n\n#include \"cctk.h\"\n\n#include \"util_String.h\"\n\n#include \"SString_Namespace.h\"\n#define EMPTYSTRING { '\\0' }\n\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusConnect_HTTPD_Headers_c)\n\n/********************************************************************\n ********************* Local Data Types ***********************\n ********************************************************************/\n\nextern struct httpLink *ContentLinks;\n\nstruct httpLink\n{\n struct httpLink *next;\n char *URL;\n char *name;\n char *description;\n int flags;\n};\n\n/********************************************************************\n ********************* Local Routine Prototypes *********************\n ********************************************************************/\n\n/********************************************************************\n ********************* Other Routine Prototypes *********************\n ********************************************************************/\n\n\n/********************************************************************\n ********************* Local Data *****************************\n ********************************************************************/\n\nstatic const char *cactus_styles =\n\"\\n\";\n\nstatic const char *cactus_footer =\n\"\\n\\n\"\n\"\\n\\n\"\n\"\\n\\n\"\n\"\\n\"\n\"

    \\n\"\n\"\"\n\"\\\"www.CactusCode.org\\\"\\n\"\n\"\"\n\"Cactus Web Interface by \\n\"\n\"The Cactus Team
    \\n\"\n\"About this Server\\n\"\n\"
    \\n\"\n\"\\n\"\n\"\\n\";\n\nstatic const char * cactus_doctype = \n\"\\n\"\n\"\\n\";\n\n/********************************************************************\n ********************* External Routines **********************\n ********************************************************************/\n\nvoid HTTP_SetHeadInfo( String *header)\n{\n SetToCString( header, cactus_styles );\n ConcatCString( header, \"\\n\");\n}\nvoid HTTP_SetDoctype( String *header)\n{\n SetToCString( header, cactus_doctype );\n}\n /*@@\n @routine HTTP_ContentHeader\n @date Sat Sep 16 15:22:59 2000\n @author Gabrielle Allen\n @desc \n Returns header for HTML pages\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nextern void CCTK_GetRunTitleString( String *s );\n\nint HTTP_SetContentHeaderString(const cGH *GH, int choice, \n String *header, const String *menu)\n{\n String *title = String_New();\n String *quicklinks = String_New();\n char parfile[200] = EMPTYSTRING;\n char currentdate[50] = EMPTYSTRING;\n char currenttime[50] = EMPTYSTRING;\n struct httpLink *link;\n char *file;\n char *dir;\n\n Truncate( header,0);\n\n if (choice == 0)\n {\n ConcatCString( header, \"\\n\"\n \"\\n\"\n \"\\n
    \\n\"\n \"

    Master Run Page

    \\n\");\n }\n\n if(ContentLinks)\n {\n SetToCString( quicklinks,\"

    Options:

    \\n\");\n for(link = ContentLinks; link; link=link->next)\n {\n ConcatCString(quicklinks, \"URL);\n ConcatCString(quicklinks, \"\\\">\");\n ConcatCString(quicklinks, link->name);\n ConcatCString(quicklinks, \"
    \\n\");\n }\n }\n \n if (choice == 0)\n {\n /* Find strings needed for nonmain-page headers */\n CCTK_GetRunTitleString(title); \n CCTK_ParameterFilename(sizeof(parfile),parfile);\n Util_SplitFilename(&dir,&file,parfile);\n\n Util_CurrentDate(sizeof(currentdate),currentdate);\n Util_CurrentTime(sizeof(currenttime),currenttime);\n\n /* Build the header */\n ConcatCString( header, \"\\n\"\n \"

    Environment:

    \\n\"\n \"Time: \");\n ConcatCString( header, currenttime );\n ConcatCString( header, \"
    \\n\"\n \"Date: \" );\n ConcatCString( header, currentdate );\n ConcatCString( header, \"
    \\n\" );\n ConcatCString( header, \"

    Simulation:

    \\n\"\n \"\");\n Concat( header, title );\n ConcatCString( header, \"
    \\n\"\n \"\");\n ConcatCString( header, file );\n ConcatCString( header, \"
    \\n\"\n \"Iteration: \");\n ConcatDecimal( header, GH ? GH->cctk_iteration : 0 );\n ConcatCString( header, \"
    \\nPhysical time: \");\n ConcatFormattedDouble( header, GH ? GH->cctk_time : 0, 4, 2, SFMT_DEFAULT );\n ConcatCString( header, \"
    \\n\");\n if (ContentLinks)\n {\n Concat( header, quicklinks);\n }\n\n if (menu)\n {\n Concat( header, menu);\n }\n\n ConcatCString( header, \n \"
    \\n\\n\");\n }\n\n String_Delete( quicklinks );\n String_Delete( title );\n return Length(header);\n\n}\n\n /*@@\n @routine HTTP_ContentFooter\n @date Sat Sep 16 15:22:59 2000\n @author Tom Goodale\n @desc \n Returns footer for HTML pages\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nint HTTP_SetContentFooterString(const cGH *GH, int choice, String *footer)\n{\n /* avoid compiler warnings about unused parameters */\n GH = GH;\n choice = choice;\n\n Truncate( footer, 0 );\n SetToCString(footer,cactus_footer);\n return Length(footer);\n}\n\nint HTTP_ContentHeader(const cGH *GH, int choice, int len,\n char *header, const char *menu)\n{\n String *menuString = NULL;\n String *headerString = String_New();\n int retval = 0;\n \n if( menu )\n menuString = String_Make( menu );\n\n retval = HTTP_SetContentHeaderString( GH, choice, headerString, menuString );\n\n /* SW: original didn't use len, although it was clearly meant\n * to indicate the length of the buffer, and all calls I saw to it\n * passed a buffer length */\n if( len > 0 )\n {\n SetToBuffer( headerString, header, len );\n }\n String_Delete( menuString );\n String_Delete( headerString );\n return retval;\n}\n\nint HTTP_ContentFooter(const cGH *GH, int choice, int len, char *header)\n{\n String *headerString = String_New();\n int retval = 0;\n \n retval = HTTP_SetContentFooterString( GH, choice, headerString );\n\n /* note: original didn't use len, although it was clearly meant\n * to indicate the length of the buffer, and all calls I saw to it\n * passed a buffer length */\n if( len > 0 )\n {\n SetToBuffer( headerString, header, len );\n }\n String_Delete( headerString );\n return retval;\n}\n", "Cookies.c": " /*@@\n @file Cookies.c\n @date Mon Sep 18 21:08:37 2000\n @author Tom Goodale\n @desc \n Cookie stuff.\n @enddesc \n @version $Header$\n @@*/\n\n#include \"cctk.h\"\n\n#include \n\n#include \"util_String.h\"\n\n#include \"httpRequest.h\"\n#include \"Cookies.h\"\n#include \"SString_Namespace.h\"\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusConnect_HTTPD_Cookies_c)\n\n/********************************************************************\n ********************* Local Data Types ***********************\n ********************************************************************/\n\n/********************************************************************\n ********************* Local Routine Prototypes *********************\n ********************************************************************/\n\n/********************************************************************\n ********************* Other Routine Prototypes *********************\n ********************************************************************/\n\n/********************************************************************\n ********************* Local Data *****************************\n ********************************************************************/\n\n/********************************************************************\n ********************* External Routines **********************\n ********************************************************************/\n\n /*@@\n @routine HTTP_CookieSend\n @date Mon Sep 18 22:42:35 2000\n @author Tom Goodale\n @desc \n Sends a cookie to a browser.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nint HTTP_CookieSend(httpRequest *request,\n const char *name, \n const char *value, \n const char *path,\n const char *domain,\n const char *expires,\n int secure)\n{\n String *message = String_New();\n\n SetToCString(message, \"Set-Cookie: \");\n ConcatCString(message, name);\n ConcatCString(message, \"=\");\n ConcatCString(message, value);\n\n if(path)\n {\n ConcatCString(message, \"; path=\");\n ConcatCString(message, path);\n }\n\n if(domain)\n {\n ConcatCString(message, \"; domain=\");\n ConcatCString(message, domain);\n }\n\n if(expires)\n {\n ConcatCString(message, \"; expires=\");\n ConcatCString(message, expires);\n }\n\n if(secure)\n {\n ConcatCString(message, \"; secure\");\n } \n\n ConcatCString(message, \"\\r\\n\");\n\n HTTP_SendString(request, message);\n\n String_Delete( message );\n return 0;\n}\n\n /*@@\n @routine HTTP_CookieCancel\n @date Mon Sep 18 22:43:04 2000\n @author Tom Goodale\n @desc \n Cancels a cookie.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nint HTTP_CookieCancel(httpRequest *request,\n const char *name, \n const char *path)\n{\n String *message = String_New();\n\n /* Clear the value */\n SetToCString(message, \"Set-Cookie: \");\n ConcatCString(message, name);\n ConcatCString(message, \"=\");\n\n if(path)\n {\n ConcatCString(message, \"; path=\");\n ConcatCString(message, path);\n }\n\n /* Pick a date in the past */\n ConcatCString(message, \"; expires Sun Sep 17 21:57:45 CEST 2000\");\n ConcatCString(message, \"\\r\\n\");\n\n HTTP_SendString(request, message);\n\n String_Delete( message );\n return 0;\n}\n\n /*@@\n @routine HTTP_CookieGet\n @date Mon Sep 18 22:43:20 2000\n @author Tom Goodale\n @desc\n Gets the value of a cookie from a request.\n The allocated return string must be freed by the caller.\n @enddesc\n@@*/\n\nchar *HTTP_CookieGet(httpRequest *request, const char *cookie_name)\n{\n char *cookie_value = NULL;\n String *attribute = String_Make(\"Cookie\");\n String *header = String_New();\n\n /* Get the cookie header */\n if( HTTP_GetHeaderValueString( request, attribute, header ) )\n {\n size_t value_start = 0;\n String *name = String_Make( cookie_name );\n ConcatCString (name, \"=\");\n\n /* Search for \"=\" */\n if (FindStringFrom (header, name, &value_start))\n {\n /* truncate \"\" at the next ';' char */\n size_t value_end = value_start + StringLength (name);\n value_start = value_end;\n if (FindCharFrom (header, ';', &value_end))\n {\n StringTruncate (header, value_end);\n }\n cookie_value = Util_Strdup (GetBuffer (header) + value_start);\n }\n String_Delete(name);\n }\n String_Delete(header);\n String_Delete(attribute);\n\n return cookie_value;\n}\n\n/********************************************************************\n ********************* Local Routines *************************\n ********************************************************************/\n\n", "Redirect.h": " /*@@\n @header Redirect.h\n @date Fri May 18 11:08:25 2001\n @author Tom Goodale\n @desc \n Rdirection stuff. Was http_Redirect.h.\n @enddesc\n @version\n @@*/\n#ifndef _HTTP_REDIRECT_H_\n#define _HTTP_REDIRECT_H_ 1\n\n#ifdef __cplusplus\nextern \"C\" \n{\n#endif\n\nint HTTP_SetupRedirect(int port, \n int queue_size,\n int hunt);\n\nint HTTP_RegisterRedirect(void);\n\nconst char *HTTP_Master(void);\nint HTTP_IsServer(void);\nint HTTP_IsRedirect(void);\n\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* _HTTP_REDIRECT_H_ */\n", "Redirect.c": " /*@@\n @file Redirect.c\n @date Fri May 18 10:03:15 2001\n @author Tom Goodale\n @desc\n File to contain John Shalf's HTTP redirect stuff.\n @enddesc\n @version $Id$\n @@*/\n\n#include \n#include \n\n#include \"cctk.h\"\n\n#ifdef CCTK_MPI\n#include \n#endif /* CCTK_MPI */\n\n#include \"util_Network.h\" /* Util_GetHostName() */\n\n#include \"httpd.h\"\n\n#include \"httpRequest.h\"\n#include \"Content.h\"\n\n#include \"Redirect.h\"\n#include \"SString_Namespace.h\"\n\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusConnect_HTTPD_Redirect_c)\n\n/********************************************************************\n ********************* Local Data Types ***********************\n ********************************************************************/\n\n/********************************************************************\n ********************* Local Routine Prototypes *********************\n ********************************************************************/\n\nstatic void RegisterRedirect(void);\nstatic int RedirectPage(const cGH *cctkGH, httpRequest *request, void *data);\n\n/********************************************************************\n ********************* Other Routine Prototypes *********************\n ********************************************************************/\n\n/********************************************************************\n ********************* Local Data *****************************\n ********************************************************************/\n\nstatic char httpredirect=0;\nstatic char httpmaster[1024];\n\n/********************************************************************\n ********************* External Routines **********************\n ********************************************************************/\n\n /*@@\n @routine HTTP_SetupRedirect\n @date Wed April 20 20:39:15 2001\n @author John Shalf\n @desc\n Creates a socket to listen on purely for server redirect to the root node.\n @enddesc\n @calls\n @calledby\n @history\n\n @endhistory\n\n@@*/\n\n#define ADDRLEN 1024\n\nint HTTP_SetupRedirect(int port,\n int queue_size,\n int hunt)\n{\n int retval = 0;\n /* should not hunt */\n int i;\n char hostnm[ADDRLEN] = EMPTYSTRING;\n char *alladdr;\n\n int nprocs = CCTK_nProcs(NULL);\n int proc = CCTK_MyProc(NULL);\n\n#ifdef HTTPD_DEBUG\n CCTK_INFO(\"enter setup redirect------------\");\n#endif\n memset(hostnm,0,sizeof(hostnm));\n Util_GetHostName(hostnm, sizeof(hostnm));\n alladdr = (char *) calloc (sizeof(hostnm), nprocs);\n\n#ifdef CCTK_MPI\n { /* push stack */\n#ifdef HTTPD_DEBUG\n CCTK_INFO(\"all gather\");\n#endif\n\n MPI_Allgather(hostnm,sizeof(hostnm),MPI_CHAR,\n alladdr,sizeof(hostnm),MPI_CHAR,\n MPI_COMM_WORLD);\n#ifdef HTTPD_DEBUG\n CCTK_INFO(\"collected\");\n#endif\n }\n#endif\n\n /* set our master */\n#ifdef HTTPD_DEBUG\n printf(\"alladdr is %s\\n\", alladdr);\n#endif\n strncpy(httpmaster,alladdr, sizeof(httpmaster)); /* the 0th element is the master hostname */\n httpmaster[sizeof(httpmaster) - 1] = '\\0';\n\n /* so compare my addr to the list sequentially */\n for(i=0;ih_length;\n if(addrlen>sizeof(CCTK_INT8)) addrlen=CCTK_INT8;\n addr=0;\n memcpy(&addr,he->h_addr,addrlen);\n return addr;\n}\n#endif\n\n\n\n/********************************************************************\n ********************* Local Routines *************************\n ********************************************************************/\n\n /*@@\n @routine RegisterRedirect\n @date Fri April 20 23:47:43 2001\n @author John Shalf\n @desc\n Redirection Page Registration.\n @enddesc\n @calls\n @calledby\n @history\n\n @endhistory\n\n@@*/\nstatic void RegisterRedirect(void)\n{\n#ifdef HTTP_DEBUG\n printf(\"Registering Redirection Page\");\n#endif\n HTTP_RegisterPage(\"/index.html\",RedirectPage,NULL);\n}\n\n /*@@\n @routine RedirectPage\n @date Fri April 20 23:47:43 2001\n @author John Shalf\n @desc\n Redirects the webbrowser to the main server page\n @enddesc\n @calls\n @calledby\n @history\n @hdate Thu Sep 14 10:54:22 2000 @hauthor John Shalf\n @hdesc For clusters where its difficult to know which node is going to\n have the webserver process, this opens a port on *all* distinct nodes\n and redirects all web connection attempts to the root node for processing.\n @endhistory\n\n@@*/\n\nstatic int RedirectPage(const cGH *cctkGH, httpRequest *request, void *data)\n{\n int retval = -1;\n String *message = String_New();\n\n /* avoid compiler warning about unused parameter */\n data = data;\n\n HTTP_SendOKHeader(request);\n\n /* Start the page */\n SetToCString(message,\"Server Redirect\\n\");\n /* Write out the main header part */\n HTTP_SendString(request, message);\n SetToCString(message,\"\\n\\n\\n\");\n HTTP_SendString(request,message);\n /* ********** Server Redirect To Master ************* */\n SetToCString(message,\"

    Redirect to master host=\");\n ConcatCString(message,HTTP_Master());\n ConcatCString(message, \":\");\n ConcatDecimal(message,(unsigned int) HTTP_Port());\n ConcatCString(message, \"

    \\n\");\n HTTP_SendString(request,message);\n\n HTTP_SetContentFooterString(cctkGH, 0, message);\n retval = HTTP_SendString(request, message);\n\n String_Delete( message );\n return retval;\n}\n", "SString_Namespace.h": " /*@@\n @file SString_Namespace.h\n @date 02.04.2004\n @author Steve White\n @desc Module for generic operations on strings\n @enddesc\n @version $Header$\n @@*/\n#ifndef _SSTRING_NAMESPACE_H\n#define _SSTRING_NAMESPACE_H\n\n#include \"SString.h\"\n\n/* A poor man's namespace for the String module */\n\n#define Set( a, b ) \\\n\t\tStringSet( a, b )\n#define SetSubString( a, b, p, l ) \\\n\t\tStringSetSubString( a, b, p, l )\n#define SetToCString( a, b ) \\\n\t\tStringSetToCString( a, b )\n#define SetToPartAfter( a, b, p ) \\\n\t\tStringSetToPartAfter( a, b, p )\n#define InsertCString( a, b, c ) \\\n\t\tStringInsertCString( a, b, c )\n#define ConcatCString( a, b ) \\\n\t\tStringConcatCString( a, b )\n#define CompareCString( a, b ) \\\n\t\tStringCompareCString( a, b )\n#define SetToBuffer( a, b, l ) \\\n\t\tStringSetToBuffer( a, b, l )\n#define GetBuffer( a ) \\\n\t\tStringGetBuffer( a )\n#define Length( p ) \\\n\t\tStringLength( p )\n#define\tNthChar( s, n ) \\\n\t\tStringNthChar( s, n )\n#define SetNthChar( s, n, c ) \\\n\t\tStringSetNthChar( s, n, c )\n#define Truncate( s, n ) \\\n\t\tStringTruncate( s, n )\n#define TrimLeading( s, n ) \\\n\t\tStringTrimLeading( s, n )\n#define\tFindStringFrom( s, c, p ) \\\n\t\tStringFindStringFrom( s, c, p )\n#define\tFindCharFrom( s, c, p ) \\\n\t\tStringFindCharFrom( s, c, p )\n#define\tSetNextToken( s, c, p, r ) \\\n\t\tStringSetNextToken( s, c, p, r )\n#define Compare( a, b ) \\\n\t\tStringCompare( a, b )\n#define Equals( a, b ) \\\n\t\tStringEquals( a, b )\n#define Insert( a, b, p ) \\\n\t\tStringInsert( a, b, p )\n#define InsertChar( a, b, p ) \\\n\t\tStringInsertChar( a, b, p )\n#define Concat( a, b ) \\\n\t\tStringConcat( a, b )\n#define Print( a ) \\\n\t\tStringPrint( a )\n#define FormatPrint( a, s ) \\\n\t\tStringFormatPrint( a, s )\n#define ConcatDecimal( a, s ) \\\n\t\tStringConcatDecimal( a, s )\n#define ConcatHex( a, s ) \\\n\t\tStringConcatHex( a, s )\n#define ConcatOctal( a, s ) \\\n\t\tStringConcatOctal( a, s )\n#define ConcatDouble( a, s ) \\\n\t\tStringConcatDouble( a, s )\n#define ConcatFormattedDecimal( a, d, s1, s2, f ) \\\n\t\tStringConcatFormattedDecimal( a, d, s1, s2, f )\n#define ConcatFormattedUnsigned( a, d, s1, s2, f ) \\\n\t\tStringConcatFormattedUnsigned( a, d, s1, s2, f )\n#define ConcatFormattedDouble( a, d, s1, s2, f ) \\\n\t\tStringConcatFormattedDouble( a, d, s1, s2, f )\n\n#endif\n", "Thorns.c": " /*@@\n @file Groups.c\n @date Wed Sep 24 23:47:43 2000\n @author Gabrielle Allen\n @desc \n Pages about thorns\n @enddesc\n @version $Header$\n @@*/\n\n#include \n\n#include \"cctk.h\"\n\n#include \"util_String.h\"\n\n#include \"httpRequest.h\"\n#include \"Content.h\"\n#include \"SString_Namespace.h\"\n#include \"SStringHTML_Namespace.h\"\n\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusConnect_HTTPD_Thorns_c)\n\n/********************************************************************\n ********************* Local Data Types ***********************\n ********************************************************************/\n\n/********************************************************************\n ********************* Local Routine Prototypes *********************\n ********************************************************************/\n\nstatic int ThornMainPage(const cGH *cctkGH, httpRequest *request, void *data);\nstatic int ThornPage(const cGH *cctkGH, httpRequest *request, void *data);\n\n\n/********************************************************************\n ********************* Other Routine Prototypes *********************\n ********************************************************************/\n\nint HTTPi_RegisterThornPages(void);\n\n/********************************************************************\n ********************* Local Data *****************************\n ********************************************************************/\n\n/********************************************************************\n ********************* External Routines **********************\n ********************************************************************/\n\n /*@@\n @routine HTTPi_RegisterThornsPages\n @date Wed Sep 14 11:29:43 2000\n @author Gabrielle Allen\n @desc \n Httpd utils registration routine.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\n#define THORN_NAME_MAXLENGTH (27+20)\nint HTTPi_RegisterThornPages(void)\n{\n int i;\n char pagename[THORN_NAME_MAXLENGTH] = { '\\0' };\n\n /* Register the group info page. */\n HTTP_RegisterPage(\"/Thorns\", ThornMainPage, NULL);\n\n HTTP_ContentLink(\"/Thorns/index.html\", \"Thorns\",\n \"Information from Flesh and individual thorns\",\n HTTP_QUICKLINK);\n\n for (i = 0; i < CCTK_NumCompiledThorns (); i++)\n {\n const char *thorn = CCTK_CompiledThorn(i);\n char *namecopy;\n\n sprintf(pagename,\"/Thorns/%s\", thorn);\n\n namecopy = Util_Strdup(thorn); /*SW isn't this a memory leak?*/\n\n HTTP_RegisterPage(pagename, ThornPage, namecopy);\n }\n\n return 0;\n}\n\n/********************************************************************\n ********************* Local Routines *************************\n ********************************************************************/\n\n\n/******************************************************************************\n *************************** Thorn Page **************************************\n ******************************************************************************/\n\n /*@@\n @routine ThornMainPage\n @date Thu Sep 14 23:47:43 2000\n @author Gabrielle Allen\n @desc \n Displays the thorn main page.\n @enddesc \n @calls \n @calledby \n@@*/\nstatic int ThornMainPage(const cGH *cctkGH, httpRequest *request, void *data)\n{\n int i;\n int retval = -1;\n int foundone = 0;\n const char *thorn;\n String *message = String_New();\n\n /* avoid compiler warning about unused parameter */\n data = data;\n\n HTTP_SendOKHeader( request );\n\n HTTP_SetDoctype( message );\n HTTP_SendString(request, message);\n /* Start the page */\n HTTP_Send(request, \"Cactus Thorns\\n\");\n\n HTTP_SetHeadInfo( message);\n HTTP_SendString(request, message );\n\n HTTP_Send(request,\"\\n\");\n HTTP_Send(request,\"\\n\\n\");\n\n /* HTTP_SendString out the header part. */\n\n HTTP_SetContentHeaderString(cctkGH,0,message,NULL);\n\n retval = HTTP_SendString(request, message);\n\n retval = HTTP_Send(request, \"

    Thorns

    \\n\"\n \"

    These pages describe the thorns used in this simulation.

    \\n\");\n\n retval = HTTP_Send(request, \"\\n\\n
    \\n\");\n\n for (i = 0; i < CCTK_NumCompiledThorns (); i++)\n {\n thorn = CCTK_CompiledThorn (i);\n if (CCTK_IsThornActive (thorn))\n {\n if (!foundone)\n {\n HTTP_Send(request,\n \"

    Active Thorns

    \\n\"\n \"
    \\n\"\n \"\\n\"\n \"\\n\"\n \"\\n\"\n \"\\n\"\n \"\\n\");\n foundone++;\n }\n SetToCString(message, \"\\n\\n\\n\\n\");\n HTTP_SendString(request, message);\n }\n }\n\n if (foundone)\n {\n HTTP_Send(request,\"
    Thorn NameImplementation
    \");\n ConcatCString(message, thorn);\n ConcatCString(message, \"\");\n ConcatCString(message, CCTK_ThornImplementation(thorn));\n ConcatCString(message, \"
    \\n\");\n }\n\n retval = HTTP_Send(request,\"
    \");\n\n foundone = 0;\n for (i = 0; i < CCTK_NumCompiledThorns (); i++)\n {\n thorn = CCTK_CompiledThorn (i);\n if (!CCTK_IsThornActive (thorn))\n {\n\n if (!foundone)\n {\n HTTP_Send(request,\n \"

    Dormant Thorns

    \\n\"\n \"
    \\n\"\n \"\\n\"\n \"\\n\"\n \"\\n\"\n \"\\n\"\n \"\\n\");\n foundone++;\n }\n\n SetToCString(message, \"\\n\\n\\n\\n\");\n HTTP_SendString(request, message);\n \n }\n }\n\n if (foundone)\n {\n HTTP_Send(request,\"
    Thorn NameImplementation
    \\n\");\n ConcatCString(message, thorn);\n ConcatCString(message, \"\");\n ConcatCString(message, CCTK_ThornImplementation(thorn));\n ConcatCString(message, \"
    \\n
    \\n\");\n }\n\n retval = HTTP_Send(request,\"
    \\n\");\n\n /* Write out the footer part. */\n\n HTTP_SetContentFooterString(cctkGH,0,message);\n retval = HTTP_SendString(request, message);\n\n String_Delete( message );\n return retval;\n}\n\n\n\n /*@@\n @routine ThornPage\n @date Sun Sep 24 15:13:55 2000\n @author Gabrielle Allen\n @desc \n Individual thorn information\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int ThornPage(const cGH *cctkGH, httpRequest *request, void *data)\n{\n int retval=0;\n String *message = String_New();\n const char *thorn = (const char *)data;\n \n HTTP_SendOKHeader(request);\n\n HTTP_SetDoctype( message );\n HTTP_SendString(request, message);\n\n /* Start the page */\n SetToCString(message, \"\\n\\nThorn Page : \");\n ConcatCString(message, thorn);\n ConcatCString(message, \"\\n\");\n\n HTTP_SendString(request, message);\n HTTP_SetHeadInfo( message);\n HTTP_SendString(request, message );\n\n HTTP_Send(request,\"\\n\\n\");\n\n HTTP_SetContentHeaderString(cctkGH,0,message,NULL);\n\n HTTP_SendString(request, message);\n\n SetToCString(message, \"

    Thorn \");\n ConcatCString(message, thorn);\n ConcatCString(message, \"

    \\n\");\n\n HTTP_SendString(request, message);\n \n SetToCString(message,\"

    This page will include all the information about \"\n \"thorn \\'\");\n ConcatCString(message, thorn);\n ConcatCString(message, \"\\'.\\n For now, only information about the parameters\"\n \" is given.

    \\n\");\n\n ConcatCString(message, \"\\n\");\n HTTP_SendString(request, message);\n\n /* Write out the footer part. */\n \n HTTP_SetContentFooterString(cctkGH, 0, message);\n retval = HTTP_SendString(request, message);\n\n String_Delete( message );\n return retval;\n}\n\n", "Expression.c": " /*@@\n @file Expression.c\n @date Tue Sep 19 13:25:39 2000\n @author Tom Goodale\n @desc \n Expression evaluator.\n @enddesc\n @version $Header$\n @@*/\n\n#ifndef TEST_HTTP_EVALUATE\n#include \"cctk.h\"\n#endif\n\n#include \n#include \n#include \n\n#include \"Expression.h\"\n\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusConnect_HTTPD_Expression_c)\n\n/********************************************************************\n ********************* Local Data Types ***********************\n ********************************************************************/\n\ntypedef struct PToken\n{\n struct PToken *last;\n struct PToken *next;\n char *token;\n} pToken;\n\n/********************************************************************\n ********************* Local Routine Prototypes *********************\n ********************************************************************/\n\nstatic pToken *Tokenise(const char *expression);\nstatic char *RPParse(pToken **current, char *stack, int *stacklength);\nstatic double Evaluate(double val1, const char *operator, double val2);\n\nstatic int isoperator(const char *token);\nstatic int cmpprecendence(const char *op1, const char *op2);\n\nstatic pToken *newtoken(const char *tokenstart, const char *tokenend);\n\n#if 0\nstatic void insertbefore(pToken *base, pToken *this);\n#endif\n\n#ifdef TEST_HTTP_EVALUATE\nstatic void printtokens(pToken *start);\n#endif\n\nstatic void insertafter(pToken *base, pToken *this);\nstatic void FreeTokens(pToken *list);\n\n/********************************************************************\n ********************* Other Routine Prototypes *********************\n ********************************************************************/\n\n/********************************************************************\n ********************* Local Data *****************************\n ********************************************************************/\n\n#define INITIAL_BUFFER_LENGTH 1000\n#define MAX_STACK_SIZE 256\n#define MAX_OPS 100\n\n/********************************************************************\n ********************* External Routines **********************\n ********************************************************************/\n\n /*@@\n @routine HTTP_ExpressionParse\n @date Tue Sep 19 21:23:08 2000\n @author Tom Goodale\n @desc \n Parses an expression returning a predigested string in RPN.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nchar *HTTP_ExpressionParse(const char *expression)\n{\n int buffer_length = INITIAL_BUFFER_LENGTH;\n char *buffer = (char *)malloc(buffer_length);\n\n if(buffer)\n {\n /* Split the list into tokens */\n pToken *list = Tokenise(expression);\n pToken *temp = list;\n\n#ifdef TEST_HTTP_EVALUATE \n printtokens(list);\n#endif\n\n\n /* Convert the list into a string in RPN order */\n buffer = RPParse(&temp, buffer, &buffer_length);\n\n FreeTokens(list);\n }\n\n return buffer;\n}\n\n /*@@\n @routine HTTP_ExpressionEvaluate\n @date Tue Sep 19 21:23:40 2000\n @author Tom Goodale\n @desc \n Evaluates an parsed expression string created by HTTP_ExpressionParse.\n The user passes in a function which is used to evaluate all operands.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\ndouble HTTP_ExpressionEvaluate(char *buffer, \n double (*eval)(const char *, void *),\n void *data)\n{\n double stack[MAX_STACK_SIZE];\n int stackpointer = 0;\n char *first = buffer;\n char *token;\n\n /* Tokens are seperated by @ signs */\n while((token = strtok(first,\"@\")))\n {\n first = NULL;\n\n if(!isoperator(token))\n {\n /* Evaluate and put on stack */\n stack[stackpointer] = eval(token, data);\n stackpointer++;\n }\n else\n {\n#ifdef TEST_HTTP_EVALUATE\n printf(\"Stackpointer is %d, %f %s %f = \", \n stackpointer, stack[stackpointer-2], token, stack[stackpointer-1]);\n#endif\n /* Evaluate operation, clear operands from stack and add the result to the stack. */\n stack[stackpointer-2] = Evaluate(stack[stackpointer-2],token,stack[stackpointer-1]);\n stackpointer--;\n#ifdef TEST_HTTP_EVALUATE\n printf(\"%f\\n\", stack[stackpointer-1]); \n#endif\n }\n }\n \n return stack[stackpointer-1];\n}\n\n\n/********************************************************************\n ********************* Local Routines *************************\n ********************************************************************/\n\n /*@@\n @routine Tokenise\n @date Tue Sep 19 21:25:18 2000\n @author Tom Goodale\n @desc \n Split an expression into tokens\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic pToken *Tokenise(const char *expression)\n{\n pToken *start = NULL;\n pToken *current = NULL;\n pToken *new = NULL;\n\n const char *tokenstart = expression;\n\n while(*tokenstart)\n {\n const char *tokenend = NULL;\n const char *position;\n /* Remove leading whitespace */ \n for(; *tokenstart == ' ' || *tokenstart == '\\t'; tokenstart++);\n\n position = tokenstart;\n\n for(position=tokenstart; *position && *(position+1); position++)\n {\n switch(*(position+1))\n {\n case '+' :\n case '-' :\n case '/' :\n case '*' :\n case '(' :\n case ')' :\n case '<' :\n case '>' :\n tokenend = position; break;\n case '=' :\n if(*position != '<' && *position != '>')\n {\n tokenend = position; \n }\n break;\n case '&' :\n if(*position != '&')\n {\n tokenend = position;\n }\n break;\n case '|' :\n if(*position != '|')\n {\n tokenend = position;\n }\n break;\n default :\n switch(*(position))\n {\n case '+' :\n case '-' :\n case '/' :\n case '*' :\n case '(' :\n case ')' :\n case '=' :\n case '&' :\n case '|' :\n tokenend = position; break;\n case '<' :\n case '>' :\n if(*(position+1) && *(position+1) != '=')\n {\n tokenend = position;\n }\n break;\n default :\n ;\n }\n }\n\n if(tokenend)\n {\n break;\n }\n }\n\n /* Have we reached the end of the string ? */\n if(!tokenend)\n {\n tokenend = position;\n }\n \n /* Create a new token */\n new = newtoken(tokenstart, tokenend);\n\n /* Insert on list */\n if(current)\n {\n insertafter(current, new);\n }\n current = new;\n\n if(!start)\n {\n start = current;\n }\n\n if(*tokenend)\n {\n tokenstart = tokenend+1;\n }\n else\n {\n break;\n }\n }\n \n return start;\n}\n\n /*@@\n @routine RPParse\n @date Tue Sep 19 21:28:36 2000\n @author Tom Goodale\n @desc \n Parses an toke list into Reverse Polish Notation (RPN).\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\n#define PUSH(stack, stacklength, value) do \\\n{ \\\n int len = strlen(stack)+strlen(value)+3; \\\n \\\n if(len > stacklength) \\\n { \\\n stack = (char *)realloc(stack, len); \\\n } \\\n sprintf(stack,\"%s@%s\",stack,value); \\\n} while(0)\n\n\nstatic char *RPParse(pToken **current, char *stack, int *stacklength)\n{\n char *retval = stack;\n pToken *this = *current;\n char *operator = NULL;\n int numops = 0;\n char *opstack[MAX_OPS];\n\n for(this = *current; this && strcmp(this->token,\")\"); this = this->next)\n {\n if(!strcmp(this->token, \"(\") && this->next)\n {\n /* This is a sub-group, so parse recursively */\n this = this->next;\n retval = RPParse(&this, retval, stacklength);\n if(! this)\n {\n break;\n }\n }\n else if(!isoperator(this->token))\n {\n PUSH(retval, *stacklength, this->token);\n }\n else\n {\n /* It's an operator */\n if(operator)\n {\n /* We already have an operator */\n int precedence = cmpprecendence(operator, this->token);\n\n if(precedence > 0)\n {\n /* Higher precedence than previous one so store previous one */\n numops++;\n opstack[numops-1] = operator;\n operator = this->token;\n }\n else\n {\n /* Lower or equal precedence */\n PUSH(retval, *stacklength, operator);\n operator = this->token;\n while(numops > 0)\n {\n if(cmpprecendence(opstack[numops-1], operator) <=0)\n {\n numops--;\n PUSH(retval, *stacklength, opstack[numops]);\n }\n else\n {\n break;\n }\n }\n }\n }\n else\n {\n operator = this->token;\n }\n }\n }\n\n if(operator)\n {\n PUSH(retval, *stacklength, operator);\n while(numops > 0)\n {\n numops--;\n PUSH(retval, *stacklength, opstack[numops]);\n }\n }\n\n *current=this;\n\n return retval;\n}\n\n\n /*@@\n @routine Evaluate\n @date Tue Sep 19 21:35:34 2000\n @author Tom Goodale\n @desc \n Evaluates val1 op val2 \n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic double Evaluate(double val1, const char *operator, double val2)\n{\n double retval = 0.0;\n\n if(!strcmp(operator, \"+\"))\n {\n retval = (val1+val2);\n }\n else if(!strcmp(operator, \"-\"))\n {\n retval = (val1-val2);\n }\n else if(!strcmp(operator, \"/\"))\n {\n retval = (val1/val2);\n }\n else if(!strcmp(operator, \"*\"))\n {\n retval = (val1*val2);\n }\n else if(!strcmp(operator, \"&&\"))\n {\n retval = (val1 && val2);\n }\n else if(!strcmp(operator, \"||\"))\n {\n retval = (val1 || val2);\n }\n else if(!strcmp(operator, \"=\"))\n {\n retval = ( val1 == val2);\n }\n else if(!strcmp(operator, \"<\"))\n {\n retval = (val1 < val2);\n }\n else if(!strcmp(operator, \"<=\"))\n {\n retval = (val1 <= val2);\n }\n else if(!strcmp(operator, \">\"))\n {\n retval = (val1 > val2);\n }\n else if(!strcmp(operator, \">=\"))\n {\n retval = (val1 >= val2);\n }\n else\n {\n fprintf(stderr, \"Unknown operation %s\", operator);\n }\n\n return retval;\n}\n \n /*@@\n @routine FreeTokens\n @date Tue Sep 19 21:39:07 2000\n @author Tom Goodale\n @desc \n Frees a list of tokens.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nvoid FreeTokens(pToken *list)\n{\n pToken *token = list;\n\n while( token )\n {\n pToken *next = token->next;\n free(token->token);\n free(token);\n token = next;\n }\n} \n\n\n /*@@\n @routine isoperator\n @date Tue Sep 19 21:30:20 2000\n @author Tom Goodale\n @desc \n Tests if a string is an operator or not.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int isoperator(const char *token)\n{\n int retval = 0;\n \n if(!strcmp(token, \"+\") ||\n !strcmp(token, \"-\") ||\n !strcmp(token, \"/\") ||\n !strcmp(token, \"*\") ||\n !strcmp(token, \"&&\") ||\n !strcmp(token, \"||\") ||\n !strcmp(token, \"=\") ||\n !strcmp(token, \"<\") ||\n !strcmp(token, \"<=\") ||\n !strcmp(token, \">\") ||\n !strcmp(token, \">=\"))\n {\n retval = 1;\n }\n\n return retval;\n}\n\n /*@@\n @routine cmpprecendence\n @date Wed Sep 20 09:05:59 2000\n @author Tom Goodale\n @desc \n Compare the precedence of two operators.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int cmpprecendence(const char *op1, const char *op2)\n{\n const char *op;\n int op1prec;\n int op2prec;\n int *prec;\n\n /* Work out the precedence level for each operator */\n for(op = op1, prec = &op1prec; \n op ; \n op = (op == op1 ) ? op2 : NULL, \n prec = (op == op1) ? &op1prec : &op2prec)\n {\n if(!strcmp(op, \"=\") ||\n !strcmp(op, \"<\") ||\n !strcmp(op, \"<=\") ||\n !strcmp(op, \">\") ||\n !strcmp(op, \">=\"))\n {\n *prec = 1;\n }\n else if(!strcmp(op, \"&&\") ||\n !strcmp(op, \"||\"))\n {\n *prec = 2;\n }\n else if(!strcmp(op, \"+\") ||\n !strcmp(op, \"-\"))\n {\n *prec = 3;\n }\n else if(!strcmp(op, \"/\") ||\n !strcmp(op, \"*\"))\n {\n *prec = 4;\n }\n else\n {\n fprintf(stderr, \"Unknown operator '%s'\\n\", op);\n *prec = 0;\n }\n }\n\n /* Now see which has the higher precedence */\n\n return op2prec-op1prec;\n}\n \n /*@@\n @routine newtoken\n @date Tue Sep 19 21:30:42 2000\n @author Tom Goodale\n @desc \n Creates a new token item.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic pToken *newtoken(const char *tokenstart, const char *tokenend)\n{\n pToken *this = (pToken *)malloc(sizeof(pToken *));\n\n if(this)\n {\n this->last = NULL;\n this->next = NULL;\n\n this->token = (char *)malloc(tokenend-tokenstart+2);\n if(this->token)\n {\n const char *position;\n char *newpos;\n for(position=tokenstart, newpos=this->token; \n position <= tokenend; \n position++, newpos++)\n {\n *newpos = *position;\n }\n /* Just in case not already null terminated */\n *newpos = 0;\n\n /* Strip off any trailing spaces */\n for(; newpos >= this->token && \n (*newpos == 0 || *newpos == ' ' || *newpos == '\\t'); newpos--)\n {\n *newpos = 0;\n }\n }\n }\n\n return this;\n}\n\n /*@@\n @routine insertbefore\n @date Tue Sep 19 21:33:39 2000\n @author Tom Goodale\n @desc \n Inserts a token before another one in a list.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\n#if 0\nstatic void insertbefore(pToken *base, pToken *this)\n{\n if(base && this)\n {\n this->next = base;\n this->last = base->last;\n base->last = this;\n\n if(this->last)\n {\n this->last->next = this;\n }\n }\n}\n#endif\n \n /*@@\n @routine insertafter\n @date Tue Sep 19 21:34:02 2000\n @author Tom Goodale\n @desc \n Inserts a token after another one in a list.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic void insertafter(pToken *base, pToken *this)\n{\n if(base && this)\n {\n this->last = base;\n this->next = base->next;\n base->next = this;\n \n if(this->next)\n {\n this->next->last = this;\n }\n }\n}\n \n /*@@\n @routine printtokens\n @date Tue Sep 19 21:34:24 2000\n @author Tom Goodale\n @desc \n Debugging function to print out the tokens.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\n#if TEST_HTTP_EVALUATE\nstatic void printtokens(pToken *start)\n{\n pToken *token;\n\n for(token = start; token; token = token->next)\n {\n printf(\"->%s\", token->token);\n }\n\n printf(\"\\n\");\n}\n#endif /* TEST_HTTP_EVALUATE */\n\n /*@@\n @routine printstack\n @date Tue Sep 19 21:34:48 2000\n @author Tom Goodale\n @desc \n Debugging function to print out a predigested string.\n Note that is modifies the string, so it should be passed\n a copy.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\n#if 0\nstatic void printstack(char *stack)\n{\n char *first;\n char *token;\n\n first = stack;\n\n while((token = strtok(first,\"@\")))\n {\n first = NULL;\n printf(\"Token is %s\\n\", token);\n }\n}\n#endif\n\n\n/********************************************************************\n ********************* TEST FUNCTIONS *************************\n ********************************************************************/\n\n#ifdef TEST_HTTP_EVALUATE\n\ndouble evaluator(const char *token, void *data)\n{\n double retval = strtod(token, NULL);\n\n /* fprintf(stderr, \"Evaluated '%s' to %f\\n\", token,retval); */\n\n return retval;\n}\n\n\nint main(int argc, char *argv[])\n{\n char *buffer;\n\n if(argc < 2)\n {\n printf(\"Usage: %s \\\"string\\\"\\n\", argv[0]);\n }\n else\n {\n buffer = HTTP_ExpressionParse(argv[1]);\n\n printf(\"Value is %f\\n\", HTTP_ExpressionEvaluate(buffer, evaluator,NULL)); \n \n free(buffer);\n }\n return 0;\n}\n \n#endif /* TEST_HTTP_EVALUATE */ \n", "base64.h": " /*@@\n @header base64.h\n @date Fri Sep 15 12:03:21 2000\n @author Tom Goodale\n @desc \n Header for base64 encoding stuff.\n @enddesc \n @version $Header$\n @@*/\n\n#ifndef __BASE64_H__\n#define __BASE64_H__ 1\n\n#ifdef __cplusplus\nextern \"C\" \n{\n#endif\n\nint HTTP_b64_ntop(unsigned char *src, size_t srclength, \n char *target, size_t targsize);\n\nint HTTP_b64_pton(const char *src, unsigned char *target, size_t targsize);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* __BASE64_H__ */\n\n", "HTTPDUtils.h": " /*@@\n @header HTTPDUtils.h\n @date April 7 2004\n @author Steve White\n @desc \n Routines exported by HTTPD to other thorns.\n @enddesc\n @version $Header$\n @@*/\n\n#ifndef __HTTP_UTILS_H__\n#define __HTTP_UTILS_H__ 1\n\n#define HTTP_QUICKLINK 1\n\n#include \"http_Request.h\"\n#include \"http_SString.h\"\n#include \"http_Content.h\"\n#include \"SString_Namespace.h\"\n\n#ifdef __cplusplus\nextern \"C\" \n{\n#endif\n\nint SetHTML_ContentHeader(const cGH *cctkGH, int choice, String *mess,\n const String *menu);\nint SetHTML_ContentFooter(const cGH *cctkGH, int choice, String *mess);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif \n", "Steer.c": " /*@@\n @file Steer.c\n @date Fri Sep 15 09:51:01 2000\n @author Tom Goodale\n @desc \n Parameter steering interface for the webserver.\n Perhaps should make these required driver functions ?\n @enddesc\n @version $Header$\n @@*/\n\n#ifndef TEST_HTTP_STEER\n#include \"cctk.h\"\n#endif\n\n#ifdef HAVE_CAPABILITY_PTHREADS\n#include \n#endif\n\n#include \n#include \n#include \n\n#ifdef CCTK_MPI\n#include \"mpi.h\"\n#endif\n\n#ifndef TEST_HTTP_STEER\n#include \"cctk_Parameter.h\"\n#endif\n\n#include \"Steer.h\"\n\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusConnect_HTTPD_Steer_c)\n\n/********************************************************************\n ********************* Local Data Types ***********************\n ********************************************************************/\n\n/********************************************************************\n ********************* Local Routine Prototypes *********************\n ********************************************************************/\n\nstatic int CommunicateBuffer(void);\nstatic int SteerParameters(void);\n#ifdef CCTK_MPI\nstatic void ByteSwap(void *buf,int nelements,int elementsize);\n#endif /* CCTK_MPI */\n\n/********************************************************************\n ********************* Other Routine Prototypes *********************\n ********************************************************************/\n\n/********************************************************************\n ********************* Local Data *****************************\n ********************************************************************/\n\nstatic char *queuebuffer = NULL;\nstatic int queuebuffer_size = 0;\n\n#ifdef HAVE_CAPABILITY_PTHREADS\nstatic pthread_mutex_t steer_mutex = PTHREAD_MUTEX_INITIALIZER;\n#endif\n\n/********************************************************************\n ********************* External Routines **********************\n ********************************************************************/\n\n /*@@\n @routine HTTP_SteerQueue\n @date Fri Sep 15 09:52:13 2000\n @author Tom Goodale\n @desc \n Adds a paremeter and its new value to the queue to be steered.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nint HTTP_SteerQueue(const char *thorn, const char *parameter, const char *value)\n{\n int retval = 0;\n int buffer_length = 0;\n int parameter_length = 0;\n\n#ifdef HAVE_CAPABILITY_PTHREADS\n pthread_mutex_lock(&steer_mutex);\n#endif\n\n buffer_length = queuebuffer ? strlen(queuebuffer) : 0;\n\n /* Added length will be lengthof(thorn::par=val\\n) */\n parameter_length=strlen(thorn) + 2 + strlen(parameter)+ 1 + strlen(value)+1;\n\n if(buffer_length+parameter_length+1 > queuebuffer_size)\n {\n char *tmp = (char *)realloc(queuebuffer, buffer_length+parameter_length+1);\n\n if(tmp)\n {\n queuebuffer = tmp;\n queuebuffer_size = buffer_length+parameter_length+1;\n }\n else\n retval = -1;\n }\n\n if(!retval)\n {\n sprintf(queuebuffer,\"%s%s::%s=%s\\n\", \n buffer_length ? queuebuffer : \"\",\n thorn,parameter, value);\n }\n\n#ifdef HAVE_CAPABILITY_PTHREADS\n pthread_mutex_unlock(&steer_mutex);\n#endif\n\n return retval;\n}\n\n /*@@\n @routine HTTP_SteerDispatch\n @date Fri Sep 15 09:58:07 2000\n @author Tom Goodale\n @desc \n \n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nint HTTP_SteerDispatch(void)\n{\n#ifdef HAVE_CAPABILITY_PTHREADS\n pthread_mutex_lock(&steer_mutex);\n#endif\n\n CommunicateBuffer();\n\n SteerParameters();\n\n#ifdef HAVE_CAPABILITY_PTHREADS\n pthread_mutex_unlock(&steer_mutex);\n#endif\n\n return 0;\n}\n\n/********************************************************************\n ********************* Local Routines *************************\n ********************************************************************/\n\n /*@@\n @routine CommunicateBuffer\n @date Fri Sep 15 10:22:11 2000\n @author Tom Goodale\n @desc \n Communicates the contents of the queue buffer to all procs. \n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int CommunicateBuffer(void)\n{\n#ifdef CCTK_MPI\n int rank = 0;\n int nprocs = 1;\n int buffer_size = 0;\n CCTK_INT8 transmit_buffer_size;\n\n /* Work out how many processes there are. */\n MPI_Comm_size(MPI_COMM_WORLD, &nprocs);\n \n if(nprocs > 1)\n {\n /* Work out if this is proc 0 or not. */\n MPI_Comm_rank(MPI_COMM_WORLD, &rank);\n\n if(rank == 0)\n {\n /* Sending process */\n\n /* How much data must we send. */\n buffer_size = queuebuffer ? strlen(queuebuffer) : 0;\n\n /* Now account for final \\0 */\n if(buffer_size)\n {\n buffer_size++;\n }\n\n transmit_buffer_size = buffer_size;\n \n ByteSwap(&transmit_buffer_size, 1, 8);\n\n /* Tell other procs how much data to receive. */\n MPI_Bcast(&transmit_buffer_size, 8, MPI_BYTE, 0, MPI_COMM_WORLD);\n\n if(buffer_size > 0)\n {\n /* Send data to other procs */\n MPI_Bcast(queuebuffer, buffer_size, MPI_BYTE, 0, MPI_COMM_WORLD);\n }\n }\n else\n {\n /* Receiving process */\n\n /* Find out how much data to receive. */\n MPI_Bcast(&transmit_buffer_size, 8, MPI_BYTE, 0, MPI_COMM_WORLD);\n\n ByteSwap(&transmit_buffer_size, 1, 8);\n\n buffer_size = transmit_buffer_size;\n \n#ifdef TEST_HTTP_STEER\n fprintf(stderr, \"%d - buffer size %d queuebuffer size %d\\n\", rank, buffer_size, queuebuffer_size);\n#endif\n\n if(buffer_size > queuebuffer_size)\n {\n /* Don't use realloc, as don't need to copy data */\n if(queuebuffer)\n {\n free(queuebuffer);\n }\n \n queuebuffer = (char *)malloc(buffer_size);\n\n if(!queuebuffer)\n {\n /* Have no choice except to abort as other processes would\n block. \n */\n MPI_Abort(MPI_COMM_WORLD, 99);\n }\n\n queuebuffer_size = buffer_size;\n }\n\n /* Receive data from processor 0 */\n\n if(buffer_size > 0)\n {\n MPI_Bcast(queuebuffer, buffer_size, MPI_BYTE, 0, MPI_COMM_WORLD);\n }\n }\n }\n\n#endif /* CCTK_MPI */\n\n return 0;\n}\n\n /*@@\n @routine SteerParameters\n @date Fri Sep 15 10:38:40 2000\n @author Tom Goodale\n @desc \n Steers parameters from queuebuffer.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int SteerParameters(void)\n{\n int retval = 0;\n char *value = NULL;\n \n if(queuebuffer)\n {\n char *token = strtok(queuebuffer, \"\\n\");\n\n while(token)\n {\n char *thorn = token;\n\n char *parameter = strchr(token, ':');\n\n if(parameter)\n {\n /* Get rid of two colons */\n *parameter = 0;\n parameter++;\n *parameter = 0;\n parameter++;\n\n value = strchr(parameter,'=');\n\n if(value)\n {\n *value = 0;\n value++;\n\n CCTK_ParameterSet(parameter, /* The name of the parameter */\n thorn, /* The originating thorn */\n value); /* The value of the parameter */\n\n retval++;\n }\n }\n token = strtok(NULL,\"\\n\");\n }\n }\n\n if(queuebuffer)\n {\n *queuebuffer = 0;\n }\n\n return retval;\n}\n\n /*@@\n @routine ByteSwap\n @date Mon Oct 09 2000\n @author John Shalf\n @desc \n \n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n @var buf\n @vdesc buffer to byteswap\n @vtype void *\n @vio inout\n @vcomment \n \n @endvar \n @var nelements\n @vdesc number of data elements in array\n @vtype int\n @vio in\n @vcomment \n \n @endvar \n @var elementsize\n @vdesc size of each element in buffer\n @vtype int\n @vio in\n @vcomment \n \n @endvar \n\n@@*/\n#ifdef CCTK_MPI\nstatic void ByteSwap(void *buf,int nelements,int elementsize)\n{\n#ifndef WORDS_BIGENDIAN\n char *buffer=(char *)buf;\n int i;\n int s,d;\n \n for(i=0;i\n#include \n#include \n\n#ifdef HAVE_SIGNAL_H\n#include \n#endif\n\n#ifdef HAVE_UNISTD_H\n#include \n#endif /* HAVE_UNISTD_H */\n#ifdef HAVE_SYS_TIME_H\n#include \n#endif /* HAVE_SYS_TIME_H */\n#ifdef HAVE_SYS_TYPES_H\n#include \n#endif /* HAVE_SYS_TYPES_H */\n#ifdef HAVE_SYS_SOCKET_H\n#include \n#endif /* HAVE_SYS_SOCKET_H */\n#ifdef HAVE_NETINET_IN_H\n#include \n#endif /* HAVE_NETINET_IN_H */\n#ifdef HAVE_NETDB_H\n#include \n#endif /* HAVE_NETDB_H */\n#ifdef HAVE_ARPA_INET_H\n#include \n#endif /* ARPA_INET_H */\n#ifdef HAVE_WINSOCK2_H\n#include \n#endif /* HAVE_WINSOCK2_H */\n#include \n\n#include \"httpd.h\"\n\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusConnect_HTTPD_Sockets_c)\n\n/********************************************************************\n ********************* Local Data Types ***********************\n ********************************************************************/\n#ifndef MSG_NOSIGNAL\n#define MSG_NOSIGNAL 0\n#endif\n\ntypedef enum {closed, open} httpSocketState;\n\ntypedef struct HTTPSocketTag\n{\n httpSocket *prev;\n httpSocket *next;\n unsigned long filedes;\n httpSocketState state;\n} httpSocket_PLACEHOLDER;\n\n/********************************************************************\n ********************* Local Routine Prototypes *********************\n ********************************************************************/\n\nstatic httpSocket *SocketCreate(unsigned long int filedes);\nstatic void SocketDestroy(httpSocket *this);\nstatic void SocketClose(httpSocket *this);\n\n/********************************************************************\n ********************* Other Routine Prototypes *********************\n ********************************************************************/\n\n/********************************************************************\n ********************* Local Data *****************************\n ********************************************************************/\n\n/* Active file descriptors */\nstatic fd_set active_fd_set;\n\n/* Main server socket */\nstatic SOCKET sock;\nstatic SOCKET minsock;\nstatic SOCKET maxsock;\n\nstatic httpSocket *socklist = NULL;\n\nstatic unsigned long int httpport = 0;\n\n/********************************************************************\n ********************* External Routines **********************\n ********************************************************************/\n\n /*@@\n @routine HTTP_Send\n @date 10.04.2004\n @author Steve White\n @desc\n Writes all of an HTTP reply.\n @enddesc\n @calls\n @calledby\n @history\n\n @endhistory\n\n@@*/\nint\nHTTP_Send( httpRequest * request, const char * message )\n{\n return HTTP_Write(request, message, strlen(message)); \n}\n\n/*@@\n @routine HTTP_SetupServer\n @date Wed Sep 13 20:39:15 2000\n @author Tom Goodale\n @desc\n Creates a socket to listen on.\n @enddesc\n @calls\n @calledby\n @history\n\n @endhistory\n\n@@*/\nint HTTP_SetupServer(int port, int queue_size, int hunt)\n{\n char hostname[1025] = {'\\0'};\n unsigned int realport = 0;\n\n /* Some systems need special logic for starting up TCP. */\n Socket_InitializeSocketLayer ();\n\n /* Create the socket and set it up to accept connections. */\n sock = Socket_TCPOpenServerSocket (port, hunt ? &realport : NULL, queue_size);\n if (sock == INVALID_SOCKET)\n {\n CCTK_WARN (0, \"HTTPD Failed to create server socket\");\n }\n\n Util_GetHostName(hostname, sizeof(hostname));\n\n httpport = hunt ? realport : (unsigned long int) port;\n\n printf(\"Server started on http://%s:%lu/\\n\", hostname, httpport);\n if (CCTK_IsFunctionAliased(\"Send_Twitter_Msg\"))\n {\n char msg[141];\n char *this_user = getenv(\"USER\");\n if (!this_user) this_user = \"unknown\";\n /* We do not want 'hostname' here because that can be wrong and not be overwritten */\n char *myhostname = getenv(\"HOSTNAME\");\n if (!myhostname) myhostname = hostname;\n /* If there is an environment variable HOSTPORT, announce this instead (for ssh forwarding) */\n if (getenv(\"HOSTPORT\"))\n snprintf(msg, 140, \"HTTPD by %s on http://%s:%s/\\n\", this_user, myhostname, getenv(\"HOSTPORT\"));\n else\n snprintf(msg, 140, \"HTTPD by %s on http://%s:%lu/\\n\", this_user, myhostname, httpport);\n Send_Twitter_Msg(msg);\n }\n else printf(\"Not announcing location via Twitter.\\n\");\n\n minsock = sock;\n maxsock = sock;\n\n /* Initialize the set of active sockets. */\n FD_ZERO (&active_fd_set);\n FD_SET (sock, &active_fd_set);\n\n /* Not all architectures support the MSG_NOSIGNAL flag to send and recv,\n * so setup to ignore the SIGPIPE via normal signal hadnling as well.\n */\n\n#ifdef SIGPIPE\n signal(SIGPIPE,SIG_IGN);\n#endif\n\n return httpport; /* return the actual port here */\n}\n\n /*@@\n @routine HTTP_ShutdownServer\n @date Wed Sep 13 20:39:15 2000\n @author Tom Goodale\n @desc\n Closes all sockets we are interested in.\n @enddesc\n @calls\n @calledby\n @history\n\n @endhistory\n\n@@*/\nint HTTP_ShutdownServer(void)\n{\n SOCKET i;\n\n /* Close all sockets in our active set */\n for(i = maxsock; i >= minsock; i--)\n {\n if(FD_ISSET(i, &active_fd_set))\n {\n Socket_CloseSocket (i);\n }\n }\n\n return 0;\n}\n\n /*@@\n @routine HTTP_Poll\n @date Wed Sep 13 20:39:15 2000\n @author Tom Goodale\n @desc\n Main workhorse routine.\n Looks for activity on any of the sockets which are open\n and dispatches work.\n @enddesc\n @calls\n @calledby\n @history\n\n @endhistory\n\n@@*/\nint HTTP_Poll(cGH *cctkGH, long sec, long usec)\n{\n fd_set read_fd_set = active_fd_set;\n struct sockaddr_in clientname;\n struct timeval timeout;\n httpSocket *this;\n\n\n timeout.tv_sec = sec;\n timeout.tv_usec = usec;\n\n /* Check if any input is available on one or more active sockets. */\n\n if (select (FD_SETSIZE, &read_fd_set, NULL, NULL, sec >= 0 ? &timeout : NULL)\n == SOCKET_ERROR)\n {\n perror (\"select\");\n CCTK_Abort(cctkGH, EXIT_FAILURE);\n }\n\n /* Service all the sockets with input pending. */\n if (FD_ISSET (sock, &read_fd_set))\n {\n /* Connection request on original socket. */\n#ifdef HAVE_SOCKLEN_T\n socklen_t size = sizeof (clientname);\n#else\n int size = sizeof (clientname);\n#endif\n SOCKET new = accept (sock, (struct sockaddr *) &clientname, &size);\n if (new == INVALID_SOCKET)\n {\n perror (\"accept\");\n /*CCTK_Abort(cctkGH, EXIT_FAILURE);*/\n }\n else\n {\n if (*(const CCTK_INT *) CCTK_ParameterGet (\"verbose\", CCTK_THORNSTRING,\n NULL))\n {\n CCTK_VInfo (CCTK_THORNSTRING,\n \"Server: connect from host %s, port %hd\",\n inet_ntoa (clientname.sin_addr),\n ntohs (clientname.sin_port));\n }\n SocketCreate(new);\n }\n }\n\n this = socklist;\n while( this )\n {\n httpSocket *next = this->next;\n /* Data arriving on an already-connected socket. */\n if (FD_ISSET (this->filedes, &read_fd_set) &&\n HTTP_ReadFromClient (cctkGH, this) < 0)\n {\n SocketDestroy(this);\n }\n this = next;\n }\n\n return (0);\n}\n\n\n /*@@\n @routine HTTP_Write\n @date Fri Sep 15 18:47:41 2000\n @author Tom Goodale\n @desc\n Writes part or all of an HTTP reply.\n @enddesc\n @calls\n @calledby\n @history\n\n @endhistory\n\n@@*/\nint HTTP_Write(httpRequest *request, const char *buffer, size_t count)\n{\n int retval = -1;\n size_t bytes_sent = 0;\n size_t halfcount;\n httpSocket *connection = HTTP_Connection( request);\n int done = 0;\n int tmp;\n fd_set this_set;\n\n if(connection->state == open)\n {\n FD_ZERO (&this_set);\n while(!done)\n {\n /* Try and send the data. Make sure we don't get a SIGPIPE if the\n * other end is closed.\n */\n retval = send(connection->filedes,\n buffer+bytes_sent,\n count-bytes_sent,\n MSG_NOSIGNAL);\n\n /* Check for errors */\n if(retval < 0)\n {\n switch(errno)\n {\n#ifdef EMSGSIZE\n case EMSGSIZE : /* The socket requires that message be sent atomically,\n * and the size of the message to be sent made this\n * impossible.\n */\n /* Split message in two and try again. */\n halfcount = count/2;\n retval = HTTP_Write(request, buffer, halfcount);\n if(retval > -1)\n {\n tmp = HTTP_Write(request, buffer+halfcount, count-halfcount);\n if(tmp > -1)\n {\n retval += tmp;\n }\n else\n {\n retval = tmp;\n }\n }\n break;\n#endif\n\n#ifdef ENOBUFS\n case ENOBUFS :\n /* The output queue for a network interface was full. This generally indicates that the interface has\n * stopped sending, but may be caused by transient congestion. (This cannot occur in Linux, packets are\n * just silently dropped when a device queue overflows.)\n */\n retval = 0;\n break;\n#endif\n case EBADF : /* An invalid descriptor was specified. */\n#ifdef ENOTSOCK\n case ENOTSOCK : /* The filedescriptor is not a socket. */\n#endif\n#ifdef ECONNRESET\n case ECONNRESET : /* Connection reset by peer */\n#endif\n case EPIPE : /* The local end has been shut down on a connection oriented socket. In this case the process will also\n * receive a SIGPIPE unless MSG_NOSIGNAL is set.\n */\n SocketClose(connection);\n break;\n\n case EINTR : /* A signal occurred.*/\n\n case ENOMEM : /* No memory available. */\n\n case EINVAL : /* Invalid argument passed. */\n\n case EFAULT : /* An invalid user space address was specified for a parameter. */\n break;\n\n#if 0\n case EAGAIN :\n case EWOULDBLOCK :\n /* The socket is marked non-blocking and the requested operation would block. */\n#endif\n default :\n CCTK_WARN (1, \"Error: unknown errno \");\n }\n }\n else\n {\n bytes_sent += retval;\n }\n\n if(retval >= 0 && bytes_sent < count)\n {\n /* Wait until can write */\n FD_SET (connection->filedes, &this_set);\n if (select (FD_SETSIZE, NULL, &this_set, NULL, NULL) < 0)\n {\n perror (\"select\");\n CCTK_Abort(NULL, EXIT_FAILURE);\n }\n }\n else\n {\n done = 1;\n }\n }\n }\n\n#ifdef HTTP_DEBUG\n if(retval != -1)\n {\n fprintf (stderr, \"Wrote: `%s'\\n\", buffer);\n }\n else\n {\n fprintf(stderr, \"Couldn't write to the socket 8-(\\n\");\n }\n#endif\n\n return retval;\n}\n\n /*@@\n @routine HTTP_Read\n @date Mon Sep 18 10:14:03 2000\n @author Tom Goodale\n @desc\n Reads part or all of an HTTP request.\n @enddesc\n @calls\n @calledby\n @history\n\n @endhistory\n\n@@*/\nint HTTP_Read(httpRequest *request, char *buffer, size_t count)\n{\n int retval = -1;\n\n httpSocket *connection = HTTP_Connection( request );\n\n if(connection->state == open)\n {\n /* Currently don't do anything fancy. */\n retval = recv(connection->filedes, buffer, count,MSG_NOSIGNAL);\n\n#ifdef HTTP_DEBUG\n fprintf (stderr, \"Read: `%.*s'\\n\", retval, buffer);\n#endif\n }\n\n return retval;\n}\n\n /*@@\n @routine HTTP_Port\n @date Tue Oct 3 11:24:40 2000\n @author Tom Goodale\n @desc\n Reports the port the HTTP server is listening on.\n @enddesc\n @calls\n @calledby\n @history\n\n @endhistory\n\n@@*/\nunsigned long int HTTP_Port(void)\n{\n return httpport;\n}\n\n/********************************************************************\n ********************* Local Routines *************************\n ********************************************************************/\n /*@@\n @routine SocketCreate\n @date Thu Sep 21 15:03:32 2000\n @author Tom Goodale\n @desc\n Creates an httpSocket structure and links it to the list.\n @enddesc\n @calls\n @calledby\n @history\n\n @endhistory\n\n@@*/\nstatic httpSocket *SocketCreate(unsigned long int filedes)\n{\n httpSocket *this = (httpSocket *)malloc(sizeof (httpSocket));\n\n if(this)\n {\n this->filedes = filedes;\n this->state = open;\n this->prev = NULL;\n this->next = socklist;\n\n if(socklist)\n {\n socklist->prev = this;\n }\n\n socklist = this;\n\n FD_SET (this->filedes, &active_fd_set);\n }\n\n return this;\n}\n\n /*@@\n @routine SocketDestroy\n @date Thu Sep 21 15:04:03 2000\n @author Tom Goodale\n @desc\n Destroys an httpSocket structure and removes it from the list.\n @enddesc\n @calls\n @calledby\n @history\n\n @endhistory\n\n@@*/\nstatic void SocketDestroy(httpSocket *this)\n{\n if(this)\n {\n if(this->state == open)\n {\n SocketClose(this);\n }\n\n if(this->next)\n {\n this->next->prev = this->prev;\n }\n\n if(this->prev)\n {\n this->prev->next=this->next;\n }\n else\n {\n socklist = this->next;\n }\n\n free(this);\n }\n}\n\n /*@@\n @routine SocketClose\n @date Thu Sep 21 15:04:27 2000\n @author Tom Goodale\n @desc\n Closes the socket associated with an httpSocket structure.\n @enddesc\n @calls\n @calledby\n @history\n\n @endhistory\n\n@@*/\nstatic void SocketClose(httpSocket *this)\n{\n if(this)\n {\n if(this->state == open)\n {\n Socket_CloseSocket (this->filedes);\n this->state=closed;\n FD_CLR (this->filedes, &active_fd_set);\n }\n }\n}\n", "Cookies.h": " /*@@\n @header Cookies.h\n @date Mon Sep 18 22:40:06 2000\n @author Tom Goodale\n @desc \n Functions to manipulate cookies. Was http_Cookies.h; still exported by\n that name\n @enddesc\n @version $Header$\n @@*/\n\n#ifndef __HTTP_COOKIES_H__\n#define __HTTP_COOKIES_H__ 1\n\n#include \"httpRequest.h\"\n\n#ifdef __cplusplus\nextern \"C\" \n{\n#endif\n\nint HTTP_CookieSend(httpRequest *request,\n const char *name, \n const char *value, \n const char *path,\n const char *domain,\n const char *expires,\n int secure);\n\nint HTTP_CookieCancel(httpRequest *request,\n const char *name, \n const char *path);\n\nchar *HTTP_CookieGet(httpRequest *request,\n const char *name);\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* __HTTP_COOKIES_H__ */\n\n", "Startup.c": " /*@@\n @file Startup.c\n @date Wed Sep 13 21:26:56 2000\n @author Tom Goodale\n @desc \n Scheduled routines for the HTTPD thorn.\n @enddesc \n @version $Header$\n @@*/\n\n#include \"cctk.h\"\n#include \n#include \n\n#ifdef HAVE_CAPABILITY_PTHREADS\n#include \n#endif\n\n#include \"cctk_Arguments.h\"\n#include \"cctk_Parameters.h\"\n\n#include \"httpd.h\"\n#include \"Steer.h\"\n#include \"Redirect.h\"\n\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusConnect_HTTPD_Startup_c);\n\n/********************************************************************\n ********************* Local Data Types ***********************\n ********************************************************************/\n\n/********************************************************************\n ********************* Local Routine Prototypes *********************\n ********************************************************************/\n\n#ifdef HAVE_CAPABILITY_PTHREADS\nstatic void * HTTP_Thread(void *cctkGH);\nstatic void HTTP_SetupPollingThread(cGH *cctkGH);\n#endif\n\n/********************************************************************\n ***************** Scheduled Routine Prototypes *********************\n ********************************************************************/\n\nint HTTP_StartServer(void);\nint HTTP_FirstServ(void);\nvoid HTTP_Work(CCTK_ARGUMENTS);\nint HTTP_Shutdown(void);\n\n/********************************************************************\n ********************* Other Routine Prototypes *********************\n ********************************************************************/\n\n/********************************************************************\n ********************* Local Data *****************************\n ********************************************************************/\n\n#ifdef HAVE_CAPABILITY_PTHREADS\nstatic pthread_t polling_thread;\nstatic int thread_started = 0; \n#endif\n\n/********************************************************************\n ********************* External Routines **********************\n ********************************************************************/\n\n\n\n /*@@\n @routine HTTP_StartServer\n @date Wed Sep 13 21:26:56 2000\n @author Tom Goodale\n @desc \n Starts the webserver.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\n\nint HTTP_StartServer(void)\n{\n int use_port;\n char *environ_port;\n DECLARE_CCTK_PARAMETERS\n\n\n#ifndef HAVE_CAPABILITY_PTHREADS\n if (use_pthreads)\n {\n CCTK_WARN (1, \"Parameter 'HTTPD::use_pthreads' is set to \\\"yes\\\" but you \"\n \"didn't compile with PTHREADS. Setting will be ignored.\");\n }\n#endif\n\n /* get HTTPD port to use from the 'port' parameter or the shell environment */\n use_port = port;\n environ_port = getenv (\"HTTPD_PORT\");\n if (environ_port)\n {\n use_port = atoi (environ_port);\n if (use_port >= 1 && use_port <= 65535)\n {\n CCTK_VInfo (CCTK_THORNSTRING, \"Environment variable HTTPD_PORT is set to \"\n \"%d and will override parameter setting from 'HTTPD::port'\",\n use_port);\n }\n else\n {\n CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,\n \"Environment variable HTTPD_PORT is set to '%s' which cannot \"\n \"be parsed as a valid port number. Using parameter setting \"\n \"'HTTPD::port = %d' instead.\", environ_port, (int) port);\n use_port = port;\n }\n }\n\n if(CCTK_MyProc(NULL) == 0)\n {\n /* Does the server provide any pages by default ? */\n if(provide_pages)\n {\n HTTP_RegisterPages();\n }\n \n HTTP_SetupServer(use_port, queue_length, hunt);\n }\n\n /* Do we need to redirect to a master server ? */\n HTTP_SetupRedirect(use_port,queue_length,hunt);\n\n return 0;\n}\n\n /*@@\n @routine HTTP_FirstServ\n @date Tue Nov 12 20:32:36 2002\n @author Tom Goodale\n @desc \n Listen for connection requests.\n @enddesc \n @calls \n @calledby \n @history \n @hdate Tue Nov 12 20:33:07 2002\n @hauthor Tom Goodale\n @hdesc This was originally in HTTP_StartServer but\n that made it impossible to spawn a task telling\n it where the webserver was if httpd::pause was \"true\".\n @endhistory \n \n @@*/\nint HTTP_FirstServ(void)\n{\n\n httpState state;\n\n HTTP_UpdateState(NULL, &state);\n\n do\n {\n if(HTTP_IsServer())\n {\n HTTP_Poll(NULL, state.timeout_seconds, state.timeout_useconds);\n }\n \n if(state.steer == 1)\n {\n HTTP_SteerDispatch();\n\n HTTP_UpdateState(NULL, &state);\n }\n\n if(state.terminate)\n {\n HTTP_Terminate(NULL);\n }\n\n } while(state.paused);\n\n return 0;\n}\n\n /*@@\n @routine HTTP_Work\n @date Wed Sep 13 21:26:56 2000\n @author Tom Goodale\n @desc \n Main working routine for the webserver.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\n\nvoid HTTP_Work(CCTK_ARGUMENTS)\n{\n DECLARE_CCTK_ARGUMENTS\n DECLARE_CCTK_PARAMETERS\n\n httpState state;\n\n#ifdef HAVE_CAPABILITY_PTHREADS\n if(HTTP_IsServer() && use_pthreads && ! thread_started)\n {\n HTTP_SetupPollingThread(cctkGH);\n }\n#endif\n\n HTTP_UpdateState(cctkGH, &state);\n \n do\n {\n#ifdef HAVE_CAPABILITY_PTHREADS\n if(!use_pthreads)\n {\n#endif\n if(HTTP_IsServer())\n {\n HTTP_Poll(cctkGH, state.timeout_seconds, state.timeout_useconds);\n }\n#ifdef HAVE_CAPABILITY_PTHREADS\n }\n#endif\n\n if(state.steer == 1)\n {\n HTTP_SteerDispatch();\n\n HTTP_UpdateState(cctkGH, &state);\n }\n\n if(state.terminate)\n {\n HTTP_Terminate(cctkGH);\n }\n\n } while(state.paused);\n\n}\n\n /*@@\n @routine HTTP_Shutdown\n @date Wed Sep 13 21:26:56 2000\n @author Tom Goodale\n @desc \n Shutdown routine for the webserver.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nint HTTP_Shutdown(void)\n{\n DECLARE_CCTK_PARAMETERS\n#ifdef HAVE_CAPABILITY_PTHREADS\n /* Wait for the polling thread to exit */\n if(HTTP_IsServer() && use_pthreads && thread_started)\n {\n CCTK_ParameterSet(\"terminate\", CCTK_THORNSTRING, \"yes\");\n pthread_join(polling_thread, NULL);\n }\n#endif\n\n if(HTTP_IsServer())\n {\n HTTP_ShutdownServer();\n }\n\n return 0;\n}\n\n/********************************************************************\n ********************* Local Routines *************************\n ********************************************************************/\n\n /*@@\n @routine HTTP_Thread\n @date Wed Oct 25 17:04:59 2000\n @author Tom Goodale\n @desc \n The http thread routine.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n @var cctkGH\n @vdesc The cGH\n @vtype cGH *\n @vio inout\n @vcomment \n \n @endvar \n\n@@*/\n#ifdef HAVE_CAPABILITY_PTHREADS\nstatic void * HTTP_Thread(void *cctkGH)\n{\n CCTK_INT terminate;\n int type;\n\n do\n {\n /* Only poll for a few seconds in case we are terminated */\n HTTP_Poll((cGH *)cctkGH, 10, 0);\n\n terminate = *(const CCTK_INT *)CCTK_ParameterGet(\"terminate\",CCTK_THORNSTRING, &type);\n\n } while(! terminate);\n\n return NULL;\n}\n\n /*@@\n @routine HTTP_SetupPollingThread\n @date Wed Oct 25 17:05:38 2000\n @author Tom Goodale\n @desc \n Sets up the http polling thread.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n @var cctkGH\n @vdesc The cGH\n @vtype cGH *\n @vio inout\n @vcomment \n \n @endvar \n\n@@*/\nstatic void HTTP_SetupPollingThread(cGH *cctkGH)\n{\n if(pthread_create(&polling_thread, NULL, HTTP_Thread, (void *)cctkGH))\n { \n perror(\"pthread_create: \");\n CCTK_Exit(cctkGH,99);\n }\n else\n { \n thread_started = 1;\n }\n}\n#endif /* HAVE_CAPABILITY_PTHREADS */\n", "http.c": " /*@@\n @file http.c\n @date Wed Sep 13 20:44:31 2000\n @author Tom Goodale\n @desc \n Stuff to parse and deal with HTTP requests.\n @enddesc\n @version $Header$\n @@*/\n\n#include \"cctk.h\"\n#include \"cctk_Parameters.h\"\n\n#include \n#include \n\n#ifdef HAVE_SYS_TIME_H\n#include \n#endif\n#ifdef HAVE_SYS_TYPES_H\n#include \n#endif\n#ifdef HAVE_WINSOCK2_H\n#include \n#endif\n#ifdef HAVE_UNISTD_H\n#include \n#endif\n\n#include \n\n#include \"util_String.h\"\n\n#include \"httpd.h\"\n#include \"httpd_Map.h\"\n#include \"SString_Namespace.h\"\n\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusConnect_HTTPD_http_c)\n\n/********************************************************************\n ********************* Local Data Types ***********************\n ********************************************************************/\n\ntypedef struct HTTPArg\n{\n /* Public data */\n char *arg;\n char *value;\n \n /* Private data */ \n struct HTTPArg *next;\n struct HTTPArg *all_next;\n} httpArg_PLACEHOLDER;\n\n/* This is the main structure for storing data about a request. */\ntypedef struct httpRequestTag\n{\n /* Public members of the structure. */\n char *body; /* The body of the request */\n int body_length; /* How long the body is */\n\n const char *method; /* The HTTP method */\n char *uri; /* The URI */\n const char *residual; /* What's left of the URI after subtracting the found page */\n \n /* HTTP version numbers */\n int http_major_version; \n int http_minor_version;\n\n /* How many arguments there are */\n int n_arguments;\n\n /* These are all private members of this structure */\n\n /* The connection data */\n void *connection;\n\n /* The request header lines */\n uMap headers;\n\n /* Stuff for arguments */\n\n /* First a hash table to look the data up quickly */\n uMap arguments;\n\n /* Now a linked list to allow walking. */\n httpArg *firstarg;\n httpArg *lastarg;\n httpArg *currentarg;\n\n} httpRequest_PLACEHOLDER;\n\n#define BLANK_HTTPREQUEST {NULL, 0, NULL, NULL, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL } \n /* Accessors for the httpRequest structure */\nunsigned int HTTP_MajorVersion( const httpRequest *request )\n{\n return request->http_major_version;\n}\n\nunsigned int HTTP_MinorVersion( const httpRequest *request )\n{\n return request->http_minor_version;\n}\n\nunsigned int HTTP_NumArguments( const httpRequest *request )\n{\n return request->n_arguments;\n}\n\nconst char * HTTP_URI( const httpRequest *request )\n{\n return request->uri;\n}\n\nconst char * HTTP_Residual( const httpRequest *request )\n{\n return request->residual;\n}\n\nvoid HTTP_SetResidual( httpRequest *request, const char *residual )\n{\n request->residual = residual;\n}\n\nconst char * HTTP_ArgValue( const httpArg *arg )\n{\n return arg->value;\n}\n\nconst char * HTTP_ArgName( const httpArg *arg )\n{\n return arg->arg;\n}\n\nhttpSocket * HTTP_Connection( const httpRequest *request )\n{\n return request->connection;\n}\n\nSSBOOL HTTP_GetHeaderValueString(const httpRequest *request,\n const String *header, String *value)\n{\n const char * v = HTTP_HeaderValue(request, GetBuffer( header ) );\n if( v )\n {\n SetToCString( value, v );\n return SSTRUE;\n }\n else\n return SSFALSE;\n}\n\nstruct httpHeader\n{\n char *line;\n};\n\n/********************************************************************\n ********************* Local Routine Prototypes *********************\n ********************************************************************/\n\nstatic char *NextLine(char *buffer, int *start, int size);\nstatic int DealWithRequest(cGH *cctkGH, httpRequest *request, char *buffer, \n int bufsize);\nstatic int AddHeader(httpRequest *request, const char *line);\n\nstatic int StripArgs(httpRequest *request, char *request_uri);\nstatic void Decode(char *string);\nstatic int InitialiseRequest(httpRequest *request);\nstatic int ClearRequest(httpRequest *request);\n\nstatic void DestroyHeader(struct httpHeader *header);\nstatic void DestroyArgument(httpArg *argument);\n\n/********************************************************************\n ********************* Other Routine Prototypes *********************\n ********************************************************************/\n\n/********************************************************************\n ********************* Local Data *****************************\n ********************************************************************/\n\n#define INITIAL_SIZE 16\n#define MAXMSG 2048\n#define EMPTY_STRING {'\\0'}\n\n/********************************************************************\n ********************* External Routines **********************\n ********************************************************************/\n\n /*@@\n @routine HTTP_ReadFromClient\n @date Wed Sep 13 20:44:31 2000\n @author Tom Goodale\n @desc \n Reads a request from a client socket.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nint HTTP_ReadFromClient(cGH *cctkGH, void *connection)\n{\n int retval = -1;\n int keepalive = 0;\n char inbuffer[MAXMSG] = EMPTY_STRING;\n httpRequest request = BLANK_HTTPREQUEST;\n int request_buffer_length = 0;\n char *request_buffer = NULL;\n struct timeval timeout = {1, 0};\n int found_eoh = 0;\n int failure_count = 0;\n\n InitialiseRequest(&request);\n\n request.connection = connection;\n\n\n while(! found_eoh)\n {\n int nbytes = HTTP_Read(&request, inbuffer, MAXMSG);\n \n if (nbytes < 0)\n {\n /* Read error. */\n perror (\"HTTP_Read\");\n CCTK_WARN(1, \"Error reading from socket\");\n }\n else if (nbytes == 0)\n { \n CCTK_WARN(1, \"Got 0 bytes when waiting for end of HTTP request header\");\n if(failure_count < 3)\n {\n select (0, NULL, NULL, NULL, &timeout);\n failure_count++;\n }\n else\n {\n /* Give up waiting for this socket */\n CCTK_WARN(1, \"Too many failures reading from socket. Giving up.\");\n request_buffer_length = 0;\n break;\n }\n }\n else\n {\n /* Reallocate space for buffer.\n * Add space for one extra char so can null-terminate to allow string search.\n */\n char *tmp = (char *)realloc(request_buffer, (request_buffer_length+nbytes+1)*sizeof(char));\n if(tmp)\n {\n request_buffer = tmp;\n }\n else\n {\n CCTK_WARN(0, \"Memory allocation failure.\");\n }\n\n /* Copy the new data into the buffer */\n memcpy(request_buffer+request_buffer_length, inbuffer, nbytes);\n request_buffer_length += nbytes;\n /* Add a null byte in the extra allocated space to allow strstr */\n request_buffer[request_buffer_length] = 0;\n\n /* Look for end of HTTP header. \n * Comment out the check for \\n\\n for strict compliance, but this is\n * useful for debugging with telnet.\n */\n if(strstr(request_buffer, \"\\r\\n\\r\\n\") || strstr(request_buffer, \"\\n\\n\"))\n {\n found_eoh = 1;\n#ifdef HTTP_DEBUG\n fprintf (stderr, \"Found end of HTTP header.\\n\");\n#endif\n }\n }\n }\n\n if(request_buffer_length > 0)\n {\n /* Data read. */\n#ifdef HTTP_DEBUG\n fprintf (stderr, \"Server: got message: `%s'\\n\", request_buffer);\n#endif\n\n keepalive = DealWithRequest(cctkGH, &request, request_buffer, request_buffer_length);\n }\n\n if(keepalive)\n {\n retval = 0;\n }\n else\n {\n retval = -1;\n }\n\n if(request_buffer)\n {\n free(request_buffer);\n }\n\n return retval;\n}\n\n /*@@\n @routine HTTP_ArgumentValue\n @date Thu Sep 14 16:40:11 2000\n @author Tom Goodale\n @desc \n Returns the value (if any) of an argument.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nconst char *HTTP_ArgumentValue(const httpRequest *request, const char *arg)\n{\n if(request->arguments)\n {\n const httpArg *value = (httpArg *)Httpd_MapData(request->arguments, strlen(arg), arg);\n\n if(value)\n {\n return value->value;\n }\n }\n\n return NULL;\n}\n\n /*@@\n @routine HTTP_ArgumentWalk\n @date Sat Sep 16 14:41:01 2000\n @author Tom Goodale\n @desc \n Walks the argument list.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nconst httpArg *HTTP_ArgumentWalk(httpRequest *request, int first)\n{\n if(first || ! (request->currentarg))\n {\n request->currentarg = request->firstarg;\n }\n else\n {\n request->currentarg = request->currentarg->all_next;\n }\n\n return request->currentarg;\n}\n\n /*@@\n @routine HTTP_HeaderValue\n @date Thu Sep 14 19:55:04 2000\n @author Tom Goodale\n @desc \n Gets the value of an HTTP header line.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nconst char *HTTP_HeaderValue(const httpRequest *request, const char *header)\n{\n struct httpHeader *header_line;\n\n if(request->headers)\n {\n header_line = Httpd_MapData(request->headers, strlen(header), header);\n\n if(header_line)\n {\n return header_line->line;\n }\n }\n\n return NULL;\n}\n\n/********************************************************************\n ********************* Local Routines *************************\n ********************************************************************/\n\n /*@@\n @routine NextLine\n @date Wed Sep 13 20:44:31 2000\n @author Tom Goodale\n @desc \n Gets the next line from an HTTP header.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic char *NextLine(char *buffer, int *start, int size)\n{\n char *line = NULL;\n int found = 0;\n char *pos;\n\n for(pos = buffer + *start; pos-buffer < size-1; pos++)\n {\n if(*pos == '\\r' && *(pos+1) == '\\n')\n {\n *pos = 0;\n found = 1;\n break;\n }\n }\n \n if(found)\n {\n line = buffer + *start;\n *start = pos-buffer+2;\n }\n else\n {\n *start = size+1;\n }\n\n return line;\n}\n\n /*@@\n @routine DealWithRequest\n @date Wed Sep 13 20:44:31 2000\n @author Tom Goodale\n @desc \n Takes an http request buffer and deals with it.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int DealWithRequest(cGH *cctkGH, httpRequest *request, char *buffer, int bufsize)\n{\n char *line;\n char *tmp = buffer;\n int start = 0;\n char *method = NULL;\n char *request_uri = NULL;\n char *http_version = NULL;\n DECLARE_CCTK_PARAMETERS\n\n#ifdef HTTP_DEBUG\n printf(\"Dealing with request\\n\");\n#endif\n\n line = NextLine(tmp, &start, bufsize);\n\n if(line)\n {\n method = line;\n\n for(; *line; line++)\n {\n if(*line == ' ')\n {\n *line = 0;\n line++;\n if(!request_uri)\n {\n request_uri = line;\n }\n else\n {\n http_version = line;\n break;\n }\n }\n }\n }\n\n if(method)\n {\n#ifdef HTTP_DEBUG\n printf(\"Method: %s\\n\", method);\n#endif\n\n request->method = method; \n }\n\n if(request_uri)\n {\n if (verbose)\n {\n CCTK_VInfo (CCTK_THORNSTRING, \"URI: %s\", request_uri);\n }\n\n request->uri = request_uri; \n StripArgs(request, request->uri);\n }\n\n if(http_version)\n {\n#ifdef HTTP_DEBUG\n printf(\"HTTP: %s\\n\", http_version);\n#endif\n sscanf(http_version, \"%*5s%d%*1[.]%d\", &(request->http_major_version),\n &(request->http_minor_version));\n }\n else\n {\n request->http_major_version = 0;\n request->http_minor_version = 90;\n }\n\n#ifdef HTTP_DEBUG\n printf(\"HTTP Major version: %d\\n\", request->http_major_version);\n printf(\"HTTP Minor version: %d\\n\", request->http_minor_version);\n#endif\n\n#ifdef HTTP_DEBUG\n printf(\"Start of request header\\n\");\n#endif\n\n while((line = NextLine(tmp, &start, bufsize)) != NULL)\n {\n if(! request->body && *line != 0)\n {\n AddHeader(request, line);\n }\n\n#ifdef HTTP_DEBUG\n if(line)\n {\n printf(\"Line is '%s'\\n\", line);\n }\n#endif\n\n if(*line == 0)\n {\n#ifdef HTTP_DEBUG\n printf(\"End of request header\\n\");\n\n printf(\"Start of request body\\n\");\n#endif\n request->body = line + 2;\n }\n }\n\n#ifdef HTTP_DEBUG\n printf(\"End of request body\\n\");\n#endif\n\n request->body_length = buffer + bufsize - request->body;\n\n#ifdef HTTP_DEBUG\n printf(\"Replying...\\n\");\n#endif\n\n if(!strcmp(request->method, \"GET\"))\n {\n HTTP_RequestGET(cctkGH, request);\n }\n else\n {\n HTTP_RequestUnsupported(cctkGH, request);\n }\n \n#ifdef HTTP_DEBUG\n printf(\"Dealt with.\\n\");\n#endif\n\n ClearRequest(request);\n\n return 0;\n}\n\n\n\n /*@@\n @routine AddHeader\n @date Wed Sep 13 20:44:31 2000\n @author Tom Goodale\n @desc \n Stores an HTTP header line on a request.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int AddHeader(httpRequest *request, const char *line)\n{\n int keylength = -1;\n struct httpHeader *header_line;\n /* Split the string */\n char *value = strchr(line, ':');\n\n if(value)\n {\n keylength = value - line;\n \n value++;\n\n /* Strip off leading whitespace */\n for(; *value && (*value == ' ' || *value == '\\t') ; value++);\n\n }\n else\n {\n CCTK_VWarn(1, __LINE__,__FILE__,CCTK_THORNSTRING,\n \"Invalid header line:\\n\\\"%s\\\"\", line );\n }\n \n if(value)\n {\n if(!request->headers)\n {\n /* Need to create the hash table */\n request->headers = Httpd_MapCreate();\n }\n\n if(request->headers)\n {\n /* Does the line already exist ? */\n header_line = (struct httpHeader *)Httpd_MapData(request->headers, keylength, line);\n\n if(header_line)\n {\n char *temp = (char *)realloc(header_line->line, strlen(header_line->line)+strlen(value)+2);\n\n if(temp)\n {\n header_line->line = temp;\n sprintf(header_line->line,\"%s,%s\", header_line->line,value);\n }\n else\n {\n CCTK_WARN( 0, \"Out of memory!\\n\" );\n }\n }\n else\n {\n /* Ok, must create it */\n header_line = (struct httpHeader *)malloc(sizeof(struct httpHeader));\n\n if(header_line)\n {\n header_line->line = (char *)malloc(strlen(value)+1);\n\n if(header_line->line)\n {\n strcpy(header_line->line, value);\n\n Httpd_MapStore(request->headers, keylength, line, (void *)header_line);\n }\n }\n }\n }\n }\n\n return 0;\n}\n\n /*@@\n @routine StripArgs\n @date Thu Sep 14 16:36:56 2000\n @author Tom Goodale\n @desc \n Strips the arguments for a submitted URI from the\n URI and decodes any HTTP encodings.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int StripArgs(httpRequest *request, char *request_uri)\n{\n char *position;\n /* Do we have arguments ? */\n if((position = strchr(request_uri, '?')))\n {\n char *token;\n /* Mark the end of the URI */\n *position = 0;\n\n /* Create the hash table */\n request->arguments = Httpd_MapCreate();\n\n /* Parse the argument list */\n position++;\n\n token = strtok(position, \"&\");\n\n while(token)\n {\n char *value = strchr(token, '=');\n \n if(value)\n {\n httpArg *argument;\n\n *value = 0;\n\n value++;\n\n /* Remove any encoding in the token and value */\n Decode(token);\n Decode(value);\n\n argument = (httpArg *)malloc(sizeof(httpArg));\n\n if(argument)\n {\n httpArg *last = NULL;\n httpArg *stored;\n\n argument->next = NULL;\n argument->all_next = NULL;\n argument->arg = Util_Strdup(token);\n argument->value = Util_Strdup(value);\n\n if((stored = (httpArg *)Httpd_MapData(request->arguments, strlen(token), token)))\n {\n /* Argument already exists */\n\n /* Find the last one on the list */\n for(; stored; stored = stored->next)\n {\n last = stored; \n }\n\n /* Append to local list */\n /* SW it isn't perfecty obvious this non NULL */\n last->next = argument;\n }\n else\n {\n Httpd_MapStore(request->arguments, strlen(token), token, (void *)argument);\n request->n_arguments++;\n }\n /* Append to global list. */\n if(request->lastarg)\n {\n request->lastarg->all_next = argument;\n }\n request->lastarg = argument;\n if(!request->firstarg)\n {\n request->firstarg = argument;\n }\n }\n else\n {\n CCTK_WARN( 0, \"Out of memory!\\n\" );\n }\n }\n else\n {\n CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,\n \"Argument \\\"%s\\\" has no value!\", token );\n } \n token=strtok(NULL, \"&\"); \n }\n }\n else\n {\n request->arguments = NULL;\n }\n\n /* Finally remove any encoding in the URI */\n Decode(request_uri);\n\n return 0;\n}\n\n /*@@\n @routine InitialiseRequest\n @date Sat Sep 16 14:29:17 2000\n @author Tom Goodale\n @desc \n Initialises a request data structure.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int InitialiseRequest(httpRequest *request)\n{\n\n /* Initialise the public data */\n request->body = NULL;\n request->body_length = 0;\n request->method = NULL;\n request->uri = NULL;\n request->residual = NULL;\n\n request->http_major_version = -1;\n request->http_minor_version = -1;\n\n request->n_arguments = 0;\n\n /* Initialise the private data */\n\n request->connection = NULL;\n request->headers = NULL;\n request->arguments = NULL;\n \n request->firstarg = NULL;\n request->lastarg = NULL;\n request->currentarg = NULL;\n\n return 0;\n}\n\n /*@@\n @routine ClearRequest\n @date Wed Sep 13 20:44:31 2000\n @author Tom Goodale\n @desc \n Frees all memory associated with a request.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int ClearRequest(httpRequest *request)\n{\n if(request->arguments)\n {\n Httpd_MapDestroy(request->arguments, (void (*)(void *))DestroyArgument);\n }\n\n if(request->headers)\n {\n Httpd_MapDestroy(request->headers, (void (*)(void *))DestroyHeader);\n }\n\n return 0;\n}\n\n /*@@\n @routine Decode\n @date Thu Sep 14 16:25:25 2000\n @author Tom Goodale\n @desc \n Decode HTTP encodings -\n + -> ' '\n %2-bytehexadecimal -> ascii\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic void Decode(char *string)\n{\n char *position;\n char *to;\n char hexadecimal[3] = {0, 0, 0};\n\n for(position=string, to=position; *position; position++, to++)\n {\n switch(*position)\n {\n case '+' : *to = ' '; break;\n case '%' : hexadecimal[0] = *(position+1);\n hexadecimal[1] = *(position+2);\n position += 2;\n *to = strtol(hexadecimal, NULL, 16);\n break;\n default : *to = *position;\n }\n }\n\n *to = 0;\n}\n\n /*@@\n @routine DestroyHeader\n @date Wed Sep 13 20:44:31 2000\n @author Tom Goodale\n @desc \n Frees all memory associated with a header structure.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic void DestroyHeader(struct httpHeader *header)\n{\n free(header->line);\n free(header);\n}\n\n /*@@\n @routine DestroyArgument\n @date Sat Sep 16 14:10:57 2000\n @author Tom Goodale\n @desc \n Frees all memory associated with an argument.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic void DestroyArgument(httpArg *argument)\n{\n httpArg *next;\n\n for(; argument; argument = next)\n {\n next = argument->next;\n free(argument->arg);\n free(argument->value);\n free(argument);\n }\n}\n\n", "Authorisation.c": " /*@@\n @file Authorisation.c\n @date Fri Sep 15 12:34:59 2000\n @author Tom Goodale\n @desc \n Authorisation stuff for webserver\n @enddesc\n @version $Header\n @@*/\n\n#include \"cctk.h\"\n\n#include \n#include \n#include \n\n#ifdef HAVE_UNISTD_H\n#include \n#endif\n\n#ifdef HAVE_CRYPT_H\n#include \n#endif\n\n#include \"httpd_Map.h\"\n#include \"util_String.h\"\n\n#include \"httpRequest.h\"\n#include \"Auth.h\"\n#include \"SString_Namespace.h\"\n\n#include \"base64.h\"\n\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusConnect_HTTPD_Authorisation_c)\n\n/********************************************************************\n ********************* Local Data Types ***********************\n ********************************************************************/\n\nstruct httpUserData\n{\n char *password;\n char *encryption_scheme;\n};\n\n/********************************************************************\n ********************* Local Routine Prototypes *********************\n ********************************************************************/\n\nstatic int AddUser(uMap database, \n const char *name,\n const char *password,\n const char *encryption_scheme);\n\nstatic int VerifyPassword(const char *database, \n const char *user, \n const char *password);\n\n/********************************************************************\n ********************* Other Routine Prototypes *********************\n ********************************************************************/\n\n/********************************************************************\n ********************* Local Data *****************************\n ********************************************************************/\n\nstatic uMap AuthDatabase = NULL;\n\n#define INITIAL_SIZE 32\n#define DECODED_SIZE 100\n\n/********************************************************************\n ********************* External Routines **********************\n ********************************************************************/\n\n /*@@\n @routine HTTP_AuthAddUser\n @date Fri Sep 15 12:52:09 2000\n @author Tom Goodale\n @desc \n Adds a user to a http authentication database.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nint HTTP_AuthAddUser(const char *database, \n const char *name,\n const char *password,\n const char *encryption_scheme)\n{\n int retcode = -1;\n uMap this_database = NULL;\n\n /* Create the master database if necessary */\n if(!AuthDatabase)\n {\n AuthDatabase = Httpd_MapCreate();\n }\n\n if(AuthDatabase)\n {\n /* Does this database exist ? */\n this_database = (uMap)Httpd_MapData(AuthDatabase, strlen(database), database);\n\n if(!this_database)\n {\n this_database = Httpd_MapCreate();\n\n if(this_database)\n {\n Httpd_MapStore(AuthDatabase, strlen(database), database, (void *)this_database);\n }\n else\n {\n retcode = -2;\n }\n }\n }\n\n /* Now add the user to the database */\n if(this_database)\n {\n retcode = AddUser(this_database, name, password, encryption_scheme);\n }\n\n return retcode;\n}\n\n\n /*@@\n @routine HTTP_AuthenticateBasic\n @date Fri Sep 15 13:12:43 2000\n @author Tom Goodale\n @desc \n Authenticates an HTTP request against \n a particular database.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n @returntype int\n @returndesc\n The authorisation status.\n +1 means that there was no Authorization header.\n 0 succesful authentication\n -1 failed authentication\n @endreturndesc\n\n@@*/\nint HTTP_AuthenticateBasic(httpRequest *request,\n const char *database,\n char *user,\n int length)\n{\n int retval = -1;\n\n char *auth_string = NULL;\n char *token;\n \n int decoded_size = 0;\n char decoded[DECODED_SIZE+1] = {'\\0'};\n \n char *password = NULL;\n\n int authorised = 0;\n\n const char *value = HTTP_HeaderValue(request, \"Authorization\");\n\n /* Null terminate the user string */ \n if(user && length > 0)\n {\n *user = 0;\n }\n\n /* Ok, there's an authentication string here. */\n if(value)\n {\n auth_string = Util_Strdup(value);\n \n token = strtok(auth_string, \" \");\n\n if(token)\n {\n if(CCTK_Equals(token, \"Basic\"))\n {\n token = strtok(NULL, \" ,\\t\");\n decoded_size = HTTP_b64_pton(token, (unsigned char *) decoded,\n DECODED_SIZE);\n \n /* Null terminate string */\n decoded[decoded_size] = 0;\n\n password = strchr(decoded, ':');\n\n if(password)\n {\n *password = 0;\n password++;\n\n authorised = VerifyPassword(database, decoded, password);\n if(user && (int) strlen(user) < decoded_size)\n {\n sprintf(user,\"%s\", decoded);\n }\n }\n }\n }\n\n if(auth_string)\n {\n free(auth_string);\n }\n\n if(authorised)\n {\n retval = 0;\n }\n }\n else\n {\n /* There's no authentication string here */\n\n retval = 1;\n \n }\n\n return retval;\n}\n\n/********************************************************************\n ********************* Local Routines *************************\n ********************************************************************/\n\n /*@@\n @routine AddUser\n @date Fri Sep 15 12:52:37 2000\n @author Tom Goodale\n @desc \n Adds a user to a particular database.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int AddUser(uMap database, \n const char *name,\n const char *password,\n const char *encryption_scheme)\n{\n int retcode = -1;\n\n /* Does this user already exist ? */\n struct httpUserData * this_user = (struct httpUserData *)Httpd_MapData(\n database, strlen(name), name);\n\n if(!this_user)\n {\n /* New user */\n\n this_user = (struct httpUserData *)malloc(sizeof(struct httpUserData));\n\n if(this_user)\n {\n this_user->password = Util_Strdup(password);\n this_user->encryption_scheme = Util_Strdup(encryption_scheme);\n\n retcode = Httpd_MapStore(database, strlen(name), name, (void *)this_user);\n }\n }\n else\n {\n /* Replace user's current data */\n free(this_user->password);\n free(this_user->encryption_scheme);\n\n this_user->password = Util_Strdup(password);\n this_user->encryption_scheme = Util_Strdup(encryption_scheme);\n\n retcode = 0;\n }\n\n return retcode;\n}\n\n /*@@\n @routine VerifyPassword\n @date Fri Sep 15 13:28:50 2000\n @author Tom Goodale\n @desc \n Verifies a user and password against a database.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int VerifyPassword(const char *database, \n const char *user, \n const char *password)\n{\n int retcode = 0;\n\n if(AuthDatabase)\n {\n /* Does this database exist ? */\n uMap this_database = (uMap)Httpd_MapData(AuthDatabase,\n strlen(database), database);\n\n if(this_database)\n {\n struct httpUserData *data = (struct httpUserData *) Httpd_MapData(\n this_database, strlen(user), user);\n\n if(data)\n {\n /* Ok, now verify the password. */\n if(CCTK_Equals(data->encryption_scheme, \"none\"))\n {\n if(!strcmp(data->password, password))\n {\n retcode = 1;\n }\n }\n else if(CCTK_Equals(data->encryption_scheme, \"crypt\"))\n {\n#ifdef HAVE_CRYPT\n if(!strcmp(data->password, crypt(password, data->password)))\n {\n retcode = 1;\n }\n#else\n\t CCTK_WARN( 1, \"Sorry, crypt(3) not supported in this configuration.\" );\n#endif\n }\n else\n {\n CCTK_VWarn(1, __LINE__,__FILE__,CCTK_THORNSTRING,\n \"Unknown encryption algorithm: %s\",\n data->encryption_scheme );\n } \n }\n }\n }\n\n return retcode;\n}\n", "SStringHTML.h": " /*@@\n @file SStringHTML.h\n @date 02.04.2004\n @author Steve White\n @desc Extension to Strings module with function specific to HTML\n @enddesc\n @version $Header$\n @@*/\n#ifndef _SSTRINGHTML_H\n#define _SSTRINGHTML_H\n\n#include \"SString.h\"\n\n/*\nconst String * StringHTMLBodyTag = StringHTMLBeginTag( BODY, NULL );\nconst String * StringHTMLBodyEndTag = StringHTMLEndTag( BODY, NULL );\nString *\tStringSGMLEntity( SGMLEntityNum n );\n*/\n\n/* At least encode unsafe ASCII according to rfc1738.html\n * < > & # % \" ' space tab { } | \\ ^ ~ ] [ ` ? ; : , @ = \n * as well as 80-FF 00-1F and 7F\n * should be changed to %nn where nn is the hex representation of\n * the ASCII value.\n *\n * If move to bigger characters will have to encode more.\n * */\n#ifdef __cplusplus\nextern \"C\"\n{\n#endif\n\nString * StringSetToEncodedURLCString( String * str, const char *c );\nString * StringEncodeURL( String * str );\n\n/* Replace < > & with character entities\n * */\nString * StringSetToEncodedHTMLCString( String * str, const char *c );\nString * StringEncodeHTML( String * str );\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n", "Parameters.c": " /*@@\n @file Parameters.c\n @date Wed Sep 13 23:47:43 2000\n @author Tom Goodale\n @desc \n Files for displaying and steering parameters\n @enddesc\n @version $Header$\n @@*/\n\n#include \n#include \n#include \n\n#ifdef HAVE_UNISTD_H\n#include \n#endif\n\n#include \"cctk.h\"\n\n#include \"util_String.h\"\n\n#include \"httpRequest.h\"\n\n#include \"Auth.h\"\n#include \"Steer.h\"\n\n#include \"Content.h\"\n\n#include \"cctk_Parameters.h\"\n\n#include \"SString_Namespace.h\"\n#include \"SStringHTML_Namespace.h\"\n\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusConnect_HTTPD_Parameters_c)\n\n/********************************************************************\n ********************* Local Data Types ***********************\n ********************************************************************/\n\n/********************************************************************\n ********************* Local Routine Prototypes *********************\n ********************************************************************/\n\nstatic int MainParameterPage(const cGH *cctkGH, httpRequest *request, void *data);\nstatic int ThornParameterPage(const cGH *cctkGH, httpRequest *request, void *data);\nstatic int ParameterPage(const cGH *cctkGH, httpRequest *request, void *data);\n\n\n/********************************************************************\n ********************* Other Routine Prototypes *********************\n ********************************************************************/\n\nint HTTPi_RegisterParameterPages(void);\n\n/********************************************************************\n ********************* Local Data *****************************\n ********************************************************************/\n\nstatic const char *notauthorized_page =\n\"\\nError 401: Not Authorized\\\nYou are not authorized to access this page\\n\\n\";\n\n\n#define USER_LENGTH 255\n/********************************************************************\n ********************* External Routines **********************\n ********************************************************************/\n\n /*@@\n @routine HTTPi_RegisterParameterPages\n @date Wed Sep 13 23:47:43 2000\n @author Tom Goodale\n @desc \n Main page registration routine.\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nint HTTPi_RegisterParameterPages(void)\n{\n DECLARE_CCTK_PARAMETERS\n \n int i;\n char pagename[27+20+100]; /* Thorns have maximum length\n then added 100 for parameters */\n union\n {\n const cParamData *pData;\n void *non_const_pData;\n } u;\n\n /* Two ways to do this - can either just have one function\n * registered as /Parameters which then checks request->residual,\n * to see what the actual accessed page is, or can register a \n * main page and one for each thorn.\n * Choose the latter for the mo to keep functions smaller, and also\n * since the compiled thorn list is static at the moment.\n */\n\n HTTP_RegisterPage(\"/Parameters/index.html\", MainParameterPage, NULL);\n \n HTTP_ContentLink(\"/Parameters/index.html\", \"Parameters\",\n \"Parameter Information and Control\",\n HTTP_QUICKLINK);\n\n for (i = 0; i < CCTK_NumCompiledThorns (); i++)\n {\n const char *thorn = CCTK_CompiledThorn(i);\n char *namecopy;\n int first = 1;\n\n sprintf(pagename,\"/Parameters/%s\", thorn);\n\n namecopy = Util_Strdup(thorn);\n\n HTTP_RegisterPage(pagename, ThornParameterPage, namecopy);\n\n /* Walk through all parameters of given implementation. */\n while(CCTK_ParameterWalk(first, thorn, NULL, &u.pData) == 0)\n {\n first = 0;\n sprintf(pagename,\"/Parameters/%s/%s\",thorn,u.pData->name);\n HTTP_RegisterPage(pagename, ParameterPage, u.non_const_pData);\n }\n }\n\n return 0;\n}\n\n\n/********************************************************************\n ********************* Local Routines *************************\n ********************************************************************/\n\n\nstatic void\nSendHTTP_Redirect_Header( httpRequest *request )\n{\n /* Now redirect the browser to the normal page */\n /* Status message */\n if(HTTP_MajorVersion( request ) < 1 || \n (HTTP_MajorVersion( request ) == 1 && HTTP_MinorVersion( request ) < 1))\n {\n /* Older browsers don't understand 303 */\n HTTP_Send(request,\"HTTP/1.0 302 Found\\r\\n\");\n }\n else\n {\n HTTP_Send(request,\"HTTP/1.0 303 See Other\\r\\n\");\n }\n}\n\nstatic void\nSendHTTP_Uauthorized_Header( httpRequest *request )\n{\n HTTP_Send(request,\"HTTP/1.0 401 Unauthorized\\r\\n\"); \n \n HTTP_Send(request,\"WWW-Authenticate: Basic realm=\\\"foo\\\"\\r\\n\"); \n \n HTTP_Send(request,\"Content-Type: text/html\\r\\n\\r\\n\");\n \n}\n\n/******************************************************************************\n ***************************** Parameter Pages ********************************\n ******************************************************************************/\n\n\n /*@@\n @routine MainParameterPage\n @date Wed Sep 13 23:47:43 2000\n @author Tom Goodale\n @desc \n Displays the parameter page.\n @enddesc \n @calls \n @calledby \n @history \n @hdate Sat Sep 16 15:13:16 2000 @hauthor Tom Goodale\n @hdesc Copied content format from original http thorn\n developed by Werner Benger, with the aesthetic\n enhancements of Gabrielle Allen, John Shalf and\n Ed Seidel.\n @endhistory \n@@*/\nstatic int MainParameterPage(const cGH *cctkGH, httpRequest *request, void *data)\n{\n int retval = -1;\n String *message = String_New();\n int i;\n\n /* avoid compiler warning about unused parameter */\n data = data;\n\n HTTP_SendOKHeader( request );\n\n HTTP_SetDoctype( message );\n HTTP_SendString(request, message);\n /* Start the page */\n HTTP_Send(request, \"Cactus Parameters Request\\n\");\n HTTP_SetHeadInfo( message);\n HTTP_SendString(request, message );\n Truncate( message, 0 );\n\n HTTP_Send(request, \"\\n\\n\\n\");\n\n HTTP_SetContentHeaderString(cctkGH,0,message,NULL);\n HTTP_SendString(request, message);\n\n HTTP_Send(request,\n \"

    Check/Modify Parameters

    \\n\"\n \"

    From this page you can check the values of all parameters for \\n\"\n \"the simulation, and modify any parameters which have been \\n\"\n \"designated as steerable

    \\n\"\n \"

    Parameters can be viewed for all Active Thorns, that is,\\n\"\n \"for thorns which have been activated in the parameter file for the\\n\"\n \" simulation. \\n\"\n \"Select one of the active thorns for this simulation from the list \\n\"\n \"below to view all of its parameters

    \\n\"\n \"

    Steerable parameters can be identified by the presence of a \\n\"\n \"form input box, to change the value of a parameter, simply edit \\n\"\n \"the value in the box and press the submit button to register the \\n\"\n \"new values.

    \\n\"\n \"
    \\n\"\n \"\\n\"\n \"\\n\");\n\n for (i = 0; i < CCTK_NumCompiledThorns (); i++)\n {\n const char *thorn = CCTK_CompiledThorn (i);\n \n if (CCTK_IsThornActive (thorn))\n {\n SetToCString(message, \"\\n\\n\\n\\n\");\n HTTP_SendString(request, message);\n \n }\n }\n\n HTTP_Send(request,\"
    Thorn NameImplementation
    \");\n ConcatCString(message, thorn);\n ConcatCString(message, \"\");\n ConcatCString(message, CCTK_ThornImplementation(thorn));\n ConcatCString(message, \"
    \");\n\n /* Write out the footer part. */\n \n HTTP_SetContentFooterString(cctkGH, 0, message);\n retval = HTTP_SendString(request, message);\n\n String_Delete( message );\n return retval;\n}\n\n /*@@\n @routine ThornParameterPage\n @date Sat Sep 16 15:13:55 2000\n @author Tom Goodale\n @desc\n Parameter page for a thorn.\n Checks to see if it is a setting request or \n an info request and behaves accordingly.\n \n Copied content format from original http thorn\n developed by Werner Benger, with the aesthetic\n enhancements of Gabrielle Allen, John Shalf and\n Ed Seidel.\n\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int ThornParameterPage(const cGH *cctkGH, httpRequest *request, void *data)\n{\n int retval=0;\n int i;\n String * message = String_New();\n String * menu = String_New();\n String * temp = String_New();\n const char *thorn = (const char *)data;\n const cParamData *pData;\n char user[USER_LENGTH+1] = EMPTYSTRING;\n\n\n int notauthorised = HTTP_AuthenticateBasic(request, \"user\", user,\n USER_LENGTH);\n int readonly = notauthorised;\n \n if(HTTP_NumArguments( request ) > 0)\n {\n /* This is a parameter set request */\n\n if(!notauthorised)\n {\n if(!readonly)\n {\n const httpArg *argument;\n /* Queue parameters for steering */\n int first = 1;\n while((argument = HTTP_ArgumentWalk(request, first)) != NULL)\n {\n first = 0;\n CCTK_VWarn(5, __LINE__,__FILE__,CCTK_THORNSTRING,\n \"Setting %s::%s%s\",\n thorn,\n HTTP_ArgName( argument),\n HTTP_ArgValue( argument ) );\n HTTP_SteerQueue(thorn, HTTP_ArgName( argument),\n HTTP_ArgValue( argument ));\n }\n }\n SendHTTP_Redirect_Header( request );\n\n ConcatCString(message, \"Location: /Parameters/\");\n ConcatCString(message, thorn);\n ConcatCString(message, \"/\\r\\n\\r\\n\");\n\n HTTP_SendString(request, message);\n }\n else\n {\n SendHTTP_Uauthorized_Header( request );\n \n HTTP_Send(request, notauthorized_page);\n }\n\n } \n else\n { \n /* Display the page. */\n /* Status message */\n HTTP_SendOKHeader( request );\n\n HTTP_SetDoctype( message );\n HTTP_SendString(request, message);\n\n /* Start the page */\n SetToCString(message, \"\\nCactus Parameters Request : \");\n ConcatCString(message, thorn);\n ConcatCString(message, \"\\n\");\n HTTP_SendString(request, message );\n\n HTTP_SetHeadInfo( message);\n HTTP_SendString(request, message );\n\n HTTP_Send(request, \" \\n\");\n\n HTTP_Send(request, \"\\n\\n\");\n\n Truncate( message, 0 );\n\n if (CCTK_NumCompiledThorns()>0)\n {\n SetToCString(menu, \"

    Parameters:

    \\n\");\n }\n /* Menu for this page */\n for (i = 0; i < CCTK_NumCompiledThorns (); i++)\n {\n const char *menuthorn = CCTK_CompiledThorn (i); \n if (CCTK_IsThornActive (menuthorn))\n {\n ConcatCString(menu, \" \");\n ConcatCString(menu, menuthorn);\n ConcatCString(menu, \"
    \\n\");\n }\n }\n HTTP_SetContentHeaderString(cctkGH,0,message,menu);\n HTTP_SendString(request, message);\n\n if (!CCTK_IsThornActive(thorn))\n {\n SetToCString(message, \" Thorn \");\n ConcatCString(message, thorn);\n ConcatCString(message, \" is not active !!!
    \\n\");\n HTTP_SendString(request, message);\n }\n else\n {\n int nfixed=0;\n int nsteerable=0;\n int first = 1;\n /* Send table of available parameters for given thorn */\n /* Steerable parameters can be edited in a FORM. */\n SetToCString(message,\n \"

    Check/Modify Parameters

    \\n\"\n \"

    Thorn \");\n ConcatCString(message, thorn);\n ConcatCString(message,\n \"

    \\n\");\n ConcatCString(message,\n \"

    Parameters in Cactus can be either fixed or steerable. \\n\"\n \"Steerable parameters are those which can be modified during a simulation.\\n\"\n \"To change steerable parameters, edit the values and press \"\n \" the submit button.\\n\"\n \"Before applying the new parameter value, Cactus will check that the\\n\"\n \"parameter lies in the allowed range. \\nNote that there\"\n \" is currently no log of parameters which have been modified.

    \\n\"\n \"

    The tables below show the parameter name, current value and description.\\n\"\n \"The default value of each parameter is shown in brackets at the end of the description.

    \"\n \"\\n\");\n\n HTTP_SendString(request, message);\n HTTP_Send(request, \"
    \\n\");\n \n if(!readonly )\n {\n SetToCString(message,\"
    \\n\");\n HTTP_SendString(request, message);\n }\n\n /* Walk through all steerable parameters of given implementation. */\n \n while(CCTK_ParameterWalk(first, thorn, NULL, &pData) == 0)\n {\n char *value = CCTK_ParameterValString (pData->name, pData->thorn);\n Truncate(message,0);\n first = 0;\n\n if(value)\n { \n if (pData->steerable == CCTK_STEERABLE_ALWAYS)\n {\n\n if (nsteerable == 0)\n {\n ConcatCString(message,\"

    Steerable Parameters

    \\n\");\n if (readonly)\n {\n ConcatCString(message,\n \"

    The following parameters are steerable, \"\n \"but you do not have authorisation to change them. \\n\"\n \"To change parameters you must first register on the \"\n \"Simulation Control Page.\"\n \"

    \\n\");\n }\n ConcatCString(message,\n \"\\n\");\n }\n nsteerable++;\n\n if (!readonly)\n {\n int param_type;\n if (pData->type == PARAMETER_BOOLEAN)\n {\n /* Steerable boolean */\n int param_bool = \n *((const CCTK_INT *)CCTK_ParameterGet(pData->name,thorn,¶m_type));\n ConcatCString(message, \"\\n\\n\"\n \"\\n\"\n \"\\n\"\n \"\\n\");\n }\n else if (pData->type == PARAMETER_KEYWORD)\n {\n t_range *range;\n /* Steerable keyword */\n CCTK_ParameterGet(pData->name,thorn,¶m_type);\n\n ConcatCString(message,\"\\n\\n\");\n ConcatCString(message,\"\\n\\n\\n\");\n }\n else\n {\n /* Steerable nonboolean */\n ConcatCString(message, \"\\n\\n\"\n \"\\n\"\n \"\\n\\n\");\n }\n }\n else\n {\n /* Steerable but no authority */\n ConcatCString(message, \"\\n\\n\");\n }\n }\n free (value);\n }\n HTTP_SendString(request, message);\n\n } \n\n if (nsteerable>0)\n {\n HTTP_Send(request, \"
    thorn);\n ConcatCString(message, \"/\");\n ConcatCString(message, pData->name);\n ConcatCString(message, \"\\\">\");\n ConcatCString(message, pData->name);\n ConcatCString(message, \"\"\n \"Yes \\nname);\n ConcatCString(message, \"\\\" \");\n ConcatCString(message, param_bool ? \"checked=\\\"checked\\\"\" : \"\");\n ConcatCString(message, \" value=\\\"1\\\" />\"\n \" \"\n \"No \\nname);\n ConcatCString(message, \"\\\" \");\n ConcatCString(message, param_bool ? \"\" : \"checked=\\\"checked\\\"\");\n ConcatCString(message, \" value=\\\"0\\\" />\"\n \"\");\n SetToEncodedHTMLCString( temp, pData->description );\n Concat(message, temp );\n ConcatCString(message, \" (\");\n ConcatCString(message, pData->defval);\n ConcatCString(message, \")
    thorn);\n ConcatCString(message, \"/\");\n ConcatCString(message, pData->name);\n ConcatCString(message, \"\\\">\");\n ConcatCString(message, pData->name);\n ConcatCString(message, \" \\n\");\n ConcatCString(message,\"\");\n SetToEncodedHTMLCString( temp, pData->description );\n Concat(message, temp);\n ConcatCString(message, \" (\");\n SetToEncodedHTMLCString( temp, pData->defval );\n Concat(message, temp);\n ConcatCString(message, \")
    thorn);\n ConcatCString(message, \"/\");\n ConcatCString(message, pData->name);\n ConcatCString(message, \"\\\">\");\n ConcatCString(message, pData->name);\n ConcatCString(message, \"name);\n ConcatCString(message, \"\\\" value=\\\"\");\n ConcatCString(message, value);\n ConcatCString(message, \"\\\" />\");\n SetToEncodedHTMLCString( temp, pData->description );\n Concat(message, temp);\n ConcatCString(message, \" (\");\n SetToEncodedHTMLCString( temp, pData->defval );\n Concat(message, temp);\n ConcatCString(message, \")
    thorn);\n ConcatCString(message, \"/\");\n ConcatCString(message, pData->name);\n ConcatCString(message, \"\\\">\");\n ConcatCString(message, pData->name);\n ConcatCString(message, \"\");\n ConcatCString(message, value);\n ConcatCString(message, \"\");\n SetToEncodedHTMLCString( temp, pData->description );\n Concat(message, temp);\n ConcatCString(message, \" (\");\n SetToEncodedHTMLCString( temp, pData->defval );\n Concat(message, temp);\n ConcatCString(message, \")
    \\n\");\n }\n else\n {\n HTTP_Send(request, \"

    This thorn has no steerable parameters.

    \\n\");\n }\n\n if(!readonly && nsteerable>0)\n {\n HTTP_Send(request,\n \"\\n\"\n \"
    \\n\");\n }\n\n\n /* Walk through non-all steerable parameters of given implementation. */\n first = 1;\n \n while(CCTK_ParameterWalk(first, thorn, NULL, &pData) == 0)\n {\n char *value;\n first = 0;\n Truncate(message,0);\n \n value = CCTK_ParameterValString (pData->name, pData->thorn);\n if(value)\n { \n if (!(pData->steerable == CCTK_STEERABLE_ALWAYS))\n {\n \n if (nfixed == 0)\n {\n ConcatCString(message,\"

    Fixed Parameters

    \\n\"\n \"\");\n }\n nfixed++;\n\n /* FIXME: This is a hack - should put in parameter tags. */\n if(strcmp(thorn,CCTK_THORNSTRING) ||\n (strcmp(pData->name,\"user\") && \n strcmp(pData->name,\"password\") &&\n strcmp(pData->name,\"encryption_scheme\")))\n {\n \n ConcatCString(message, \"\\n\\n\\n\\n\\n\");\n }\n }\n free(value);\n }\n HTTP_SendString(request, message);\n\n } \n\n if (nfixed>0)\n {\n HTTP_Send(request, \"
    thorn);\n ConcatCString(message, \"/\");\n ConcatCString(message, pData->name);\n ConcatCString(message, \"\\\">\");\n ConcatCString(message, pData->name);\n ConcatCString(message, \"\");\n ConcatCString(message, value);\n ConcatCString(message, \"\");\n SetToEncodedHTMLCString( temp, pData->description );\n Concat(message, temp);\n ConcatCString(message, \" (\");\n SetToEncodedHTMLCString( temp, pData->defval );\n Concat(message, temp);\n ConcatCString(message, \")
    \\n\");\n }\n else\n {\n HTTP_Send(request, \"

    This thorn has no fixed parameters.

    \\n\");\n }\n\n HTTP_Send(request, \"
    \\n\");\n }\n\n /* Write out the footer part. */\n \n HTTP_SetContentFooterString(cctkGH, 0, message);\n retval = HTTP_SendString(request, message);\n } /* n_arguments > 0 */\n String_Delete( message );\n String_Delete( menu );\n String_Delete( temp );\n return retval;\n}\n\n /*@@\n @routine ParameterPage\n @date Thu Sep 21 15:13:55 2000\n @author Gabrielle Allen\n @desc\n Page for an individual parameter\n Lots copied from ThornParameterPage\n @enddesc \n @calls \n @calledby \n @history \n \n @endhistory \n\n@@*/\nstatic int ParameterPage(const cGH *cctkGH, httpRequest *request, void *data)\n{\n int retval=0;\n String * message = String_New();\n String * menu = String_New();\n String * temp = String_New();\n int first = 1;\n const cParamData *pData = (cParamData *)data;\n const cParamData *pDataWalk=NULL;\n char *value;\n char user[USER_LENGTH+1] = EMPTYSTRING;\n int notauthorised = HTTP_AuthenticateBasic(request, \"user\", user,\n USER_LENGTH);\n int readonly = notauthorised;\n \n if(HTTP_NumArguments( request ) > 0)\n {\n /* This is a parameter set request */\n\n if(!notauthorised)\n {\n if(!readonly)\n {\n const httpArg *argument;\n /* Queue parameters for steering */\n first = 1;\n while((argument = HTTP_ArgumentWalk(request, first)) != NULL)\n {\n first = 0;\n fprintf(stderr, \"Setting %s::%s to %s\\n\", pData->thorn,\n HTTP_ArgName( argument),\n HTTP_ArgValue( argument ));\n HTTP_SteerQueue(pData->thorn, HTTP_ArgName( argument),\n HTTP_ArgValue( argument ));\n }\n }\n SendHTTP_Redirect_Header( request );\n ConcatCString(message, \"Location: /Parameters/\");\n ConcatCString(message, pData->thorn);\n ConcatCString(message, \"/\\r\\n\\r\\n\");\n\n HTTP_SendString(request, message);\n }\n else\n {\n SendHTTP_Uauthorized_Header( request );\n \n HTTP_Send(request, notauthorized_page);\n }\n } \n else\n { \n t_range *range;\n /* Display the page. */\n HTTP_SendOKHeader( request );\n\n HTTP_SetDoctype( message );\n HTTP_SendString(request, message);\n /* Start the page */\n HTTP_Send(request, \"\\n\");\n\n SetToCString(message, \"Cactus Parameter Request : \");\n ConcatCString(message, pData->name);\n ConcatCString(message, \"\\n\");\n\n HTTP_SendString(request, message);\n\n HTTP_SetHeadInfo( message);\n HTTP_SendString(request, message );\n HTTP_Send(request, \"\\n\");\n\n HTTP_Send(request,\"\\n\\n\");\n\n Truncate( message, 0 );\n\n /* Menu for this page */\n first = 1;\n while(CCTK_ParameterWalk(first, pData->thorn, NULL, &pDataWalk) == 0)\n {\n if (first==1)\n {\n ConcatCString(menu,\"

    \");\n ConcatCString(menu, pDataWalk->thorn);\n ConcatCString(menu, \":

    \\n\");\n }\n first = 0;\n ConcatCString(menu, \" thorn);\n ConcatCString(menu, \"/\");\n ConcatCString(menu, pDataWalk->name);\n ConcatCString(menu, \"\\\">\");\n ConcatCString(menu, pDataWalk->name);\n ConcatCString(menu, \"
    \\n\");\n }\n \n HTTP_SetContentHeaderString(cctkGH,0,message,menu);\n HTTP_SendString(request, message);\n\n SetToCString(message,\"

    \");\n ConcatCString(message, pData->thorn);\n ConcatCString(message, \": \");\n ConcatCString(message, pData->name);\n ConcatCString(message, \"

    \\n\");\n HTTP_SendString(request, message);\n\n SetToCString(message,\n \"
    Return to all parameters for this \\n\"\n \"thorn));\n ConcatCString(message,\n \"\\\">thorn.
    \");\n\n HTTP_SendString(request, message);\n \n value = CCTK_ParameterValString (pData->name, pData->thorn);\n\n /* FIXME: HACK need a tag on parameter definition */\n if(strcmp(pData->thorn,CCTK_THORNSTRING) ||\n (strcmp(pData->name,\"user\") && \n strcmp(pData->name,\"password\") &&\n strcmp(pData->name,\"encryption_scheme\")))\n {\n\n SetToCString(message,\"
    \\n\"\n \"\\n\" );\n ConcatCString(message, \"\\n\\n\\n\\n\" );\n ConcatCString(message, \"\\n\\n\\n\\n\" );\n ConcatCString(message, \"\\n\\n\\n\\n\" );\n ConcatCString(message, \"\\n\\n\\n\\n\" );\n ConcatCString(message, \"\\n\\n\\n\\n\" );\n ConcatCString(message, \"\\n\\n\\n\");\n HTTP_SendString(request, message);\n SetToCString(message,\"\\n\\n\\n\\n\");\n HTTP_SendString(request, message);\n\n SetToCString(message,\"\\n\"\n \"\\n\\n\\n\");\n\n HTTP_SendString(request, message);\n\n \n SetToCString(message,\"\\n\");\n break;\n case SCOPE_RESTRICTED : \n ConcatCString(message,\"Restricted\\n\");\n break;\n case SCOPE_PRIVATE : \n ConcatCString(message,\"Private\\n\");\n break;\n default :\n ConcatCString(message,\"Not matched\\n\");\n }\n\n HTTP_SendString(request, message);\n\n Truncate(message,0);\n first = 1;\n for(range = pData->range; range ; range = range->next)\n {\n if (first==1)\n {\n ConcatCString(message,\n \"\\n\"\n \"\\n\\n\\n\");\n }\n\n HTTP_SendString(request, message);\n \n SetToCString(message, \"\\n\\n\\n\\n
    Name:\");\n ConcatCString(message, pData->name);\n ConcatCString(message, \"
    Thorn:\");\n ConcatCString(message, pData->thorn);\n ConcatCString(message, \"
    Implementation:\");\n ConcatCString(message, CCTK_ThornImplementation(pData->thorn));\n ConcatCString(message, \"
    Current value:\");\n ConcatCString(message, value);\n ConcatCString(message, \"
    Description::\");\n SetToEncodedHTMLCString( temp, pData->description );\n Concat(message, temp);\n ConcatCString(message, \"
    Default:::\");\n SetToEncodedHTMLCString( temp, pData->defval );\n Concat(message, temp);\n ConcatCString(message, \"
    Steerable:\");\n\n switch(pData->steerable)\n {\n case CCTK_STEERABLE_ALWAYS : \n ConcatCString(message,\"Always\");\n break;\n case CCTK_STEERABLE_NEVER : \n ConcatCString(message,\"Never\");\n break;\n case CCTK_STEERABLE_RECOVER : \n ConcatCString(message,\"Recovery\");\n break;\n default :\n ConcatCString(message,\"Not matched\");\n }\n ConcatCString(message,\"
    Type:\");\n switch(pData->type)\n {\n case PARAMETER_BOOLEAN : \n ConcatCString(message,\"Boolean\");\n break;\n case PARAMETER_REAL : \n ConcatCString(message,\"Real\");\n break;\n case PARAMETER_INTEGER : \n ConcatCString(message,\"Integer\");\n break;\n case PARAMETER_SENTENCE : \n ConcatCString(message,\"Sentence\");\n break;\n case PARAMETER_STRING : \n ConcatCString(message,\"String\");\n break;\n case PARAMETER_KEYWORD : \n ConcatCString(message,\"Keyword\");\n break;\n default :\n ConcatCString(message,\"Not matched\");\n }\n ConcatCString(message,\"
    Scope:\");\n switch(pData->scope)\n {\n case SCOPE_GLOBAL : \n ConcatCString(message,\"Global
    \\n\"\n \"Range:\"\n \"
    \\n\"\n );\n }\n first = 0;\n ConcatCString(message, \"
    \");\n ConcatCString(message, range->range);\n ConcatCString(message, \"
    \\n
    \");\n SetToEncodedHTMLCString( temp, range->description );\n Concat(message, temp);\n ConcatCString(message, \"
    \\n\");\n if (!CCTK_Equals(range->origin,pData->thorn))\n {\n ConcatCString(message, \"
    [Extended by thorn \");\n ConcatCString(message, range->origin);\n ConcatCString(message, \"]\\n\");\n }\n } \n if(first==0)\n {\n ConcatCString(message, \"
    Times Set:\");\n ConcatDecimal(message, pData->n_set);\n ConcatCString(message, \"
    \\n
    \\n\");\n HTTP_SendString(request, message);\n\n }\n else\n {\n HTTP_Send(request,\"

    Hidden parameter, information is not available

    \\n\");\n }\n\n\n /* Write out the footer part. */\n\n HTTP_SetContentFooterString(cctkGH, 0, message);\n retval = HTTP_SendString(request, message);\n }\n String_Delete( message );\n String_Delete( menu );\n String_Delete( temp );\n return retval;\n}\n", "Expression.h": " /*@@\n @header Expression.h\n @date Tue Sep 19 22:02:45 2000\n @author Tom Goodale\n @desc \n Header for expression stuff. Was http_Expression.h\n @enddesc\n @version $Header$\n @@*/\n\n#ifndef __HTTP_EXPRESSION_H__\n#define __HTTP_EXPRESSION_H__ 1\n\n#ifdef __cplusplus\nextern \"C\" \n{\n#endif\n\nchar *HTTP_ExpressionParse(const char *expression);\n\ndouble HTTP_ExpressionEvaluate(char *buffer, \n double (eval)(const char *, void *),\n void *data);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* __HTTP_EXPRESSION_H__ */\n", "Steer.h": " /*@@\n @header Steer.h\n @date Fri Sep 15 11:31:04 2000\n @author Tom Goodale\n @desc \n Webserver parameter steering routines. Was http_Steer.h; still exported\n by that name\n @enddesc \n @version $Header$\n @@*/\n\n#ifndef __HTTP_STEER_H__\n#define __HTTP_STEER_H__ 1\n\n#ifdef __cplusplus\nextern \"C\" \n{\n#endif\n\nint HTTP_SteerQueue(const char *thorn, const char *parameter,\n const char *value);\n\nint HTTP_SteerDispatch(void);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* __HTTP_STEER_H__ */\n", "images/ImageEncoder.c": "/***********************************************************\nImageEncoder: Standalone program to convert any image into\n a static character array (each byte represented in\n hexadecimal) in a header file. Use this for any\n images that you want to embed in the code so\n that it can run standalone (ie. when you are \n disconnected from the network). Currently used\n to spew out the wwwcactuscodeorg.jpg image used\n in thorn_HTTPD through the WebImage.cc extension\n to the HTTPD.\nCompilation:\n $(CC) -o ImageEncoder ImageEncoder.c\nRunning:\n ImageEncoder \n This will take the input binary file and create a\n header file (something.h) which has the image \n encoded as a static character array with the\n same name as the input image file (minus the extension.\n**************************************************************/\n\n\n#include \n#include \n#include \n\nint main(int argc,char *argv[]){\n char *s;\n char *varname=0;\n int c,counter=0;\n FILE *in,*out;\n if(argc<2) {\n fprintf(stderr,\"Usage: %s \\n\",argv[0]);\n fprintf(stderr,\"\\tor %s output to stdout\\n\",argv[0]);\n exit(0);\n }\n in = fopen(argv[1],\"r\");\n if(argc<3)\n out=stdout;\n else\n out = fopen(argv[2],\"w\");\n s = strrchr(argv[1],'/');\n if(s){\n varname = (char*)malloc(strlen(s)+1);\n strcpy(varname,s); /* strip */\n }\n else{\n varname = (char*)malloc(strlen(argv[1])+1);\n strcpy(varname,argv[1]);\n }\n /* printf(\"VarName=[%s]\\n\",varname); */\n s = strrchr(varname,'.'); \n if(s){ /* strip . */\n *s='\\0';\n }\n \n /* Now actually start writing stuff */\n fprintf(out,\"#ifndef __%s_H_\\n#define __%s_H_\\n\",\n varname,varname);\n fprintf(out,\"\\n\\n\");\n fprintf(out,\"static unsigned char %s[]={\\n\",varname);\n /* inefficient, but it works */\n c=fgetc(in);\n while(c!=EOF){\n int tmp=c;\n c=fgetc(in);\n if(c!=EOF)\n fprintf(out,\"0x%02X,\",tmp);\n else\n fprintf(out,\"0x%02X};\",tmp);\n counter++;\n if(!(counter%12)) \n fprintf(out,\"\\n\\t\");\n }\n fprintf(out,\"\\n\\n#endif /* __%s_H_ */\\n\",varname);\n fclose(in);\n if(argc>2) \n fclose(out);\n if(varname) free(varname);\n}\n", "images/wwwcactuscodeorg.h": "#ifndef __wwwcactuscodeorg_H_\n#define __wwwcactuscodeorg_H_\n\n\nstatic unsigned char wwwcactuscodeorg[]={\n\t0xFF,0xD8,0xFF,0xE0,0x00,0x10,0x4A,0x46,0x49,\n\t0x46,0x00,0x01,0x01,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0xFF,\n\t0xFE,0x00,0x4F,0x43,0x52,0x45,0x41,0x54,0x4F,0x52,0x3A,0x20,\n\t0x58,0x56,0x20,0x56,0x65,0x72,0x73,0x69,0x6F,0x6E,0x20,0x33,\n\t0x2E,0x31,0x30,0x61,0x2B,0x46,0x4C,0x6D,0x61,0x73,0x6B,0x20,\n\t0x20,0x52,0x65,0x76,0x3A,0x20,0x31,0x32,0x2F,0x32,0x39,0x2F,\n\t0x39,0x34,0x20,0x20,0x51,0x75,0x61,0x6C,0x69,0x74,0x79,0x20,\n\t0x3D,0x20,0x37,0x35,0x2C,0x20,0x53,0x6D,0x6F,0x6F,0x74,0x68,\n\t0x69,0x6E,0x67,0x20,0x3D,0x20,0x30,0x0A,0xFF,0xDB,0x00,0x43,\n\t0x00,0x08,0x06,0x06,0x07,0x06,0x05,0x08,0x07,0x07,0x07,0x09,\n\t0x09,0x08,0x0A,0x0C,0x14,0x0D,0x0C,0x0B,0x0B,0x0C,0x19,0x12,\n\t0x13,0x0F,0x14,0x1D,0x1A,0x1F,0x1E,0x1D,0x1A,0x1C,0x1C,0x20,\n\t0x24,0x2E,0x27,0x20,0x22,0x2C,0x23,0x1C,0x1C,0x28,0x37,0x29,\n\t0x2C,0x30,0x31,0x34,0x34,0x34,0x1F,0x27,0x39,0x3D,0x38,0x32,\n\t0x3C,0x2E,0x33,0x34,0x32,0xFF,0xDB,0x00,0x43,0x01,0x09,0x09,\n\t0x09,0x0C,0x0B,0x0C,0x18,0x0D,0x0D,0x18,0x32,0x21,0x1C,0x21,\n\t0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,\n\t0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,\n\t0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,\n\t0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,0x32,\n\t0x32,0x32,0xFF,0xC0,0x00,0x11,0x08,0x00,0x66,0x02,0x21,0x03,\n\t0x01,0x22,0x00,0x02,0x11,0x01,0x03,0x11,0x01,0xFF,0xC4,0x00,\n\t0x1F,0x00,0x00,0x01,0x05,0x01,0x01,0x01,0x01,0x01,0x01,0x00,\n\t0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x03,0x04,0x05,\n\t0x06,0x07,0x08,0x09,0x0A,0x0B,0xFF,0xC4,0x00,0xB5,0x10,0x00,\n\t0x02,0x01,0x03,0x03,0x02,0x04,0x03,0x05,0x05,0x04,0x04,0x00,\n\t0x00,0x01,0x7D,0x01,0x02,0x03,0x00,0x04,0x11,0x05,0x12,0x21,\n\t0x31,0x41,0x06,0x13,0x51,0x61,0x07,0x22,0x71,0x14,0x32,0x81,\n\t0x91,0xA1,0x08,0x23,0x42,0xB1,0xC1,0x15,0x52,0xD1,0xF0,0x24,\n\t0x33,0x62,0x72,0x82,0x09,0x0A,0x16,0x17,0x18,0x19,0x1A,0x25,\n\t0x26,0x27,0x28,0x29,0x2A,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,\n\t0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x53,0x54,0x55,0x56,\n\t0x57,0x58,0x59,0x5A,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,\n\t0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x83,0x84,0x85,0x86,\n\t0x87,0x88,0x89,0x8A,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,\n\t0x9A,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xB2,0xB3,\n\t0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xC2,0xC3,0xC4,0xC5,0xC6,\n\t0xC7,0xC8,0xC9,0xCA,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,\n\t0xDA,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xF1,\n\t0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFF,0xC4,0x00,\n\t0x1F,0x01,0x00,0x03,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,\n\t0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x03,0x04,0x05,\n\t0x06,0x07,0x08,0x09,0x0A,0x0B,0xFF,0xC4,0x00,0xB5,0x11,0x00,\n\t0x02,0x01,0x02,0x04,0x04,0x03,0x04,0x07,0x05,0x04,0x04,0x00,\n\t0x01,0x02,0x77,0x00,0x01,0x02,0x03,0x11,0x04,0x05,0x21,0x31,\n\t0x06,0x12,0x41,0x51,0x07,0x61,0x71,0x13,0x22,0x32,0x81,0x08,\n\t0x14,0x42,0x91,0xA1,0xB1,0xC1,0x09,0x23,0x33,0x52,0xF0,0x15,\n\t0x62,0x72,0xD1,0x0A,0x16,0x24,0x34,0xE1,0x25,0xF1,0x17,0x18,\n\t0x19,0x1A,0x26,0x27,0x28,0x29,0x2A,0x35,0x36,0x37,0x38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0x4E,0x17,0x1C,0xEB,0x4B,0x92,0x6A,0xCC,\n\t0x46,0xCD,0x14,0xD5,0x60,0xD4,0xEA,0xF4,0x40,0x28,0xA2,0x8A,\n\t0x00,0x4A,0x6B,0xC8,0x91,0x8C,0xBB,0x05,0x03,0xD4,0xD6,0x66,\n\t0xB3,0xA8,0xAD,0x8C,0x4A,0x1A,0x51,0x0A,0x36,0x77,0x4A,0x73,\n\t0x85,0x02,0xB3,0x2D,0xA4,0xB2,0xBE,0xB5,0x17,0x71,0xDF,0x1B,\n\t0x88,0xDF,0xEE,0xBA,0x74,0x3F,0x9D,0x79,0xB8,0xAC,0x7A,0xA3,\n\t0x2E,0x58,0xC6,0xFF,0x00,0x90,0xD1,0xD4,0x02,0x0F,0x23,0x91,\n\t0x4B,0x58,0x1E,0x1F,0xD5,0x92,0xEE,0x17,0x41,0xBB,0x62,0x93,\n\t0xB7,0x79,0xE4,0x0C,0x91,0x8F,0xD2,0xB7,0x55,0xC3,0x0E,0x2B,\n\t0xB2,0x8D,0x55,0x56,0x0A,0x62,0x1D,0x45,0x14,0x56,0xC0,0x14,\n\t0x51,0x45,0x00,0x14,0x51,0x49,0x9A,0x00,0x5A,0x28,0xA2,0x80,\n\t0x0A,0x28,0xCD,0x14,0x00,0x51,0x45,0x14,0x00,0x51,0x45,0x14,\n\t0x00,0x51,0x45,0x14,0x00,0x51,0x45,0x14,0x00,0x51,0x45,0x14,\n\t0x00,0x87,0x8A,0xCA,0x97,0xC4,0x16,0x91,0xCA,0xC8,0x04,0x8E,\n\t0x14,0xE3,0x72,0x81,0x8F,0xE7,0x5A,0x8E,0xBB,0xD1,0x94,0x92,\n\t0x32,0x31,0x90,0x70,0x6B,0x8A,0xBA,0x9E,0xFB,0x40,0xD4,0x92,\n\t0x39,0x2E,0x63,0x7B,0x1E,0x32,0x86,0x2E,0x40,0x27,0xEF,0x06,\n\t0xCF,0x6E,0xE3,0x07,0xA7,0x5A,0xE0,0xC6,0xD6,0xAB,0x49,0x27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45,0x00,0x14,0x51,0x45,0x00,\n\t0x14,0x51,0x45,0x00,0x14,0x51,0x45,0x00,0x14,0x51,0x45,0x00,\n\t0x14,0x51,0x45,0x00,0x14,0x51,0x45,0x00,0x14,0x51,0x45,0x00,\n\t0x14,0x51,0x45,0x00,0x14,0x51,0x45,0x00,0x14,0x51,0x45,0x00,\n\t0x14,0x51,0x45,0x00,0x14,0x51,0x45,0x00,0x14,0x51,0x45,0x00,\n\t0x14,0x51,0x45,0x00,0x14,0x51,0x45,0x00,0x14,0x51,0x45,0x00,\n\t0x14,0x51,0x45,0x00,0x14,0x51,0x45,0x00,0x14,0x51,0x45,0x00,\n\t0x14,0x51,0x45,0x00,0x14,0x51,0x45,0x00,0x14,0x51,0x45,0x00,\n\t0x15,0x1B,0xA6,0xE1,0x52,0x51,0x40,0x18,0x37,0x9A,0x4C,0x53,\n\t0x39,0x66,0x89,0x5B,0xEA,0x33,0x55,0xD3,0x4A,0x54,0x18,0x08,\n\t0x00,0x1D,0x80,0xC5,0x74,0xA4,0x03,0x49,0xB1,0x7D,0x29,0x59,\n\t0x01,0x84,0xBA,0x68,0x24,0x65,0x47,0xE5,0x5A,0x56,0xD6,0x8B,\n\t0x1A,0x8C,0x28,0x15,0x70,0x28,0x14,0xB4,0xC0,0x40,0x30,0x29,\n\t0x68,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,\n\t0x28,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,\n\t0x28,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,\n\t0x28,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,\n\t0x28,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,\n\t0x28,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,\n\t0x28,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,\n\t0x28,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,\n\t0x28,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,\n\t0x28,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,\n\t0x28,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,\n\t0x28,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,0x28,0xA2,0x80,0x0A,\n\t0x28,0xA2,0x80,0x3F,0xFF,0xD9};\n\n#endif /* __wwwcactuscodeorg_H_ */\n", "images/www.h": "#ifndef __www_H_\n#define __www_H_\n\n\nstatic unsigned char www[]={\n\t0x47,0x49,0x46,0x38,0x37,0x61,0xA1,0x00,0x20,\n\t0x00,0xF7,0x00,0x00,0x0C,0x22,0x04,0x7C,0x93,0x29,0xAC,0xCA,\n\t0x57,0xBC,0xCA,0xB4,0x96,0xB1,0x47,0xCC,0xE7,0x71,0xDC,0xE7,\n\t0xB2,0x9C,0xAE,0x84,0x44,0x5A,0x0C,0x5F,0x79,0x19,0xB4,0xCB,\n\t0x80,0xE6,0xE8,0xE2,0x8C,0x95,0x6F,0xAC,0xBA,0x5C,0xD4,0xD9,\n\t0xB7,0xE4,0xF1,0x91,0x8A,0xA3,0x3A,0x6C,0x78,0x4A,0xB4,0xB4,\n\t0x98,0xC4,0xDB,0x7E,0xEC,0xF6,0xE0,0x9E,0xBB,0x4A,0xC4,0xD5,\n\t0x6C,0xD4,0xD5,0xD6,0xEC,0xF8,0xB3,0x84,0x93,0x53,0xD2,0xE7,\n\t0x8E,0x5C,0x5E,0x1C,0xB7,0xC1,0x8B,0xA1,0xB0,0x68,0xAC,0xC0,\n\t0x5D,0xE4,0xFB,0x86,0x74,0x87,0x4E,0xB8,0xC1,0x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\t0xD1,0x04,0xF1,0x0D,0x1C,0xF3,0x94,0x60,0xC1,0x03,0x1C,0x64,\n\t0x31,0x0E,0x11,0x52,0x60,0xA2,0x63,0x65,0x41,0x18,0xF3,0xC0,\n\t0x37,0x50,0x58,0x73,0xC2,0x09,0x52,0xE0,0x68,0x99,0x45,0x48,\n\t0x42,0xC8,0x9E,0x74,0x74,0x21,0xF8,0x5E,0x4A,0x12,0x88,0xF1,\n\t0x0E,0x3D,0xFA,0x81,0x13,0x08,0x03,0x5C,0x38,0xF0,0xC7,0x1F,\n\t0x58,0x59,0xC4,0x20,0x83,0xE1,0x45,0x13,0xCE,0x09,0xA3,0xB5,\n\t0x78,0x42,0x8B,0x44,0x04,0xD1,0xA1,0x68,0xD1,0xAC,0x11,0x0E,\n\t0x11,0x98,0xA4,0x40,0x04,0x06,0xB6,0x38,0xF3,0x8F,0x0B,0x91,\n\t0x6C,0xC0,0x03,0x3A,0xD8,0x9C,0x30,0xCE,0x38,0x27,0x60,0xA2,\n\t0x60,0x98,0xA0,0x8D,0xB3,0xCC,0x16,0x41,0x9C,0x40,0x44,0x0A,\n\t0xE1,0xE9,0x38,0x62,0x68,0xAA,0x4C,0x01,0x87,0x3F,0x88,0xCC,\n\t0xF1,0x02,0x0D,0xE0,0x08,0x81,0xE8,0x8D,0x94,0xB1,0xB8,0x8C,\n\t0x08,0x87,0x1C,0x62,0x4A,0x36,0x0B,0x2C,0xE0,0x27,0x9C,0x29,\n\t0x2E,0x18,0xCD,0xAA,0x09,0x8A,0x79,0xA6,0x9B,0xFE,0x2D,0x52,\n\t0xB0,0x2A,0x7B,0xD5,0x51,0x74,0xD0,0x38,0x4D,0x70,0x30,0x0C,\n\t0x0D,0x55,0x54,0xD1,0x41,0x1C,0xE8,0x58,0x63,0x0D,0x2E,0x7F,\n\t0xE8,0xC4,0x56,0x72,0xAA,0x7C,0xF3,0x4D,0x28,0x49,0xD8,0x91,\n\t0x84,0x31,0x9C,0x6C,0x61,0xCB,0x03,0xB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1F,0x14,0x90,0xC3,0x03,0x53,0x58,0x50,0xC4,0x37,\n\t0x39,0x7C,0xA0,0xCC,0x08,0xCA,0xE4,0x20,0x0A,0x12,0xD9,0x80,\n\t0xE1,0x00,0x36,0xC0,0xE0,0x1B,0xC5,0x3D,0x53,0x40,0xC3,0x89,\n\t0x23,0xBF,0xE4,0xA0,0x8C,0x05,0x10,0x14,0xB1,0x83,0x32,0x1F,\n\t0x38,0x92,0x05,0x0A,0x0B,0x2C,0xB1,0x8C,0xC1,0x51,0x7C,0xB0,\n\t0x34,0x27,0x2F,0xC2,0x01,0x85,0xC6,0xDC,0x68,0x3C,0x0D,0x14,\n\t0x0E,0x2C,0xE0,0x86,0xCD,0x3C,0x39,0x94,0x82,0x10,0xB9,0x0C,\n\t0x43,0x4E,0x07,0x3C,0x98,0xEB,0xCD,0x3E,0x42,0x44,0xE3,0x04,\n\t0x11,0x44,0x18,0x64,0xDE,0x1E,0xD9,0xF8,0x10,0x05,0x01,0xA4,\n\t0xD8,0xE1,0x8F,0x06,0x3C,0xD0,0xC0,0x83,0x07,0xA6,0xD0,0xA1,\n\t0x41,0x09,0xA3,0xA8,0x40,0x83,0x0F,0x39,0x74,0x23,0x00,0x14,\n\t0x04,0xDC,0xD2,0xC1,0x31,0x4B,0xB4,0xD0,0xC2,0x21,0xFA,0x20,\n\t0x43,0x0F,0x36,0xBD,0x61,0x53,0x8F,0x05,0x34,0xC8,0xA3,0x81,\n\t0x08,0x01,0x70,0xF3,0x81,0x3C,0xD7,0x90,0xA3,0x89,0x2B,0x80,\n\t0x08,0x00,0x01,0x3A,0x91,0x03,0x0F,0xD4,0xA3,0x1E,0xF7,0x98,\n\t0xC3,0x2F,0x02,0xF7,0xBC,0x00,0xD8,0x63,0x02,0x19,0x68,0x46,\n\t0x32,0x64,0x30,0x86,0x66,0x14,0x40,0x19,0x8D,0x28,0x01,0x10,\n\t0x34,0xE0,0x01,0x4F,0xD8,0x80,0x04,0xF5,0xE8,0xC4,0x3C,0x6E,\n\t0x50,0x80,0x28,0x5C,0x41,0x1B,0xAE,0x38,0x07,0xC3,0xB0,0x61,\n\t0x0F,0x65,0xCC,0x61,0x0E,0x2A,0x00,0x04,0x04,0xEA,0x01,0x85,\n\t0x46,0x50,0x82,0x06,0xBF,0x88,0xC2,0x1C,0x5C,0xF1,0x80,0x39,\n\t0xF4,0xC0,0x1A,0xFE,0x5C,0x70,0x03,0x8E,0x72,0xC7,0x90,0x83,\n\t0xE4,0x4C,0x1D,0x71,0x38,0x87,0x0E,0xAA,0x27,0x09,0x71,0xD0,\n\t0x42,0x0C,0x12,0x48,0x46,0x3C,0xB6,0x51,0x90,0x68,0x6C,0x81,\n\t0x07,0x64,0xF0,0x80,0x07,0xEC,0xC1,0x06,0x0D,0xBC,0x83,0x03,\n\t0x61,0x18,0xC5,0x15,0x3C,0x50,0x0A,0x6D,0xD8,0x43,0x07,0x2A,\n\t0x68,0x85,0x36,0xAE,0x90,0x03,0x35,0xB0,0xA1,0x00,0x74,0xE0,\n\t0x85,0x22,0x84,0x00,0x0C,0x57,0xD8,0x03,0x12,0x3E,0x50,0xC4,\n\t0x1D,0x92,0xC1,0x88,0x02,0x74,0x83,0x0E,0xB3,0x18,0xC5,0x04,\n\t0x90,0x61,0xC6,0x39,0x8C,0x62,0x11,0x25,0x18,0x01,0x20,0xA8,\n\t0xA0,0xB7,0x1C,0x54,0x60,0x1E,0xF5,0xE0,0x04,0x39,0x3A,0x66,\n\t0x83,0x1D,0x00,0xA2,0x01,0xDA,0x20,0x83,0x3C,0x9A,0x81,0x0D,\n\t0x54,0x98,0x60,0x1E,0x7E,0x23,0x87,0x0A,0xFC,0x61,0x8F,0x45,\n\t0x8C,0xC0,0x02,0x61,0x50,0x81,0x36,0x04,0xD0,0x0D,0x45,0xB6,\n\t0xE2,0x05,0x9A,0x88,0x80,0x12,0x56,0x90,0x39,0x46,0x98,0x82,\n\t0x1E,0xDA,0xB0,0xA5,0x05,0x7E,0x41,0x02,0x2D,0x50,0x69,0x02,\n\t0x10,0xC8,0x81,0x36,0x1A,0xF1,0x0A,0x16,0x38,0xC1,0x76,0xC9,\n\t0x23,0x62,0x43,0xAC,0x81,0x8E,0x7C,0x88,0x03,0x08,0x34,0xD0,\n\t0x41,0x0F,0x9C,0x18,0x82,0x5C,0xA0,0xE2,0x0F,0xA8,0x08,0x89,\n\t0x14,0xD6,0x40,0x01,0x18,0x80,0xE3,0x17,0x65,0x20,0x47,0x0E,\n\t0xE8,0x50,0x0C,0x13,0x70,0xC0,0x15,0xA3,0xC8,0x03,0x24,0xEC,\n\t0x11,0x86,0x37,0x20,0xA1,0x18,0x7E,0x60,0x47,0x05,0x08,0xA0,\n\t0x0D,0x52,0xE4,0x41,0x1B,0x1F,0xFE,0xB0,0x41,0x1D,0x5A,0x01,\n\t0x89,0x51,0xB4,0x42,0x00,0x80,0xB0,0x81,0x0D,0xAE,0x50,0x00,\n\t0x4F,0x74,0x43,0x0D,0x51,0x68,0x05,0x10,0xEC,0xE1,0x0A,0x46,\n\t0xD4,0xE1,0x17,0xB9,0xBC,0x41,0x05,0x04,0xC0,0x08,0x57,0x8C,\n\t0x20,0x07,0xD0,0x98,0x43,0x1D,0x5C,0x21,0x08,0x1F,0x40,0x81,\n\t0x0A,0x5D,0x50,0x01,0x1D,0xEA,0xA1,0x8D,0x1C,0xD8,0x00,0x85,\n\t0xAE,0xB8,0x41,0x27,0xD4,0x50,0x07,0x1A,0x74,0x60,0x05,0xAE,\n\t0xA0,0xE8,0x08,0xFC,0xD0,0x50,0x01,0x9C,0x62,0x02,0xEC,0x98,\n\t0x04,0x37,0x4E,0x51,0x06,0x0D,0xD0,0x01,0x02,0x8C,0x50,0x43,\n\t0x02,0x2C,0x4A,0x8E,0x2E,0xA8,0xC1,0x1E,0xEC,0x20,0x40,0x05,\n\t0x12,0x20,0x8A,0x3A,0x8C,0xE1,0x2C,0xA5,0xB1,0x19,0x45,0xCE,\n\t0xC3,0x00,0x18,0x9C,0xC3,0x7B,0x1C,0xD0,0x45,0x0F,0x68,0x11,\n\t0x82,0x5D,0x9C,0x80,0x21,0x95,0xA1,0x40,0x08,0xDE,0x00,0x84,\n\t0x46,0x1C,0xE1,0x14,0x54,0x40,0x02,0x12,0x7A,0xD1,0x0A,0x05,\n\t0x1C,0x81,0x1C,0x68,0x38,0xC7,0x1B,0x7A,0xA1,0x80,0x30,0x6C,\n\t0x62,0x0E,0x90,0x88,0x41,0x37,0x8A,0xA1,0x82,0x54,0x4C,0x80,\n\t0x07,0x68,0xD0,0xA8,0x19,0x6F,0x11,0x05,0x01,0x08,0xC2,0x1D,\n\t0xB7,0xB8,0x42,0x14,0x26,0xA1,0x82,0x39,0xE8,0x60,0x02,0x36,\n\t0xB8,0x05,0x10,0xC2,0xE0,0x8A,0x18,0x68,0x83,0x00,0x36,0xB5,\n\t0x47,0x0E,0x7E,0x11,0x4D,0x68,0xD8,0x03,0xA2,0xC7,0xA0,0x01,\n\t0x35,0x9A,0x31,0x81,0x5B,0x7C,0xC0,0x13,0x47,0x38,0xC7,0x1C,\n\t0xA0,0x40,0x58,0x6D,0xC4,0xE2,0x15,0x40,0x60,0xFE,0x84,0x0D,\n\t0x34,0xA0,0x06,0x02,0xF8,0xA1,0x02,0xA7,0x88,0x82,0x3D,0x36,\n\t0xF1,0x0B,0x35,0xB8,0x22,0x0C,0x68,0x40,0x83,0x1A,0x6E,0xB1,\n\t0x48,0x6D,0x4C,0x20,0x9A,0xF6,0xD8,0xC1,0x0E,0x26,0xC1,0x08,\n\t0x6D,0xC4,0x60,0x05,0x63,0xB8,0x83,0x13,0xB8,0x70,0x82,0x5A,\n\t0x45,0x24,0x05,0x21,0xA0,0x86,0x28,0x8A,0xD1,0x81,0x0E,0xC4,\n\t0xE2,0x19,0xC2,0x48,0x46,0x9B,0x1A,0x52,0x19,0x14,0xE4,0x83,\n\t0x06,0xC7,0xC8,0x03,0x0F,0x10,0xC0,0x87,0x64,0xF0,0x81,0x07,\n\t0x6F,0x00,0x41,0x1E,0xE4,0x11,0x87,0x4F,0x24,0xC3,0x04,0x79,\n\t0x08,0x03,0x28,0x68,0x30,0x07,0x4D,0x20,0x41,0x09,0x61,0x18,\n\t0x84,0x21,0x54,0xA0,0x80,0x34,0xBC,0x41,0x09,0x75,0x50,0x80,\n\t0x0B,0x28,0x31,0x87,0x3C,0xD4,0x21,0x16,0x1D,0xF0,0xC2,0x1B,\n\t0x8E,0x00,0x04,0x05,0xA8,0xA0,0x0B,0x5D,0x10,0x05,0x1D,0x74,\n\t0xC0,0x4F,0x48,0xB8,0xA3,0x0B,0x54,0x10,0x47,0x06,0x78,0xE0,\n\t0x0A,0x1D,0x0C,0x23,0x0D,0xBE,0xD0,0xAE,0x2B,0xA0,0xC0,0x08,\n\t0x77,0x04,0xA2,0x18,0x19,0x70,0x05,0x10,0x8A,0x41,0x89,0x23,\n\t0x0C,0x42,0x1E,0x3A,0x50,0x80,0x0E,0xE4,0x41,0x85,0xFA,0x89,\n\t0x02,0x0D,0x40,0xE0,0x67,0x17,0x28,0x21,0x0A,0x2C,0xD0,0x80,\n\t0x0D,0x8C,0xA0,0x02,0x2F,0x8A,0xF1,0x86,0x68,0x42,0x82,0x1D,\n\t0x36,0x08,0xC5,0x2C,0x34,0x30,0x01,0x05,0x58,0x61,0x0C,0x0B,\n\t0xE0,0x02,0x17,0xA4,0x3A,0x11,0x22,0x38,0x60,0x17,0xCF,0x78,\n\t0x45,0x07,0x54,0xA0,0x84,0x08,0x44,0xC0,0x12,0x69,0x61,0x41,\n\t0xFE,0x43,0x6E,0x77,0x02,0x0A,0x04,0xC3,0x00,0xB8,0xA8,0x41,\n\t0x13,0x64,0x80,0x8A,0x47,0x3C,0x22,0x04,0xA8,0x40,0x05,0x12,\n\t0xDA,0x81,0x8A,0x6D,0x6C,0x03,0x0C,0x5E,0x18,0x40,0x32,0xDA,\n\t0xE0,0x8B,0xDE,0x7C,0x82,0x19,0xBE,0x78,0x04,0x2E,0xF8,0xC0,\n\t0x01,0x15,0xB4,0x81,0x19,0x03,0xA8,0x06,0x18,0x6A,0xC0,0x0C,\n\t0x6C,0x1C,0x80,0x19,0xDB,0xF8,0xC2,0x01,0x16,0xD1,0x8C,0x47,\n\t0x58,0x21,0x19,0x07,0xB0,0x2F,0x12,0x28,0x1D,0x82,0x4F,0x10,\n\t0x83,0x09,0xC4,0xF0,0x42,0x1B,0x42,0x90,0x0C,0x3C,0x0C,0x9A,\n\t0x19,0x1C,0x60,0x46,0x30,0x50,0x80,0x0A,0x16,0xB4,0xE1,0x13,\n\t0x1C,0x40,0x42,0x0B,0xF8,0xD0,0x0B,0x2F,0x98,0x9A,0x19,0xC4,\n\t0x18,0x80,0x2F,0x3E,0xC1,0x8B,0x1A,0x54,0xC3,0x04,0x4A,0x08,\n\t0xC1,0x1D,0x64,0x10,0x82,0x03,0x14,0xA3,0x0D,0xD5,0xF0,0x45,\n\t0x30,0xBE,0xA0,0x04,0xDA,0xB2,0x81,0x10,0x00,0xB8,0x41,0x1D,\n\t0x34,0x91,0x0C,0xDF,0x70,0x81,0x08,0xD6,0x75,0xC8,0x19,0x16,\n\t0xF0,0x84,0x31,0xBC,0xE2,0x0D,0xA2,0xE8,0x02,0x36,0xBC,0xE1,\n\t0x0D,0x30,0x84,0x00,0x17,0x46,0x53,0xC8,0x3A,0xA4,0x50,0x2A,\n\t0x14,0x9C,0xE0,0x0E,0x60,0x78,0x04,0x2C,0x2E,0x70,0x01,0x16,\n\t0x80,0xE1,0x02,0xDB,0x18,0x83,0x34,0x2E,0x20,0x8D,0x80,0xE3,\n\t0x02,0x1F,0x63,0x70,0x00,0x3E,0x50,0x81,0x0F,0x14,0x6C,0x01,\n\t0x05,0xB0,0x80,0x05,0x18,0x0C,0xD0,0x02,0x30,0x80,0xC1,0x1A,\n\t0x2C,0x40,0x41,0x35,0x70,0x91,0x0C,0x07,0x6C,0x83,0xCF,0xE9,\n\t0x68,0x42,0x32,0xFE,0x96,0x8D,0x6F,0x19,0xE0,0xE2,0x11,0xD5,\n\t0xB0,0x73,0x9E,0x3D,0x6D,0x05,0x54,0x4C,0xB0,0xCF,0x28,0x97,\n\t0x34,0x2E,0x60,0x21,0x83,0x4C,0xA0,0x42,0xE3,0xF9,0xBE,0x43,\n\t0x35,0xAA,0x91,0x8C,0x9E,0x6F,0xE3,0xD3,0x7C,0xA8,0x86,0x1E,\n\t0xEF,0xF0,0x88,0x25,0xB0,0x00,0x16,0x28,0xA8,0xF8,0x1D,0xF8,\n\t0x10,0x73,0x13,0x40,0xA2,0xA2,0xA5,0x80,0x47,0x33,0xDC,0x01,\n\t0x8A,0x6A,0x5C,0xC0,0x54,0xB7,0x53,0x66,0x41,0xA4,0x10,0x02,\n\t0x16,0xAC,0xC2,0x0B,0xC3,0xC8,0xC7,0x3B,0x68,0x91,0x88,0x68,\n\t0x48,0x60,0x01,0x78,0x90,0x02,0x53,0xE8,0x52,0x19,0x37,0x70,\n\t0xA1,0x54,0x4E,0xB8,0x40,0x26,0x16,0x90,0x09,0x2E,0x1C,0x93,\n\t0x05,0x2C,0x58,0x00,0x2C,0x32,0x31,0xF7,0xB9,0x1B,0x13,0x1F,\n\t0x5A,0x3E,0x01,0x17,0x60,0x41,0xF7,0xB9,0x97,0xCA,0x1A,0x85,\n\t0x67,0x01,0x3E,0xA4,0x01,0x8B,0xB5,0x65,0xA2,0xDF,0xF8,0xC8,\n\t0x84,0x34,0x8C,0x79,0x81,0xB5,0xC1,0xE2,0x0E,0x97,0x9F,0xFC,\n\t0x1D,0x2A,0x9F,0x09,0x7C,0x60,0xFE,0x98,0xA5,0x32,0x3C,0x3E,\n\t0x00,0x1F,0x71,0x7C,0x5C,0xDE,0xF4,0x04,0x27,0x38,0xDE,0x57,\n\t0xEF,0x86,0xBD,0x83,0xC1,0x09,0x75,0x87,0x85,0xE2,0xA3,0x0B,\n\t0x86,0x16,0xBC,0x42,0x14,0x71,0x00,0x41,0x06,0x44,0xD1,0x86,\n\t0xD1,0x67,0x19,0xDC,0x5A,0x27,0x88,0x14,0xBE,0x2A,0x8B,0x7C,\n\t0x64,0x20,0x1F,0x66,0x10,0x46,0x22,0xCE,0x93,0x20,0xD8,0x6C,\n\t0x3D,0x47,0x6E,0xCF,0xC4,0x74,0xBD,0x92,0x65,0x2D,0x97,0xEA,\n\t0xED,0x75,0x77,0x83,0x1B,0x10,0xFE,0x6F,0x77,0xB7,0x6B,0x19,\n\t0x13,0x82,0xC7,0x84,0x1B,0xAA,0xEF,0x04,0xC1,0xBB,0xE1,0x98,\n\t0xE8,0x77,0xC2,0x74,0xEB,0x2E,0x7D,0xEB,0xD3,0x7D,0x01,0x80,\n\t0x67,0xC1,0x1D,0xD6,0xB6,0x80,0x0B,0xBC,0xBD,0x54,0xC6,0xA4,\n\t0x6E,0x96,0x31,0x81,0x7D,0x4C,0xE4,0x7D,0x01,0xEA,0xA7,0x7E,\n\t0x6B,0xE3,0x04,0xB0,0x80,0x7E,0xB0,0xC0,0x05,0x98,0xB0,0x00,\n\t0x14,0xC0,0x02,0x7C,0xA7,0x7E,0x5C,0xD0,0x79,0xD5,0xE0,0x00,\n\t0xC4,0x40,0x0C,0xC1,0x10,0x0C,0x56,0x00,0x06,0xF8,0x00,0x06,\n\t0x41,0x24,0x28,0xC1,0x67,0x10,0x7F,0xB0,0x00,0x0E,0x30,0x04,\n\t0x6F,0xA0,0x0B,0x83,0xD0,0x03,0x86,0x30,0x08,0x0B,0x20,0x01,\n\t0xB8,0x60,0x04,0x5F,0xD5,0x10,0x6E,0x21,0x28,0x35,0x53,0x24,\n\t0x44,0x20,0x44,0xC8,0x83,0x3C,0x3A,0x22,0x28,0x37,0x98,0x23,\n\t0x70,0x82,0x83,0x3C,0x78,0x83,0x3A,0x32,0x83,0xDA,0x67,0x7E,\n\t0x6E,0x37,0x83,0xE2,0x87,0x09,0x40,0xA8,0x7D,0x48,0x18,0x44,\n\t0x6E,0x20,0x84,0x3E,0xF8,0x83,0x70,0x52,0x1A,0x50,0x58,0x1A,\n\t0x08,0x28,0x44,0x42,0xA4,0x84,0x50,0x58,0x84,0x45,0x42,0x85,\n\t0x49,0x78,0x7F,0x0B,0xB0,0x7A,0xC6,0xF4,0x7B,0x1C,0x78,0x33,\n\t0xED,0xC0,0x02,0x96,0x90,0x08,0x43,0x10,0x08,0x20,0x80,0x03,\n\t0xB5,0x60,0x09,0xAC,0x00,0x06,0x2C,0x98,0x0C,0xF0,0xE1,0x1E,\n\t0x6C,0xD7,0x1E,0x95,0x51,0x87,0x76,0x78,0x87,0x78,0xD8,0x1E,\n\t0x74,0x58,0x19,0x38,0x58,0x24,0x3B,0xD2,0x84,0x35,0xD3,0x84,\n\t0x3E,0xB8,0x83,0x3D,0x98,0x23,0x7D,0x58,0x87,0xF9,0x82,0x38,\n\t0x88,0x46,0x18,0x88,0x78,0xC8,0x87,0x3E,0xE8,0x7E,0x00,0xE8,\n\t0x80,0x41,0xC4,0x65,0xAD,0x81,0x07,0x0B,0x80,0x0B,0x11,0x20,\n\t0x0A,0x5E,0x50,0x0E,0xAB,0xA0,0x0B,0xC4,0xE0,0x6E,0x03,0x60,\n\t0x04,0xB7,0x33,0x11,0xD4,0x41,0x1C,0xF2,0xD1,0x18,0xC5,0x61,\n\t0x1C,0xA7,0x68,0x17,0x9A,0xA1,0x87,0x8C,0x61,0x19,0xB0,0xE8,\n\t0x8A,0x72,0x68,0x1D,0xAA,0xE8,0x16,0xC0,0x31,0x87,0x73,0xD8,\n\t0x8A,0x8B,0xF1,0x8A,0x76,0xA8,0x23,0x4A,0xB8,0x23,0xEE,0x91,\n\t0x11,0x1F,0xF1,0x0C,0x83,0xF0,0x0A,0x58,0xB0,0x0A,0xDE,0x90,\n\t0x0B,0x27,0xB0,0x06,0x02,0xD1,0x82,0x79,0x21,0x1F,0xC6,0x41,\n\t0x8B,0xD0,0xE8,0x82,0xC3,0x11,0x8D,0x04,0x21,0x1C,0x45,0xE4,\n\t0x7C,0xC4,0x21,0x6F,0xA7,0xC8,0x76,0x85,0x78,0x24,0xC1,0x01,\n\t0x1C,0xBB,0x40,0x0B,0x20,0x60,0x06,0xE5,0x20,0x0E,0x86,0x10,\n\t0x02,0x62,0x90,0x0C,0xA8,0xB0,0x0E,0x97,0x90,0x17,0xF0,0x98,\n\t0x15,0xAF,0x98,0x8A,0xF3,0x51,0x0B,0xAB,0x50,0x0E,0xBA,0x30,\n\t0x04,0xFB,0x90,0x0C,0x12,0x70,0x07,0xA8,0x10,0x0D,0xF1,0xD0,\n\t0x81,0xF1,0x38,0x90,0x28,0xB1,0x8B,0x23,0x61,0x1E,0x56,0xC0,\n\t0x00,0x92,0x20,0x0C,0xB4,0xF0,0x03,0xC9,0xE0,0x15,0x02,0xB1,\n\t0x00,0x04,0x39,0x91,0x14,0x09,0x1F,0xE6,0x61,0x0D,0xAB,0x90,\n\t0x08,0x89,0x50,0x2C,0x48,0x02,0x1C,0x15,0xF9,0x91,0x1F,0xC9,\n\t0x13,0xCD,0x07,0x92,0x24,0x19,0x92,0x05,0x61,0x2C,0xD1,0x28,\n\t0x90,0x25,0xB9,0x92,0x26,0x11,0x10,0x00,0x3B};\n\n#endif /*__www_H_ */\n" }, "test": {}, "doc": { "Cookies.txt": " /*@@\n @file Cookies.txt\n @date Mon Sep 18 23:17:20 2000\n @author Tom Goodale\n @desc \n Description of the Cookie interface.\n @enddesc \n @version $Header$\n @@*/\n\nThere is an interface for setting and querying cookies, which is\naccessed by including http_Cookies.h. This provides three functions\n\nint HTTP_CookieSend(httpRequest *request,\n const char *name, \n const char *value, \n const char *path,\n const char *domain,\n const char *expires,\n int secure);\n\nwhich will send a cookie with the appropriate name and value. All\nother fields may be set to NULL, or 0 as appropriate.\n\nint HTTP_CookieCancel(httpRequest *request,\n const char *name, \n const char *path);\n\nwhich cancels a cookie by setting its value to \"\" and setting the\nexpiry date to the past.\n\nThese two functions produce header lines, so should go between the\nHTTP response (e.g. HTTP/1.0 200 OK), and the \"\\r\\n\\r\\n\" seperating\nthe header from the body. \n\nTo get the value of a cookie, call\n\nchar *HTTP_CookieGet(httpRequest *request,\n const char *name);\n\nNote that the returned string must be freed afterwards.\n\nCurrently no encoding is done on the value field; this will be added\nlater. As a result things could go seriously wrong if you include a\n';' or 'name=', where 'name' is a cookie name, in the value field.\n\n \nExample:\n--------\n\n /* Status message */\n strcpy(message,\"HTTP/1.0 200 OK\\r\\n\");\n \n HTTP_Write(request, message, strlen(message));\n\n /* Cookie */\n HTTP_CookieSend(request, \"user\", \"niceuser\", NULL,NULL,NULL,0);\n\n strcpy(message,\"Content-Type: text/html\\r\\n\\r\\n\");\n\n HTTP_Write(request, message, strlen(message));\n\n /* Start of body */\n strcpy(message, \"Cookie Test\\n\");\n\n strcat(message, \"

    Cookie Test

    \");\n\n HTTP_Write(request, message, strlen(message));\n\n strcpy(message, \"
    \");\n HTTP_Write(request, message, strlen(message));\n\n value2 = HTTP_CookieGet(request,\"user\");\n\n sprintf(message, \"

    Cookie is '%s'

    \\n\", value2);\n\n free(value2);\n\n...\n\n", "Auth.txt": " /*@@\n @file Auth.txt\n @date Fri Sep 15 14:05:49 2000\n @author Tom Goodale\n @desc \n Description of http authentication interface interface.\n @enddesc \n @version $Header$\n @@*/\n\nThere is an HTTP authentication interface, which is accessed by\nincluding http_Auth.h.\n\nThis provides two functions:\n\nint HTTP_AuthAddUser(const char *database, \n const char *name,\n const char *password,\n const char *encryption_scheme);\n\nwhich allows databases of users and passwords to be created.\n\nThe encryption scheme says how the password which is being passed in\nis encrypted. Currently supported schemes are 'none' for plaintext,\nor 'crypt' for a password encrypted using crypt(3), such as is produced \nby the unix passwd command, plus many other tools. The use of\ncrypt(3) relies on Cactus determining that the function exists. Other \nencryption systems are easily added.\n\nThis allows the password stored in parameter files or displayed on a\nweb page to be encrypted.\n\nThe other function is\n\nint HTTP_AuthenticateBasic(httpRequest *request,\n const char *database,\n char *user,\n int length);\n\nwhich takes an HTTP request, and a password database, and sees if the\n'Authorization' header field declares a user and password which are in \nthe database. This function supports the 'Basic' authentication\nscheme supplied by HTTP/1.0. It will also, if 'user' is not null,\npass back the name of the user who authenticated if that isn't longer\nthan length.\n\nThis function has three possible return codes.\n\n+1 - the Authorization header was missing.\n0 - header there. User and password match.\n-1 - header there. User and password don't match.\n\nUsage:\n------\n\nCreate a set of users and password in a database, e.g.\n\n HTTP_AuthAddUser(\"developers\",\"goodale\",\"foo\",\"none\");\n\nwhich declares a database called 'developers' and adds a user\n'goodale; with password 'foo' which is plaintext. An equivalent\ndeclaration would have been\n\nHTTP_AuthAddUser(\"developers\",\"goodale\",\"fSzQC4Ssz0ab.\",\"crypt\");\n\nif the configuration supports crypt(3) passwords.\n\nThen when a page comes in, one does\n\n notauthorised = HTTP_AuthenticateBasic(request, \"users\", NULL, 0);\n\n if(!notauthorised)\n {\n /* Access allowed */\n strcpy(message,\"HTTP/1.0 200 Ok\\r\\n\"); \n \n HTTP_Write(request, message, strlen(message)); \n\n strcpy(message,\"WWW-Authenticate: Basic realm=\\\"foo\\\"\\r\\n\"); \n \n HTTP_Write(request, message, strlen(message)); \n\n strcpy(message,\"Content-Type: text/html\\r\\n\\r\\n\");\n\n HTTP_Write(request, message, strlen(message));\n\n ...\n }\n else\n {\n /* Access not allowed. */\n strcpy(message,\"HTTP/1.0 401 Unauthorized\\r\\n\"); \n \n HTTP_Write(request, message, strlen(message)); \n\n strcpy(message,\"WWW-Authenticate: Basic realm=\\\"foo\\\"\\r\\n\"); \n \n HTTP_Write(request, message, strlen(message)); \n\n strcpy(message,\"Content-Type: text/html\\r\\n\\r\\n\");\n\n HTTP_Write(request, message, strlen(message));\n \n ...\n }\n\n Additionally you could check whether 'notauthorised' = +1 or -1 and\nin the latter case log some message about a failed access request.\n", "Steering.txt": " /*@@\n @file Steering.txt\n @date Fri Sep 15 14:05:49 2000\n @author Tom Goodale\n @desc \n Description of parameter steering interface.\n @enddesc \n @version $Header$\n @@*/\n\nThere is a parameter steering interface, which is accessed by\nincluding http_Steer.h.\n\nThis defines two functions:\n\n\nint HTTP_SteerQueue(const char *thorn, \n const char *parameter, \n const char *value);\n\nwhich schedules a parameter to be steered, and\n\nint HTTP_SteerDispatch(void);\n\nwhich broadcasts the data to other processors and then\nsteers all the parameters which were queued.\n\nThis is to allow steering requests to be queued up over several\niterations, and then broadcast at once, which should reduce the\nnumber of barriers called by the code.\n", "Content.txt": " /*@@\n @file Content.txt\n @date 08.04.2004\n @author Steve White\n @desc \n Description of the Content interface\n @enddesc \n @version $Header$\n @@*/\n\nThere is an interface for setting HTML page content information, which is\naccessed by including http_Content.h. \n\n\nThis provides functions\n\nint HTTP_SendString(httpRequest *request, const String* message);\n\nwhich sends the string message to HTTP,\n\nvoid HTTP_SetHeadInfo( String *header);\n\nwhich copies a string containing typical content of the HEAD element of\nthe standard Cactus HTTPD web pages. Particularly, it includes style\ninformation, but not the title of the page.\n\nvoid HTTP_SetDoctype( String *header);\n\nwhich copies a standard DOCTYPE tag into the string. Typical use will\nbe to emit this string immediately before the first HTML tag of the\nweb page being generated.\n\nint HTTP_SetContentHeaderString(const cGH *cctkGH, int choice, String *mess,\n const String *menu);\n\nThis copies standard Cactus body HTML information into the string mess.\nIf choice is nonzero, the information is appropriate for a main page;\nif it is 0, the information is appropriate for non-main pages.\nIf the menu argument is non-null, that string will be appended as\nHTML to the standard menus. \n\nint HTTP_SetContentFooterString(const cGH *cctkGH, int choice, String *mess );\n\nThis copies standard Cactus footer HTML into the string mess; if choice is\nnonzero, the information is appropriate for the main page.\n\nint HTTP_ContentSendFromFile(httpRequest *request, int filedes);\n\nwhich emits the entirety of the file referred to by file descriptor filedes\nto HTTP,\n\nint HTTP_ContentLink(const char *URL,\n const char *name,\n const char *description,\n int flags);\n\nwhich...I don't know what this does.\n\nThe functions\n\nint HTTP_ContentHeader(const cGH *cctkGH, int choice, int len, char *mess,\n const char *menu);\nint HTTP_ContentFooter(const cGH *cctkGH, int choice, int len, char *mess);\n\nare a little dangerous. They are like the corresponding ContentHeader and\nFooter calls above, with the len attribute indicating the length of the \ncharacter buffer mess.\n\n------------------------------------\nOther included functions\n\nint HTTP_SendString(httpRequest *request, const String* message);\n\n\nExample:\n--------\n\nA web page is typically generated in the following sequence. \nThe HTTP connection has already been established and saved in the httpRequest\npointer, and a String instance 'message' has been created.\n\n\t0) HTTP_SendOKHeader( httpRequest )\n\t1a) HTTP_SetDoctype( message );\n\t1b) HTTP_SendString( httpRequest, message );\n\t2) HTTP_Send( httpRequest, \"\\n\" );\n\t3) HTTP_Send( httpRequest, \"My Title\\n\" );\n\t4a) HTTP_HeadInfo( message );\n\t4b) HTTP_SendString( httpRequest, message );\n\t5) HTTP_Send( httpRequest, \"\\n\" );\n\t6) HTTP_HeadInfo( httpRequest );\n\t7a) HTTP_SetContentHeaderString(cctkGH, choice, message, menu);\n\t7b) HTTP_SendString( httpRequest, message );\n\t8)\tPage content\n\t9a) HTTP_SetContentFooterString(cctkGH, choice, message);\n\t9b) HTTP_SendString( httpRequest, message );\n\t10) HTTP_Send( httpRequest, \"\\n\" );\n\n", "documentation.tex": "% *======================================================================*\n% Cactus Thorn template for ThornGuide documentation\n% Author: Ian Kelley\n% Date: Sun Jun 02, 2002\n% $Header$ \n%\n% Thorn documentation in the latex file doc/documentation.tex \n% will be included in ThornGuides built with the Cactus make system.\n% The scripts employed by the make system automatically include \n% pages about variables, parameters and scheduling parsed from the \n% relevent thorn CCL files.\n% \n% This template contains guidelines which help to assure that your \n% documentation will be correctly added to ThornGuides. More \n% information is available in the Cactus UsersGuide.\n% \n% Guidelines:\n% - Do not change anything before the line\n% % BEGIN CACTUS THORNGUIDE\",\n% except for filling in the title, author, date etc. fields.\n% - You can define your own macros are OK, but they must appear after\n% the BEGIN CACTUS THORNGUIDE line, and do not redefine standard \n% latex commands.\n% - To avoid name clashes with other thorns, 'labels', 'citations', \n% 'references', and 'image' names should conform to the following \n% convention: \n% ARRANGEMENT_THORN_LABEL\n% For example, an image wave.eps in the arrangement CactusWave and \n% thorn WaveToyC should be renamed to CactusWave_WaveToyC_wave.eps\n% - Graphics should only be included using the graphix package. \n% More specifically, with the \"includegraphics\" command. Do\n% not specify any graphic file extensions in your .tex file. This \n% will allow us (later) to create a PDF version of the ThornGuide\n% via pdflatex. |\n% - References should be included with the latex \"bibitem\" command. \n% - For the benefit of our Perl scripts, and for future extensions, \n% please use simple latex. \n%\n% *======================================================================* \n% \n% Example of including a graphic image:\n% \\begin{figure}[ht]\n% \t\\begin{center}\n% \t \\includegraphics[width=6cm]{MyArrangement_MyThorn_MyFigure}\n% \t\\end{center}\n% \t\\caption{Illustration of this and that}\n% \t\\label{MyArrangement_MyThorn_MyLabel}\n% \\end{figure}\n%\n% Example of using a label:\n% \\label{MyArrangement_MyThorn_MyLabel}\n%\n% Example of a citation:\n% \\cite{MyArrangement_MyThorn_Author99}\n%\n% Example of including a reference\n% \\bibitem{MyArrangement_MyThorn_Author99}\n% {J. Author, {\\em The Title of the Book, Journal, or periodical}, 1 (1999), \n% 1--16. {\\tt http://www.nowhere.com/}}\n%\n% *======================================================================* \n\n% If you are using CVS use this line to give version information\n% $Header$\n\n\\documentclass{article}\n\n% Use the Cactus ThornGuide style file\n% (Automatically used from Cactus distribution, if you have a \n% thorn without the Cactus Flesh download this from the Cactus\n% homepage at www.cactuscode.org)\n\\usepackage{../../../../doc/latex/cactus}\n\n\\begin{document}\n\n% The author of the documentation\n\\author{} \n\n% The title of the document (not necessarily the name of the Thorn)\n\\title{HTTPD}\n\n% the date your document was last changed, if your document is in CVS, \n% please us:\n% \\date{$ $Date$ $}\n\\date{}\n\n\\maketitle\n\n% Do not delete next line\n% START CACTUS THORNGUIDE\n\n% Add all definitions used in this documentation here \n% \\def\\mydef etc\n\n% Add an abstract for this thorn's documentation\n\\begin{abstract}\n\n\\end{abstract}\n\n% The following sections are suggestive only.\n% Remove them or add your own.\n\n\\section{Introduction}\n\n\\section{Physical System}\n\n\\section{Numerical Implementation}\n\n\\section{Using This Thorn}\n\n\\subsection{Obtaining This Thorn}\n\n\\subsection{Basic Usage}\n\n\\subsection{Special Behaviour}\n\n\\subsection{Interaction With Other Thorns}\n\n\\subsection{Support and Feedback}\n\n\\section{History}\n\n\\subsection{Thorn Source Code}\n\n\\subsection{Thorn Documentation}\n\n\\subsection{Acknowledgements}\n\n\n\\begin{thebibliography}{9}\n\n\\end{thebibliography}\n\n% Do not delete next line\n% END CACTUS THORNGUIDE\n\n\\end{document}\n" } }