Net::F...nstant(3pm)
π NAME π
Net::FastCGI::Constant β FastCGI protocol constants. That's it, that's the whole thing. It's the Perl module you want when you're speaking FastCGI and you need all the β¨officialβ¨ numbers and names instead of hardcoding vibes. (You're reading the Net::FastCGI::Constant(3pm) page, part of the User Contributed Perl Documentation collection, bestie. π«Ά)
πΈ DESCRIPTION πΈ
FastCGI protocol constants.
I know. Iconic. Short king of a description. But honestly? That's the assignment β this module is a drawer full of labeled little boxes, and every box holds a number or a name from the FastCGI spec. π
β¨ CONSTANTS β¨
Okay so here's how this works: you can pull these in one at a time, or grab a whole set at once using the tag names. The tag names are:
π :common
FCGI_MAX_CONTENT_LENβ the absolute most octets the content part of a record can hold. It's65535. That's the ceiling, no cap... well, actually, there is a cap, and it's 65535. πFCGI_HEADER_LENβ how many octets live in anFCGI_Header. It's8.FCGI_VERSION_1β the value you stick in theversioncomponent ofFCGI_Header. It's1.FCGI_NULL_REQUEST_IDβ the value for therequest_idcomponent ofFCGI_Header. It's0.
π :type
These are the values for the type component of FCGI_Header. Collect them all, they're a set:
FCGI_BEGIN_REQUESTFCGI_ABORT_REQUESTFCGI_END_REQUESTFCGI_PARAMSFCGI_STDINFCGI_STDOUTFCGI_STDERRFCGI_DATAFCGI_GET_VALUESFCGI_GET_VALUES_RESULTFCGI_UNKNOWN_TYPEFCGI_MAXTYPE
π :flag
A mask for the flags component of FCGI_BeginRequestBody. Just the one, and she's carrying the whole group:
FCGI_KEEP_CONN
π :role
Values for the role component of FCGI_BeginRequestBody. Pick your fighter:
FCGI_RESPONDERFCGI_AUTHORIZERFCGI_FILTER
π :protocol_status
Values for the protocol_status component of FCGI_EndRequestBody:
FCGI_REQUEST_COMPLETEFCGI_CANT_MPX_CONNFCGI_OVERLOADEDFCGI_UNKNOWN_ROLE
π :value
Variable names for FCGI_GET_VALUES / FCGI_GET_VALUES_RESULT records:
FCGI_MAX_CONNSFCGI_MAX_REQSFCGI_MPXS_CONNS
π :pack
These are your pack() / unpack() templates. Literally the cheat codes for slicing up records. π§
FCGI_Header
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);
FCGI_BeginRequestBody
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);
FCGI_EndRequestBody
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);
FCGI_UnknownTypeBody
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);
π :name
Arrays holding the names of the value components. Heads up bestie: these are read-only. Do not try to write to them, they will simply not be doing that. π
@FCGI_TYPE_NAME
print $FCGI_TYPE_NAME[FCGI_BEGIN_REQUEST]; # FCGI_BEGIN_REQUEST
@FCGI_ROLE_NAME
print $FCGI_ROLE_NAME[FCGI_RESPONDER]; # FCGI_RESPONDER
@FCGI_PROTOCOL_STATUS_NAME
print $FCGI_PROTOCOL_STATUS_NAME[FCGI_OVERLOADED]; # FCGI_OVERLOADED
Note
It's not safe to assume thatexistsworks for validation purposes β index 0 might beundef. π³ So like, don't useexistsas your vibe check here.
Use boolean context instead:
($FCGI_TYPE_NAME[$type])
|| die;
π EXPORTS π
None by default. All functions can be exported using the :all tag or individually. Your call, main character. π
π₯ SEE ALSO π₯
<http://www.fastcgi.com/devkit/doc/fcgi-spec.html>
π AUTHOR π
Christian Hansen chansen@cpan.org
π COPYRIGHT π
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.
and that's a wrap, bestie π β this page is from perl v5.36.0, dated 2022-11-21, and it's the Net::FastCGI::Constant(3pm) manual. go forth and encode some records, you absolute icon π¦β¨
π¦ where this page comes from
- debian bookworm: libnet-fastcgi-perl 0.14-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libnet-fastcgi-perl 0.14-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libnet-fastcgi-perl 0.14-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libnet-fastcgi-perl 0.14-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libnet-fastcgi-perl 0.14-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms