Merge pull request #50 from RowanHeinrich/patch-6
[matches/MCTX3420.git] / server / fastcgi.h
index c1e0b3e..74468ae 100644 (file)
@@ -17,7 +17,8 @@ typedef enum StatusCodes {
        STATUS_OK = 1,
        STATUS_ERROR = -1,
        STATUS_UNAUTHORIZED = -2,
-       STATUS_OUTOFRANGE = -3
+       STATUS_NOTRUNNING = -3,
+       STATUS_ALREADYEXISTS = -4
 } StatusCodes;
 
 #define FCGI_PARAM_REQUIRED (1 << 0)
@@ -38,7 +39,19 @@ typedef struct FCGIValue {
        unsigned flags;
 } FCGIValue;
 
-typedef struct FCGIContext FCGIContext;
+/**Contextual information related to FCGI requests*/
+typedef struct  
+{
+       /**The time of last valid user access possessing the control key*/
+       time_t control_timestamp;
+       char control_key[41];
+       char control_ip[16];
+       /**The name of the current module**/
+       const char *current_module;
+       /**For debugging purposes?**/
+       int response_number;
+} FCGIContext;
+
 typedef void (*ModuleHandler) (FCGIContext *context, char *params);
 
 extern void FCGI_LockControl(FCGIContext *context, bool force);
@@ -58,6 +71,8 @@ extern void FCGI_RejectJSONEx(FCGIContext *context, StatusCodes status, const ch
 extern char *FCGI_EscapeText(char *buf);
 extern void *FCGI_RequestLoop (void *data);
 
+extern void FCGI_WriteBinary(void * data, size_t size, size_t num_elem);
+
 /**
  * Shortcut to calling FCGI_RejectJSONEx. Sets the error code
  * to STATUS_ERROR.

UCC git Repository :: git.ucc.asn.au