Mercurial > hg > nginx-quic
annotate src/http/modules/perl/nginx.pm @ 5248:f5626ab8cb87
Perl: fixed r->header_in("Cookie") (ticket #351).
It was broken by X-Forwarded-For related changes in f7fe817c92a2 (1.3.14)
as hh->offset is no longer 0 for Cookie.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 10 Jun 2013 14:35:00 +0400 |
parents | f45b83d20cfb |
children | be5cfa918bfc |
rev | line source |
---|---|
599 | 1 package nginx; |
2 | |
3 use 5.006001; | |
4 use strict; | |
5 use warnings; | |
6 | |
7 require Exporter; | |
8 | |
9 our @ISA = qw(Exporter); | |
10 | |
11 our @EXPORT = qw( | |
12 OK | |
13 DECLINED | |
914 | 14 |
599 | 15 HTTP_OK |
914 | 16 HTTP_CREATED |
3604 | 17 HTTP_ACCEPTED |
914 | 18 HTTP_NO_CONTENT |
19 HTTP_PARTIAL_CONTENT | |
20 | |
21 HTTP_MOVED_PERMANENTLY | |
22 HTTP_MOVED_TEMPORARILY | |
599 | 23 HTTP_REDIRECT |
4491
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4483
diff
changeset
|
24 HTTP_SEE_OTHER |
914 | 25 HTTP_NOT_MODIFIED |
4491
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4483
diff
changeset
|
26 HTTP_TEMPORARY_REDIRECT |
914 | 27 |
28 HTTP_BAD_REQUEST | |
29 HTTP_UNAUTHORIZED | |
30 HTTP_PAYMENT_REQUIRED | |
31 HTTP_FORBIDDEN | |
599 | 32 HTTP_NOT_FOUND |
914 | 33 HTTP_NOT_ALLOWED |
34 HTTP_NOT_ACCEPTABLE | |
35 HTTP_REQUEST_TIME_OUT | |
36 HTTP_CONFLICT | |
37 HTTP_GONE | |
38 HTTP_LENGTH_REQUIRED | |
39 HTTP_REQUEST_ENTITY_TOO_LARGE | |
40 HTTP_REQUEST_URI_TOO_LARGE | |
41 HTTP_UNSUPPORTED_MEDIA_TYPE | |
42 HTTP_RANGE_NOT_SATISFIABLE | |
43 | |
44 HTTP_INTERNAL_SERVER_ERROR | |
599 | 45 HTTP_SERVER_ERROR |
914 | 46 HTTP_NOT_IMPLEMENTED |
47 HTTP_BAD_GATEWAY | |
48 HTTP_SERVICE_UNAVAILABLE | |
49 HTTP_GATEWAY_TIME_OUT | |
50 HTTP_INSUFFICIENT_STORAGE | |
599 | 51 ); |
52 | |
5146
f45b83d20cfb
Simplified nginx version maintenance.
Ruslan Ermilov <ru@nginx.com>
parents:
5140
diff
changeset
|
53 our $VERSION = '%%VERSION%%'; |
599 | 54 |
55 require XSLoader; | |
56 XSLoader::load('nginx', $VERSION); | |
57 | |
58 # Preloaded methods go here. | |
59 | |
914 | 60 use constant OK => 0; |
61 use constant DECLINED => -5; | |
62 | |
63 use constant HTTP_OK => 200; | |
64 use constant HTTP_CREATED => 201; | |
3604 | 65 use constant HTTP_ACCEPTED => 202; |
914 | 66 use constant HTTP_NO_CONTENT => 204; |
67 use constant HTTP_PARTIAL_CONTENT => 206; | |
68 | |
69 use constant HTTP_MOVED_PERMANENTLY => 301; | |
70 use constant HTTP_MOVED_TEMPORARILY => 302; | |
71 use constant HTTP_REDIRECT => 302; | |
4491
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4483
diff
changeset
|
72 use constant HTTP_SEE_OTHER => 303; |
914 | 73 use constant HTTP_NOT_MODIFIED => 304; |
4491
d11f86a16e3b
Added support for the 307 Temporary Redirect.
Ruslan Ermilov <ru@nginx.com>
parents:
4483
diff
changeset
|
74 use constant HTTP_TEMPORARY_REDIRECT => 307; |
599 | 75 |
914 | 76 use constant HTTP_BAD_REQUEST => 400; |
77 use constant HTTP_UNAUTHORIZED => 401; | |
78 use constant HTTP_PAYMENT_REQUIRED => 402; | |
79 use constant HTTP_FORBIDDEN => 403; | |
80 use constant HTTP_NOT_FOUND => 404; | |
81 use constant HTTP_NOT_ALLOWED => 405; | |
82 use constant HTTP_NOT_ACCEPTABLE => 406; | |
83 use constant HTTP_REQUEST_TIME_OUT => 408; | |
84 use constant HTTP_CONFLICT => 409; | |
85 use constant HTTP_GONE => 410; | |
86 use constant HTTP_LENGTH_REQUIRED => 411; | |
87 use constant HTTP_REQUEST_ENTITY_TOO_LARGE => 413; | |
88 use constant HTTP_REQUEST_URI_TOO_LARGE => 414; | |
89 use constant HTTP_UNSUPPORTED_MEDIA_TYPE => 415; | |
90 use constant HTTP_RANGE_NOT_SATISFIABLE => 416; | |
91 | |
92 use constant HTTP_INTERNAL_SERVER_ERROR => 500; | |
93 use constant HTTP_SERVER_ERROR => 500; | |
94 use constant HTTP_NOT_IMPLEMENTED => 501; | |
95 use constant HTTP_BAD_GATEWAY => 502; | |
96 use constant HTTP_SERVICE_UNAVAILABLE => 503; | |
97 use constant HTTP_GATEWAY_TIME_OUT => 504; | |
98 use constant HTTP_INSUFFICIENT_STORAGE => 507; | |
599 | 99 |
100 | |
1178
a77f6980de50
rename $r->rflush to $r->flush
Igor Sysoev <igor@sysoev.ru>
parents:
1177
diff
changeset
|
101 sub rflush { |
a77f6980de50
rename $r->rflush to $r->flush
Igor Sysoev <igor@sysoev.ru>
parents:
1177
diff
changeset
|
102 my $r = shift; |
a77f6980de50
rename $r->rflush to $r->flush
Igor Sysoev <igor@sysoev.ru>
parents:
1177
diff
changeset
|
103 |
a77f6980de50
rename $r->rflush to $r->flush
Igor Sysoev <igor@sysoev.ru>
parents:
1177
diff
changeset
|
104 $r->flush; |
a77f6980de50
rename $r->rflush to $r->flush
Igor Sysoev <igor@sysoev.ru>
parents:
1177
diff
changeset
|
105 } |
a77f6980de50
rename $r->rflush to $r->flush
Igor Sysoev <igor@sysoev.ru>
parents:
1177
diff
changeset
|
106 |
a77f6980de50
rename $r->rflush to $r->flush
Igor Sysoev <igor@sysoev.ru>
parents:
1177
diff
changeset
|
107 |
599 | 108 1; |
109 __END__ | |
110 | |
111 =head1 NAME | |
112 | |
113 nginx - Perl interface to the nginx HTTP server API | |
114 | |
115 =head1 SYNOPSIS | |
116 | |
117 use nginx; | |
118 | |
119 =head1 DESCRIPTION | |
120 | |
121 This module provides a Perl interface to the nginx HTTP server API. | |
122 | |
123 | |
124 =head1 SEE ALSO | |
125 | |
4977
b216d212920b
Brought the link to ngx_http_perl_module documentation up to date.
Ruslan Ermilov <ru@nginx.com>
parents:
4942
diff
changeset
|
126 http://nginx.org/en/docs/http/ngx_http_perl_module.html |
599 | 127 |
128 =head1 AUTHOR | |
129 | |
130 Igor Sysoev | |
131 | |
132 =head1 COPYRIGHT AND LICENSE | |
133 | |
134 Copyright (C) Igor Sysoev | |
4411 | 135 Copyright (C) Nginx, Inc. |
599 | 136 |
137 | |
138 =cut |