"Fossies" - the Fresh Open Source Software Archive

Member "mod_fastcgi-2.4.7-0910052141/fcgi_protocol.h" (10 Apr 2012, 2827 Bytes) of package /linux/www/apache_httpd_modules/old/mod_fastcgi-2.4.7-0910052141.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /* 
    2  * $Id: fcgi_protocol.h,v 1.1 1999/02/09 03:08:02 roberts Exp $
    3  */
    4 
    5 #ifndef FCGI_PROTOCOL_H
    6 #define FCGI_PROTOCOL_H
    7 
    8 /*
    9  * Listening socket file number
   10  */
   11 #define FCGI_LISTENSOCK_FILENO 0
   12 
   13 typedef struct {
   14     unsigned char version;
   15     unsigned char type;
   16     unsigned char requestIdB1;
   17     unsigned char requestIdB0;
   18     unsigned char contentLengthB1;
   19     unsigned char contentLengthB0;
   20     unsigned char paddingLength;
   21     unsigned char reserved;
   22 } FCGI_Header;
   23 
   24 #define FCGI_MAX_LENGTH 0xffff
   25 
   26 /*
   27  * Number of bytes in a FCGI_Header.  Future versions of the protocol
   28  * will not reduce this number.
   29  */
   30 #define FCGI_HEADER_LEN  8
   31 
   32 /*
   33  * Value for version component of FCGI_Header
   34  */
   35 #define FCGI_VERSION_1           1
   36 
   37 /*
   38  * Current version of the FastCGI protocol
   39  */
   40 #define FCGI_VERSION FCGI_VERSION_1
   41 
   42 /*
   43  * Values for type component of FCGI_Header
   44  */
   45 #define FCGI_BEGIN_REQUEST       1
   46 #define FCGI_ABORT_REQUEST       2
   47 #define FCGI_END_REQUEST         3
   48 #define FCGI_PARAMS              4
   49 #define FCGI_STDIN               5
   50 #define FCGI_STDOUT              6
   51 #define FCGI_STDERR              7
   52 #define FCGI_DATA                8
   53 #define FCGI_GET_VALUES          9
   54 #define FCGI_GET_VALUES_RESULT  10
   55 #define FCGI_UNKNOWN_TYPE       11
   56 #define FCGI_MAXTYPE (FCGI_UNKNOWN_TYPE)
   57 
   58 /*
   59  * Value for requestId component of FCGI_Header
   60  */
   61 #define FCGI_NULL_REQUEST_ID     0
   62 
   63 
   64 typedef struct {
   65     unsigned char roleB1;
   66     unsigned char roleB0;
   67     unsigned char flags;
   68     unsigned char reserved[5];
   69 } FCGI_BeginRequestBody;
   70 
   71 typedef struct {
   72     FCGI_Header header;
   73     FCGI_BeginRequestBody body;
   74 } FCGI_BeginRequestRecord;
   75 
   76 /*
   77  * Mask for flags component of FCGI_BeginRequestBody
   78  */
   79 #define FCGI_KEEP_CONN  1
   80 
   81 /*
   82  * Values for role component of FCGI_BeginRequestBody
   83  */
   84 #define FCGI_RESPONDER  1
   85 #define FCGI_AUTHORIZER 2
   86 #define FCGI_FILTER     3
   87 
   88 
   89 typedef struct {
   90     unsigned char appStatusB3;
   91     unsigned char appStatusB2;
   92     unsigned char appStatusB1;
   93     unsigned char appStatusB0;
   94     unsigned char protocolStatus;
   95     unsigned char reserved[3];
   96 } FCGI_EndRequestBody;
   97 
   98 typedef struct {
   99     FCGI_Header header;
  100     FCGI_EndRequestBody body;
  101 } FCGI_EndRequestRecord;
  102 
  103 /*
  104  * Values for protocolStatus component of FCGI_EndRequestBody
  105  */
  106 #define FCGI_REQUEST_COMPLETE 0
  107 #define FCGI_CANT_MPX_CONN    1
  108 #define FCGI_OVERLOADED       2
  109 #define FCGI_UNKNOWN_ROLE     3
  110 
  111 
  112 /*
  113  * Variable names for FCGI_GET_VALUES / FCGI_GET_VALUES_RESULT records
  114  */
  115 #define FCGI_MAX_CONNS  "FCGI_MAX_CONNS"
  116 #define FCGI_MAX_REQS   "FCGI_MAX_REQS"
  117 #define FCGI_MPXS_CONNS "FCGI_MPXS_CONNS"
  118 
  119 
  120 typedef struct {
  121     unsigned char type;    
  122     unsigned char reserved[7];
  123 } FCGI_UnknownTypeBody;
  124 
  125 typedef struct {
  126     FCGI_Header header;
  127     FCGI_UnknownTypeBody body;
  128 } FCGI_UnknownTypeRecord;
  129 
  130 #endif  /* FCGI_PROTOCOL_H */
  131