Net::FastCGI::Protocol - Provides functions to build and parse FastCGI messages.
# FCGI_Header $octets = build_header($type, $request_id, $content_length, $padding_length); @values = parse_header($octets); # FCGI_BeginRequestBody $octets = build_begin_request_body($role, $flags); @values = parse_begin_request_body($octets); # FCGI_EndRequestBody $octets = build_end_request_body($application_status, $protocol_status); @values = parse_end_request_body($octets); # FCGI_UnknownTypeBody $octets = build_unknown_type_body($type); @values = parse_unknown_type_body($octets); # FCGI_BeginRequestRecord $octets = build_begin_request_record($request_id, $role, $flags); # FCGI_EndRequestRecord $octets = build_end_request_record($request_id, $application_status, $protocol_status); # FCGI_UnknownTypeRecord $octets = build_unknown_type_record($type); # FCGI_Record $octets = build_record($type, $request_id); $octets = build_record($type, $request_id, $content); # FCGI_NameValuePair's $octets = build_params($params); $params = parse_params($octets); # FCGI Byte Streams $octets = build_stream($type, $request_id, $octets); $octets = build_stream($type, $request_id, $octets, $terminate);
Provides functions to build and parse FastCGI messages.
Builds a FCGI_BeginRequestBody.
FCGI_BeginRequestBody
Usage
$octets = build_begin_request_body($role, $flags);
Arguments
$role
An unsigned 16-bit integer.
$flags
An unsigned 8-bit integer.
Returns
$octets
A string of octets containing the body. String is 8 octets in length.
Builds a FCGI_BeginRequestRecord.
FCGI_BeginRequestRecord
$octets = build_begin_request_record($request_id, $role, $flags);
$request_id
A string of octets containing the record. String is 16 octets in length.
Builds a FCGI_EndRequestBody.
FCGI_EndRequestBody
$octets = build_end_request_body($application_status, $protocol_status);
$application_status
An unsigned 32-bit integer.
$protocol_status
Builds a FCGI_EndRequestRecord.
FCGI_EndRequestRecord
$octets = build_end_request_record($request_id, $application_status, $protocol_status);
Builds a FCGI_Header.
FCGI_Header
$octets = build_header($type, $request_id, $content_length, $padding_length);
$type
$content_length
$padding_length
A string of octets containing the header. String is 8 octets in length.
Builds FCGI_NameValuePair's.
FCGI_NameValuePair
$octets = build_params($params);
$params
A hash reference containing name/value pairs.
Builds a FCGI_Record.
FCGI_Record
$octets = build_record($type, $request_id); $octets = build_record($type, $request_id, $content);
$content
A string of octets containing the content, must be less than or equal to 65535 octets in length.
A string of octets containing the record.
Builds a series of byte streams records.
$octets = build_stream($type, $request_id, $content); $octets = build_stream($type, $request_id, $content, $terminate);
A string of octets containing the stream content.
$terminate
A boolean indicating whether or not the stream should be terminated.
A string of octets containing the stream.
Builds a FCGI_UnknownTypeBody.
FCGI_UnknownTypeBody
$octets = build_unknown_type_body($type);
Builds a FCGI_UnknownTypRecord.
FCGI_UnknownTypRecord
$octets = build_unknown_type_record($type);
Parses a FCGI_BeginRequestBody.
($role, $flags) = parse_begin_request_body($octets);
A string of octets containing the body, must be greater than or equal to 8 octets in length.
Parses a FCGI_EndRequestBody.
($application_status, $protocol_status) = parse_end_request_body($octets);
Parses a FCGI_Header.
($type, $request_id, $content_length, $padding_length) = parse_header($octets);
A string of octets containing the header, must be greater than or equal to 8 octets in length.
Parses FCGI_NameValuePair's.
$params = parse_params($octets);
A string of octets containing FCGI_NameValuePair's.
Parses a FCGI_UnknownTypeBody.
$type = parse_unknown_type_body($octets);
$octets must be greater than or equal to 8 octets in length.
$name = get_type_name($type);
$name
A string containing the name of the type.
$name = get_role_name($type);
A string containing the name of the role.
$name = get_protocol_status_name($protocol_status);
A string containing the name of the protocol status.
$boolean = is_known_type($type);
$boolean
A boolean indicating whether or not $type is a known FastCGI v1 type.
$boolean = is_management_type($type);
A boolean indicating whether or not $type is a management type.
$boolean = is_discrete_type($type);
A boolean indicating whether or not $type is a discrete type.
$boolean = is_stream_type($type);
A boolean indicating whether or not $type is a stream type.
None by default. All functions can be exported using the :all tag or individually.
:all
Christian Hansen chansen@cpan.org
chansen@cpan.org
Copyright (c) 2008 Christian Hansen. All rights reserved.
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
To install Net::FastCGI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::FastCGI
CPAN shell
perl -MCPAN -e shell install Net::FastCGI
For more information on module installation, please visit the detailed CPAN module installation guide.