| Net::FastCGI::Constant(3pm) | User Contributed Perl Documentation | Net::FastCGI::Constant(3pm) |
Net::FastCGI::Constant - FastCGI protocol constants.
FastCGI protocol constants.
Constants can either be imported individually or in sets grouped by tag names. The tag names are:
Values for "type" component of "FCGI_Header".
Mask for "flags" component of "FCGI_BeginRequestBody".
Values for "role" component of "FCGI_BeginRequestBody".
Values for "protocol_status" component of "FCGI_EndRequestBody".
Variable names for "FCGI_GET_VALUES" / "FCGI_GET_VALUES_RESULT" records.
"pack()" / "unpack()" templates
Octet/ 0 | 1 |
/ | |
| 0 1 2 3 4 5 6 7 | 0 1 2 3 4 5 6 7 |
+-----------------+-----------------+
0 | Version | Type |
+-----------------+-----------------+
2 | Request ID |
+-----------------+-----------------+
4 | Content Length |
+-----------------+-----------------+
6 | Padding Length | Reserved |
+-----------------+-----------------+
Total 8 octets
Template: CCnnCx
my ($version, $type, $request_id, $content_length, $padding_length)
= unpack(FCGI_Header, $octets);
Octet/ 0 | 1 |
/ | |
| 0 1 2 3 4 5 6 7 | 0 1 2 3 4 5 6 7 |
+-----------------+-----------------+
0 | Role |
+-----------------+-----------------+
2 | Flags | |
+-----------------+ +
4 | |
+ Reserved +
6 | |
+-----------------+-----------------+
Total 8 octets
Template: nCx5
my ($role, $flags) = unpack(FCGI_BeginRequestBody, $octets);
Octet/ 0 | 1 |
/ | |
| 0 1 2 3 4 5 6 7 | 0 1 2 3 4 5 6 7 |
+-----------------+-----------------+
0 | |
+ Application Status +
2 | |
+-----------------+-----------------+
4 | Protocol Status | |
+-----------------+ Reserved +
6 | |
+-----------------+-----------------+
Total 8 octets
Template: NCx3
my ($app_status, $protocol_status)
= unpack(FCGI_EndRequestBody, $octets);
Octet/ 0 | 1 |
/ | |
| 0 1 2 3 4 5 6 7 | 0 1 2 3 4 5 6 7 |
+-----------------+-----------------+
0 | Unknown Type | |
+-----------------+ +
2 | |
+ +
4 | Reserved |
+ +
6 | |
+-----------------+-----------------+
Total 8 octets
Template: Cx7
my $unknown_type = unpack(FCGI_UnknownTypeBody, $octets);
Arrays containing names of value components. These are read-only.
print $FCGI_TYPE_NAME[FCGI_BEGIN_REQUEST]; # FCGI_BEGIN_REQUEST
print $FCGI_ROLE_NAME[FCGI_RESPONDER]; # FCGI_RESPONDER
print $FCGI_PROTOCOL_STATUS_NAME[FCGI_OVERLOADED]; # FCGI_OVERLOADED
Note
It's not safe to assume that "exists" works for validation purposes, index 0 might be "undef".
Use boolean context instead:
($FCGI_TYPE_NAME[$type])
|| die;
None by default. All functions can be exported using the ":all" tag or individually.
Christian Hansen "chansen@cpan.org"
Copyright 2008-2010 by Christian Hansen.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| 2022-11-21 | perl v5.36.0 |