---
name: "Net::FastCGI::Constant"
section: "3pm"
platform: "linux"
package: "libnet-fastcgi-perl"
version: "0.14-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Net::FastCGI::Constant"
---

# Net::FastCGI::Constant(3pm)

FastCGI protocol constants.

## NAME

Net::FastCGI::Constant - FastCGI protocol constants.

## DESCRIPTION

FastCGI protocol constants.

## CONSTANTS

Constants can either be imported individually or in sets grouped by tag names.  The tag names are:

### ":common"

- "FCGI\_MAX\_CONTENT\_LEN"

  Maximum number of octets that the content component of the record can hold. (`65535`)

- "FCGI\_HEADER\_LEN"

  Number of octets in `"FCGI_Header"`. (`8`)

- "FCGI\_VERSION\_1"

  Value for `"version"` component of `"FCGI_Header"`. (`1`)

- "FCGI\_NULL\_REQUEST\_ID"

  Value for `"request_id"` component of `"FCGI_Header"`. (`0`)

### ":type"

Values for `"type"` component of `"FCGI_Header"`.

- "FCGI\_BEGIN\_REQUEST"

  - "FCGI\_ABORT\_REQUEST"

  - "FCGI\_END\_REQUEST"

  - "FCGI\_PARAMS"

  - "FCGI\_STDIN"

  - "FCGI\_STDOUT"

  - "FCGI\_STDERR"

  - "FCGI\_DATA"

  - "FCGI\_GET\_VALUES"

  - "FCGI\_GET\_VALUES\_RESULT"

  - "FCGI\_UNKNOWN\_TYPE"

  - "FCGI\_MAXTYPE"

  ### ":flag"

Mask for `"flags"` component of `"FCGI_BeginRequestBody"`.

- "FCGI\_KEEP\_CONN"

  ### ":role"

Values for `"role"` component of `"FCGI_BeginRequestBody"`.

- "FCGI\_RESPONDER"

  - "FCGI\_AUTHORIZER"

  - "FCGI\_FILTER"

  ### ":protocol\_status"

Values for `"protocol_status"` component of `"FCGI_EndRequestBody"`.

- "FCGI\_REQUEST\_COMPLETE"

  - "FCGI\_CANT\_MPX\_CONN"

  - "FCGI\_OVERLOADED"

  - "FCGI\_UNKNOWN\_ROLE"

  ### ":value"

Variable names for `"FCGI_GET_VALUES"` / `"FCGI_GET_VALUES_RESULT"` records.

- "FCGI\_MAX\_CONNS"

  - "FCGI\_MAX\_REQS"

  - "FCGI\_MPXS\_CONNS"

  ### ":pack"

`"pack()"` / `"unpack()"` templates

- "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 containing names of value components. These are read-only.

- @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 that `"exists"` works for validation purposes, index `0`  might be `"undef"`.

Use boolean context instead:

```
    ($FCGI_TYPE_NAME[$type])
      || die;
```

## EXPORTS

None by default. All functions can be exported using the `":all"` tag or individually.

## 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.
