adamc@859: // This code comes from the FastCGI 1.0 spec at: adamc@859: // http://www.fastcgi.com/drupal/node/6?q=node/22 adamc@859: adamc@859: /* adamc@859: * Listening socket file number adamc@859: */ adamc@859: #define FCGI_LISTENSOCK_FILENO 0 adamc@859: adamc@859: typedef struct { adamc@859: unsigned char version; adamc@859: unsigned char type; adamc@859: unsigned char requestIdB1; adamc@859: unsigned char requestIdB0; adamc@859: unsigned char contentLengthB1; adamc@859: unsigned char contentLengthB0; adamc@859: unsigned char paddingLength; adamc@859: unsigned char reserved; adamc@859: } FCGI_Header; adamc@859: adamc@859: /* adamc@859: * Number of bytes in a FCGI_Header. Future versions of the protocol adamc@859: * will not reduce this number. adamc@859: */ adamc@859: #define FCGI_HEADER_LEN 8 adamc@859: adamc@859: /* adamc@859: * Value for version component of FCGI_Header adamc@859: */ adamc@859: #define FCGI_VERSION_1 1 adamc@859: adamc@859: /* adamc@859: * Values for type component of FCGI_Header adamc@859: */ adamc@859: #define FCGI_BEGIN_REQUEST 1 adamc@859: #define FCGI_ABORT_REQUEST 2 adamc@859: #define FCGI_END_REQUEST 3 adamc@859: #define FCGI_PARAMS 4 adamc@859: #define FCGI_STDIN 5 adamc@859: #define FCGI_STDOUT 6 adamc@859: #define FCGI_STDERR 7 adamc@859: #define FCGI_DATA 8 adamc@859: #define FCGI_GET_VALUES 9 adamc@859: #define FCGI_GET_VALUES_RESULT 10 adamc@859: #define FCGI_UNKNOWN_TYPE 11 adamc@859: #define FCGI_MAXTYPE (FCGI_UNKNOWN_TYPE) adamc@859: adamc@859: /* adamc@859: * Value for requestId component of FCGI_Header adamc@859: */ adamc@859: #define FCGI_NULL_REQUEST_ID 0 adamc@859: adamc@859: typedef struct { adamc@859: unsigned char roleB1; adamc@859: unsigned char roleB0; adamc@859: unsigned char flags; adamc@859: unsigned char reserved[5]; adamc@859: } FCGI_BeginRequestBody; adamc@859: adamc@859: typedef struct { adamc@859: FCGI_Header header; adamc@859: FCGI_BeginRequestBody body; adamc@859: } FCGI_BeginRequestRecord; adamc@859: adamc@859: /* adamc@859: * Mask for flags component of FCGI_BeginRequestBody adamc@859: */ adamc@859: #define FCGI_KEEP_CONN 1 adamc@859: adamc@859: /* adamc@859: * Values for role component of FCGI_BeginRequestBody adamc@859: */ adamc@859: #define FCGI_RESPONDER 1 adamc@859: #define FCGI_AUTHORIZER 2 adamc@859: #define FCGI_FILTER 3 adamc@859: adamc@859: typedef struct { adamc@859: unsigned char appStatusB3; adamc@859: unsigned char appStatusB2; adamc@859: unsigned char appStatusB1; adamc@859: unsigned char appStatusB0; adamc@859: unsigned char protocolStatus; adamc@859: unsigned char reserved[3]; adamc@859: } FCGI_EndRequestBody; adamc@859: adamc@859: typedef struct { adamc@859: FCGI_Header header; adamc@859: FCGI_EndRequestBody body; adamc@859: } FCGI_EndRequestRecord; adamc@859: adamc@859: /* adamc@859: * Values for protocolStatus component of FCGI_EndRequestBody adamc@859: */ adamc@859: #define FCGI_REQUEST_COMPLETE 0 adamc@859: #define FCGI_CANT_MPX_CONN 1 adamc@859: #define FCGI_OVERLOADED 2 adamc@859: #define FCGI_UNKNOWN_ROLE 3 adamc@859: adamc@859: /* adamc@859: * Variable names for FCGI_GET_VALUES / FCGI_GET_VALUES_RESULT records adamc@859: */ adamc@859: #define FCGI_MAX_CONNS "FCGI_MAX_CONNS" adamc@859: #define FCGI_MAX_REQS "FCGI_MAX_REQS" adamc@859: #define FCGI_MPXS_CONNS "FCGI_MPXS_CONNS" adamc@859: adamc@859: typedef struct { adamc@859: unsigned char type; adamc@859: unsigned char reserved[7]; adamc@859: } FCGI_UnknownTypeBody; adamc@859: adamc@859: typedef struct { adamc@859: FCGI_Header header; adamc@859: FCGI_UnknownTypeBody body; adamc@859: } FCGI_UnknownTypeRecord;