src/http/modules/perl/nginx.pm - nginx-1.7.10

Data types defined

Source code

  1. package nginx;

  2. use 5.006001;
  3. use strict;
  4. use warnings;

  5. require Exporter;

  6. our @ISA = qw(Exporter);

  7. our @EXPORT = qw(
  8.     OK
  9.     DECLINED

  10.     HTTP_OK
  11.     HTTP_CREATED
  12.     HTTP_ACCEPTED
  13.     HTTP_NO_CONTENT
  14.     HTTP_PARTIAL_CONTENT

  15.     HTTP_MOVED_PERMANENTLY
  16.     HTTP_MOVED_TEMPORARILY
  17.     HTTP_REDIRECT
  18.     HTTP_SEE_OTHER
  19.     HTTP_NOT_MODIFIED
  20.     HTTP_TEMPORARY_REDIRECT

  21.     HTTP_BAD_REQUEST
  22.     HTTP_UNAUTHORIZED
  23.     HTTP_PAYMENT_REQUIRED
  24.     HTTP_FORBIDDEN
  25.     HTTP_NOT_FOUND
  26.     HTTP_NOT_ALLOWED
  27.     HTTP_NOT_ACCEPTABLE
  28.     HTTP_REQUEST_TIME_OUT
  29.     HTTP_CONFLICT
  30.     HTTP_GONE
  31.     HTTP_LENGTH_REQUIRED
  32.     HTTP_REQUEST_ENTITY_TOO_LARGE
  33.     HTTP_REQUEST_URI_TOO_LARGE
  34.     HTTP_UNSUPPORTED_MEDIA_TYPE
  35.     HTTP_RANGE_NOT_SATISFIABLE

  36.     HTTP_INTERNAL_SERVER_ERROR
  37.     HTTP_SERVER_ERROR
  38.     HTTP_NOT_IMPLEMENTED
  39.     HTTP_BAD_GATEWAY
  40.     HTTP_SERVICE_UNAVAILABLE
  41.     HTTP_GATEWAY_TIME_OUT
  42.     HTTP_INSUFFICIENT_STORAGE
  43. );

  44. our $VERSION = '%%VERSION%%';

  45. require XSLoader;
  46. XSLoader::load('nginx', $VERSION);

  47. # Preloaded methods go here.

  48. use constant OK                             => 0;
  49. use constant DECLINED                       => -5;

  50. use constant HTTP_OK                        => 200;
  51. use constant HTTP_CREATED                   => 201;
  52. use constant HTTP_ACCEPTED                  => 202;
  53. use constant HTTP_NO_CONTENT                => 204;
  54. use constant HTTP_PARTIAL_CONTENT           => 206;

  55. use constant HTTP_MOVED_PERMANENTLY         => 301;
  56. use constant HTTP_MOVED_TEMPORARILY         => 302;
  57. use constant HTTP_REDIRECT                  => 302;
  58. use constant HTTP_SEE_OTHER                 => 303;
  59. use constant HTTP_NOT_MODIFIED              => 304;
  60. use constant HTTP_TEMPORARY_REDIRECT        => 307;

  61. use constant HTTP_BAD_REQUEST               => 400;
  62. use constant HTTP_UNAUTHORIZED              => 401;
  63. use constant HTTP_PAYMENT_REQUIRED          => 402;
  64. use constant HTTP_FORBIDDEN                 => 403;
  65. use constant HTTP_NOT_FOUND                 => 404;
  66. use constant HTTP_NOT_ALLOWED               => 405;
  67. use constant HTTP_NOT_ACCEPTABLE            => 406;
  68. use constant HTTP_REQUEST_TIME_OUT          => 408;
  69. use constant HTTP_CONFLICT                  => 409;
  70. use constant HTTP_GONE                      => 410;
  71. use constant HTTP_LENGTH_REQUIRED           => 411;
  72. use constant HTTP_REQUEST_ENTITY_TOO_LARGE  => 413;
  73. use constant HTTP_REQUEST_URI_TOO_LARGE     => 414;
  74. use constant HTTP_UNSUPPORTED_MEDIA_TYPE    => 415;
  75. use constant HTTP_RANGE_NOT_SATISFIABLE     => 416;

  76. use constant HTTP_INTERNAL_SERVER_ERROR     => 500;
  77. use constant HTTP_SERVER_ERROR              => 500;
  78. use constant HTTP_NOT_IMPLEMENTED           => 501;
  79. use constant HTTP_BAD_GATEWAY               => 502;
  80. use constant HTTP_SERVICE_UNAVAILABLE       => 503;
  81. use constant HTTP_GATEWAY_TIME_OUT          => 504;
  82. use constant HTTP_INSUFFICIENT_STORAGE      => 507;


  83. sub rflush {
  84.     my $r = shift;

  85.     $r->flush;
  86. }


  87. 1;
  88. __END__

  89. =head1 NAME

  90. nginx - Perl interface to the nginx HTTP server API

  91. =head1 SYNOPSIS

  92.   use nginx;

  93. =head1 DESCRIPTION

  94. This module provides a Perl interface to the nginx HTTP server API.


  95. =head1 SEE ALSO

  96. http://nginx.org/en/docs/http/ngx_http_perl_module.html

  97. =head1 AUTHOR

  98. Igor Sysoev

  99. =head1 COPYRIGHT AND LICENSE

  100. Copyright (C) Igor Sysoev
  101. Copyright (C) Nginx, Inc.


  102. =cut