Mercurial > hg > nginx-quic
annotate src/http/modules/perl/nginx.pm @ 4041:f87edc142316 stable-1.0
Merge of r3960, r3961, r3962, r3963, r3965:
SSL related fixes:
*) MSIE export versions are rare now, so RSA 512 key is generated on demand
and is shared among all hosts instead of pregenerating for every HTTPS host
on configuraiton phase. This decreases start time for configuration with
large number of HTTPS hosts.
*) ECDHE support; patch by Adrian Kotelba
*) fix build by gcc46 with -Wunused-value option
*) fix SSL connection issues on platforms with 32-bit off_t
*) do not try to reuse and save a SSL session for a peer created on the fly
by ngx_http_upstream_create_round_robin_peer(), since the peer lives
only during request so the saved SSL session will never be used again
and just causes memory leak
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 29 Aug 2011 12:35:53 +0000 |
parents | ded522fdc826 |
children | b78768308e30 |
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 |
914 | 24 HTTP_NOT_MODIFIED |
25 | |
26 HTTP_BAD_REQUEST | |
27 HTTP_UNAUTHORIZED | |
28 HTTP_PAYMENT_REQUIRED | |
29 HTTP_FORBIDDEN | |
599 | 30 HTTP_NOT_FOUND |
914 | 31 HTTP_NOT_ALLOWED |
32 HTTP_NOT_ACCEPTABLE | |
33 HTTP_REQUEST_TIME_OUT | |
34 HTTP_CONFLICT | |
35 HTTP_GONE | |
36 HTTP_LENGTH_REQUIRED | |
37 HTTP_REQUEST_ENTITY_TOO_LARGE | |
38 HTTP_REQUEST_URI_TOO_LARGE | |
39 HTTP_UNSUPPORTED_MEDIA_TYPE | |
40 HTTP_RANGE_NOT_SATISFIABLE | |
41 | |
42 HTTP_INTERNAL_SERVER_ERROR | |
599 | 43 HTTP_SERVER_ERROR |
914 | 44 HTTP_NOT_IMPLEMENTED |
45 HTTP_BAD_GATEWAY | |
46 HTTP_SERVICE_UNAVAILABLE | |
47 HTTP_GATEWAY_TIME_OUT | |
48 HTTP_INSUFFICIENT_STORAGE | |
599 | 49 ); |
50 | |
4036 | 51 our $VERSION = '1.0.6'; |
599 | 52 |
53 require XSLoader; | |
54 XSLoader::load('nginx', $VERSION); | |
55 | |
56 # Preloaded methods go here. | |
57 | |
914 | 58 use constant OK => 0; |
59 use constant DECLINED => -5; | |
60 | |
61 use constant HTTP_OK => 200; | |
62 use constant HTTP_CREATED => 201; | |
3604 | 63 use constant HTTP_ACCEPTED => 202; |
914 | 64 use constant HTTP_NO_CONTENT => 204; |
65 use constant HTTP_PARTIAL_CONTENT => 206; | |
66 | |
67 use constant HTTP_MOVED_PERMANENTLY => 301; | |
68 use constant HTTP_MOVED_TEMPORARILY => 302; | |
69 use constant HTTP_REDIRECT => 302; | |
70 use constant HTTP_NOT_MODIFIED => 304; | |
599 | 71 |
914 | 72 use constant HTTP_BAD_REQUEST => 400; |
73 use constant HTTP_UNAUTHORIZED => 401; | |
74 use constant HTTP_PAYMENT_REQUIRED => 402; | |
75 use constant HTTP_FORBIDDEN => 403; | |
76 use constant HTTP_NOT_FOUND => 404; | |
77 use constant HTTP_NOT_ALLOWED => 405; | |
78 use constant HTTP_NOT_ACCEPTABLE => 406; | |
79 use constant HTTP_REQUEST_TIME_OUT => 408; | |
80 use constant HTTP_CONFLICT => 409; | |
81 use constant HTTP_GONE => 410; | |
82 use constant HTTP_LENGTH_REQUIRED => 411; | |
83 use constant HTTP_REQUEST_ENTITY_TOO_LARGE => 413; | |
84 use constant HTTP_REQUEST_URI_TOO_LARGE => 414; | |
85 use constant HTTP_UNSUPPORTED_MEDIA_TYPE => 415; | |
86 use constant HTTP_RANGE_NOT_SATISFIABLE => 416; | |
87 | |
88 use constant HTTP_INTERNAL_SERVER_ERROR => 500; | |
89 use constant HTTP_SERVER_ERROR => 500; | |
90 use constant HTTP_NOT_IMPLEMENTED => 501; | |
91 use constant HTTP_BAD_GATEWAY => 502; | |
92 use constant HTTP_SERVICE_UNAVAILABLE => 503; | |
93 use constant HTTP_GATEWAY_TIME_OUT => 504; | |
94 use constant HTTP_INSUFFICIENT_STORAGE => 507; | |
599 | 95 |
96 | |
1178
a77f6980de50
rename $r->rflush to $r->flush
Igor Sysoev <igor@sysoev.ru>
parents:
1177
diff
changeset
|
97 sub rflush { |
a77f6980de50
rename $r->rflush to $r->flush
Igor Sysoev <igor@sysoev.ru>
parents:
1177
diff
changeset
|
98 my $r = shift; |
a77f6980de50
rename $r->rflush to $r->flush
Igor Sysoev <igor@sysoev.ru>
parents:
1177
diff
changeset
|
99 |
a77f6980de50
rename $r->rflush to $r->flush
Igor Sysoev <igor@sysoev.ru>
parents:
1177
diff
changeset
|
100 $r->flush; |
a77f6980de50
rename $r->rflush to $r->flush
Igor Sysoev <igor@sysoev.ru>
parents:
1177
diff
changeset
|
101 } |
a77f6980de50
rename $r->rflush to $r->flush
Igor Sysoev <igor@sysoev.ru>
parents:
1177
diff
changeset
|
102 |
a77f6980de50
rename $r->rflush to $r->flush
Igor Sysoev <igor@sysoev.ru>
parents:
1177
diff
changeset
|
103 |
599 | 104 1; |
105 __END__ | |
106 | |
107 =head1 NAME | |
108 | |
109 nginx - Perl interface to the nginx HTTP server API | |
110 | |
111 =head1 SYNOPSIS | |
112 | |
113 use nginx; | |
114 | |
115 =head1 DESCRIPTION | |
116 | |
117 This module provides a Perl interface to the nginx HTTP server API. | |
118 | |
119 | |
120 =head1 SEE ALSO | |
121 | |
122 http://sysoev.ru/nginx/docs/http/ngx_http_perl_module.html | |
123 | |
124 =head1 AUTHOR | |
125 | |
126 Igor Sysoev | |
127 | |
128 =head1 COPYRIGHT AND LICENSE | |
129 | |
130 Copyright (C) Igor Sysoev | |
131 | |
132 | |
133 =cut |