mongrel 0.3.13 → 0.3.13.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/bin/mongrel_rails +1 -1
- data/doc/rdoc/classes/Mongrel.html +1 -0
- data/doc/rdoc/classes/Mongrel/CGIWrapper.html +49 -49
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000098.html +11 -21
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000099.html +34 -14
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000100.html +21 -12
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000101.html +14 -5
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000102.html +12 -5
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000103.html +5 -5
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000104.html +5 -6
- data/doc/rdoc/classes/Mongrel/{URIClassifier.src/M000088.html → CGIWrapper.src/M000105.html} +5 -5
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000106.html +19 -0
- data/doc/rdoc/classes/Mongrel/Camping.html +5 -5
- data/doc/rdoc/classes/Mongrel/Camping.src/{M000046.html → M000047.html} +0 -0
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.html +10 -10
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000048.html +5 -38
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000049.html +51 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.html +65 -65
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000025.html +11 -29
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000026.html +29 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000027.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000028.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000029.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000030.html +5 -9
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000031.html +9 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000032.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000033.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000034.html +5 -11
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000035.html +11 -11
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000036.html +11 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000037.html +18 -0
- data/doc/rdoc/classes/Mongrel/Command/Registry.html +15 -15
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000038.html +7 -12
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000039.html +12 -37
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000040.html +50 -0
- data/doc/rdoc/classes/Mongrel/Configurator.html +143 -107
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000107.html +16 -7
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000108.html +18 -7
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000109.html +7 -10
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000110.html +7 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000111.html +10 -21
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000112.html +5 -6
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000113.html +21 -17
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000114.html +6 -20
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000115.html +17 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000116.html +20 -11
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000117.html +5 -6
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000118.html +11 -9
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000119.html +6 -12
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000120.html +5 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000121.html +9 -22
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000122.html +12 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000123.html +5 -20
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000124.html +22 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000125.html +18 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000126.html +33 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000127.html +18 -0
- data/doc/rdoc/classes/Mongrel/Const.html +6 -1
- data/doc/rdoc/classes/Mongrel/DeflateFilter.html +10 -10
- data/doc/rdoc/classes/Mongrel/DeflateFilter.src/{M000094.html → M000096.html} +5 -5
- data/doc/rdoc/classes/Mongrel/DeflateFilter.src/{M000095.html → M000097.html} +14 -14
- data/doc/rdoc/classes/Mongrel/DirHandler.html +31 -31
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000057.html +8 -30
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000058.html +30 -29
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000059.html +29 -50
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000060.html +50 -26
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000061.html +26 -5
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000062.html +18 -0
- data/doc/rdoc/classes/Mongrel/Error404Handler.html +10 -10
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000125.html → M000128.html} +4 -4
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000126.html → M000129.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HeaderOut.html +10 -10
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000070.html +5 -5
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000071.html +18 -0
- data/doc/rdoc/classes/Mongrel/HttpHandler.html +31 -9
- data/doc/rdoc/classes/Mongrel/{URIClassifier.src/M000089.html → HttpHandler.src/M000076.html} +4 -5
- data/doc/rdoc/classes/Mongrel/HttpHandler.src/{M000075.html → M000077.html} +3 -3
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.html +30 -15
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000022.html +4 -6
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000023.html +6 -4
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000024.html +17 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.html +35 -35
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000050.html +5 -6
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000051.html +7 -7
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000052.html +7 -37
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000053.html +37 -5
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000054.html +5 -5
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000055.html +5 -6
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000049.html → M000056.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpRequest.html +20 -20
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000130.html → M000135.html} +38 -38
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000131.html → M000136.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000132.html → M000137.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000133.html → M000138.html} +18 -18
- data/doc/rdoc/classes/Mongrel/HttpResponse.html +61 -61
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000078.html +12 -12
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000079.html +7 -9
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000080.html +12 -9
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000081.html +9 -9
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000082.html +9 -18
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000083.html +9 -8
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000084.html +18 -7
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000085.html +8 -7
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000086.html +7 -7
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000087.html +7 -5
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000088.html +20 -0
- data/doc/rdoc/classes/Mongrel/{HeaderOut.src/M000069.html → HttpResponse.src/M000089.html} +5 -5
- data/doc/rdoc/classes/Mongrel/HttpServer.html +38 -38
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000063.html +12 -70
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000064.html +76 -13
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000065.html +13 -50
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000066.html +50 -21
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000067.html +20 -4
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000068.html +5 -9
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000069.html +22 -0
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.html +15 -15
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000041.html +26 -12
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000042.html +12 -13
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000043.html +26 -0
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.html +15 -15
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000044.html +9 -38
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000045.html +38 -10
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000046.html +23 -0
- data/doc/rdoc/classes/Mongrel/RedirectHandler.html +187 -0
- data/doc/rdoc/classes/Mongrel/RedirectHandler.src/M000133.html +22 -0
- data/doc/rdoc/classes/Mongrel/RedirectHandler.src/M000134.html +27 -0
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.html +16 -16
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/{M000127.html → M000130.html} +10 -10
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/{M000128.html → M000131.html} +10 -10
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/{M000129.html → M000132.html} +4 -4
- data/doc/rdoc/classes/Mongrel/StatusHandler.html +20 -20
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000072.html +5 -11
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000073.html +11 -29
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000074.html +29 -7
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000075.html +20 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.html +30 -30
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000090.html +5 -26
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000091.html +5 -38
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000092.html +18 -15
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000093.html +25 -57
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000094.html +36 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000095.html +83 -0
- data/doc/rdoc/classes/RequestLog/Access.html +5 -5
- data/doc/rdoc/classes/RequestLog/Access.src/{M000134.html → M000139.html} +0 -0
- data/doc/rdoc/classes/RequestLog/Files.html +5 -5
- data/doc/rdoc/classes/RequestLog/Files.src/{M000135.html → M000140.html} +0 -0
- data/doc/rdoc/classes/RequestLog/Objects.html +5 -5
- data/doc/rdoc/classes/RequestLog/Objects.src/{M000137.html → M000142.html} +0 -0
- data/doc/rdoc/classes/RequestLog/Params.html +5 -5
- data/doc/rdoc/classes/RequestLog/Params.src/{M000138.html → M000143.html} +0 -0
- data/doc/rdoc/classes/RequestLog/Threads.html +5 -5
- data/doc/rdoc/classes/RequestLog/Threads.src/{M000136.html → M000141.html} +0 -0
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/ext/http11/http11_c.html +1 -1
- data/doc/rdoc/files/lib/mongrel/handlers_rb.html +1 -1
- data/doc/rdoc/files/lib/mongrel_rb.html +1 -1
- data/doc/rdoc/fr_class_index.html +1 -0
- data/doc/rdoc/fr_method_index.html +124 -119
- data/examples/simpletest.rb +2 -0
- data/ext/http11/http11.c +1 -1
- data/lib/mongrel.rb +30 -5
- data/lib/mongrel/handlers.rb +57 -2
- data/test/test_redirect_handler.rb +40 -0
- metadata +47 -38
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000096.html +0 -24
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000097.html +0 -47
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000047.html +0 -18
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000024.html +0 -24
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000037.html +0 -20
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000105.html +0 -29
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000106.html +0 -31
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000056.html +0 -21
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000076.html +0 -25
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000077.html +0 -20
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000062.html +0 -25
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000040.html +0 -39
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000043.html +0 -22
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000071.html +0 -18
File without changes
|
data/doc/rdoc/created.rid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Wed Jun 21 01:29:32 GMT-5:00 2006
|
@@ -45,6 +45,7 @@
|
|
45
45
|
<a href="classes/Mongrel/Rails.html">Mongrel::Rails</a><br />
|
46
46
|
<a href="classes/Mongrel/Rails/RailsConfigurator.html">Mongrel::Rails::RailsConfigurator</a><br />
|
47
47
|
<a href="classes/Mongrel/Rails/RailsHandler.html">Mongrel::Rails::RailsHandler</a><br />
|
48
|
+
<a href="classes/Mongrel/RedirectHandler.html">Mongrel::RedirectHandler</a><br />
|
48
49
|
<a href="classes/Mongrel/StatisticsFilter.html">Mongrel::StatisticsFilter</a><br />
|
49
50
|
<a href="classes/Mongrel/StatusHandler.html">Mongrel::StatusHandler</a><br />
|
50
51
|
<a href="classes/Mongrel/StopServer.html">Mongrel::StopServer</a><br />
|
@@ -20,144 +20,149 @@
|
|
20
20
|
<div id="index">
|
21
21
|
<h1 class="section-bar">Methods</h1>
|
22
22
|
<div id="index-entries">
|
23
|
-
<a href="classes/Mongrel/HeaderOut.html#
|
24
|
-
<a href="classes/Mongrel/DirHandler.html#
|
25
|
-
<a href="classes/Mongrel/CGIWrapper.html#
|
23
|
+
<a href="classes/Mongrel/HeaderOut.html#M000071">[]= (Mongrel::HeaderOut)</a><br />
|
24
|
+
<a href="classes/Mongrel/DirHandler.html#M000062">add_mime_type (Mongrel::DirHandler)</a><br />
|
25
|
+
<a href="classes/Mongrel/CGIWrapper.html#M000103">args (Mongrel::CGIWrapper)</a><br />
|
26
26
|
<a href="classes/MongrelDbg.html#M000017">begin_trace (MongrelDbg)</a><br />
|
27
|
-
<a href="classes/Mongrel/DirHandler.html#
|
28
|
-
<a href="classes/Mongrel/Configurator.html#
|
29
|
-
<a href="classes/Mongrel/Configurator.html#
|
30
|
-
<a href="classes/Mongrel/Configurator.html#
|
27
|
+
<a href="classes/Mongrel/DirHandler.html#M000058">can_serve (Mongrel::DirHandler)</a><br />
|
28
|
+
<a href="classes/Mongrel/Configurator.html#M000108">change_privilege (Mongrel::Configurator)</a><br />
|
29
|
+
<a href="classes/Mongrel/Configurator.html#M000111">cloaker (Mongrel::Configurator)</a><br />
|
30
|
+
<a href="classes/Mongrel/Configurator.html#M000110">cloaking_class (Mongrel::Configurator)</a><br />
|
31
31
|
<a href="classes/IO.html#M000002">close (IO)</a><br />
|
32
|
-
<a href="classes/Mongrel/Command/Registry.html#
|
33
|
-
<a href="classes/Mongrel/Command/Base.html#
|
34
|
-
<a href="classes/MongrelDbg.html#M000015">configure (MongrelDbg)</a><br />
|
32
|
+
<a href="classes/Mongrel/Command/Registry.html#M000038">commands (Mongrel::Command::Registry)</a><br />
|
33
|
+
<a href="classes/Mongrel/Command/Base.html#M000027">configure (Mongrel::Command::Base)</a><br />
|
35
34
|
<a href="classes/ObjectTracker.html#M000013">configure (ObjectTracker)</a><br />
|
36
|
-
<a href="classes/
|
37
|
-
<a href="classes/Mongrel/Configurator.html#
|
38
|
-
<a href="classes/Mongrel/
|
39
|
-
<a href="classes/Mongrel/
|
40
|
-
<a href="classes/Mongrel/HttpResponse.html#
|
35
|
+
<a href="classes/MongrelDbg.html#M000015">configure (MongrelDbg)</a><br />
|
36
|
+
<a href="classes/Mongrel/Configurator.html#M000115">daemonize (Mongrel::Configurator)</a><br />
|
37
|
+
<a href="classes/Mongrel/Configurator.html#M000124">debug (Mongrel::Configurator)</a><br />
|
38
|
+
<a href="classes/Mongrel/StatusHandler.html#M000074">describe_listener (Mongrel::StatusHandler)</a><br />
|
39
|
+
<a href="classes/Mongrel/HttpResponse.html#M000089">done (Mongrel::HttpResponse)</a><br />
|
40
|
+
<a href="classes/Mongrel/HttpResponse.html#M000088">done= (Mongrel::HttpResponse)</a><br />
|
41
|
+
<a href="classes/Mongrel/StatisticsFilter.html#M000132">dump (Mongrel::StatisticsFilter)</a><br />
|
41
42
|
<a href="classes/Stats.html#M000008">dump (Stats)</a><br />
|
42
|
-
<a href="classes/Mongrel/StatisticsFilter.html#M000129">dump (Mongrel::StatisticsFilter)</a><br />
|
43
43
|
<a href="classes/MongrelDbg.html#M000018">end_trace (MongrelDbg)</a><br />
|
44
|
-
<a href="classes/Mongrel/CGIWrapper.html#
|
45
|
-
<a href="classes/Mongrel/HttpParser.html#
|
46
|
-
<a href="classes/Mongrel/HttpRequest.html#
|
47
|
-
<a href="classes/Mongrel/HttpParser.html#
|
48
|
-
<a href="classes/Mongrel/Command/Base.html#
|
49
|
-
<a href="classes/Mongrel/HttpParser.html#
|
50
|
-
<a href="classes/Mongrel/HttpResponse.html#
|
51
|
-
<a href="classes/Mongrel/HttpParser.html#
|
52
|
-
<a href="classes/Mongrel/CGIWrapper.html#
|
53
|
-
<a href="classes/Mongrel/Command/Base.html#
|
44
|
+
<a href="classes/Mongrel/CGIWrapper.html#M000104">env_table (Mongrel::CGIWrapper)</a><br />
|
45
|
+
<a href="classes/Mongrel/HttpParser.html#M000054">error? (Mongrel::HttpParser)</a><br />
|
46
|
+
<a href="classes/Mongrel/HttpRequest.html#M000136">escape (Mongrel::HttpRequest)</a><br />
|
47
|
+
<a href="classes/Mongrel/HttpParser.html#M000053">execute (Mongrel::HttpParser)</a><br />
|
48
|
+
<a href="classes/Mongrel/Command/Base.html#M000037">failure (Mongrel::Command::Base)</a><br />
|
49
|
+
<a href="classes/Mongrel/HttpParser.html#M000052">finish (Mongrel::HttpParser)</a><br />
|
50
|
+
<a href="classes/Mongrel/HttpResponse.html#M000087">finished (Mongrel::HttpResponse)</a><br />
|
51
|
+
<a href="classes/Mongrel/HttpParser.html#M000055">finished? (Mongrel::HttpParser)</a><br />
|
52
|
+
<a href="classes/Mongrel/CGIWrapper.html#M000099">header (Mongrel::CGIWrapper)</a><br />
|
53
|
+
<a href="classes/Mongrel/Command/Base.html#M000029">help (Mongrel::Command::Base)</a><br />
|
54
54
|
<a href="classes/TCPServer.html#M000004">initialize (TCPServer)</a><br />
|
55
55
|
<a href="classes/TCPServer.html#M000003">initialize_with_backlog (TCPServer)</a><br />
|
56
|
-
<a href="classes/Mongrel/URIClassifier.html#
|
57
|
-
<a href="classes/Mongrel/Configurator.html#
|
58
|
-
<a href="classes/Mongrel/Configurator.html#
|
59
|
-
<a href="classes/Mongrel/Configurator.html#
|
60
|
-
<a href="classes/Mongrel/Configurator.html#
|
61
|
-
<a href="classes/Mongrel/Configurator.html#
|
62
|
-
<a href="classes/Mongrel/Configurator.html#
|
56
|
+
<a href="classes/Mongrel/URIClassifier.html#M000091">inspect (Mongrel::URIClassifier)</a><br />
|
57
|
+
<a href="classes/Mongrel/Configurator.html#M000123">join (Mongrel::Configurator)</a><br />
|
58
|
+
<a href="classes/Mongrel/Configurator.html#M000113">listener (Mongrel::Configurator)</a><br />
|
59
|
+
<a href="classes/Mongrel/Configurator.html#M000118">load_mime_map (Mongrel::Configurator)</a><br />
|
60
|
+
<a href="classes/Mongrel/Configurator.html#M000116">load_plugins (Mongrel::Configurator)</a><br />
|
61
|
+
<a href="classes/Mongrel/Configurator.html#M000117">load_yaml (Mongrel::Configurator)</a><br />
|
62
|
+
<a href="classes/Mongrel/Configurator.html#M000127">log (Mongrel::Configurator)</a><br />
|
63
63
|
<a href="classes/Kernel.html#M000021">log_open_files (Kernel)</a><br />
|
64
64
|
<a href="classes/Stats.html#M000010">mean (Stats)</a><br />
|
65
|
-
<a href="classes/Mongrel/
|
66
|
-
<a href="classes/Mongrel/
|
67
|
-
<a href="classes/Mongrel/
|
68
|
-
<a href="classes/Mongrel/
|
69
|
-
<a href="classes/Mongrel/
|
70
|
-
<a href="classes/Mongrel/
|
71
|
-
<a href="classes/Mongrel/
|
72
|
-
<a href="classes/Mongrel/
|
73
|
-
<a href="classes/Mongrel/
|
74
|
-
<a href="classes/Mongrel/
|
65
|
+
<a href="classes/Mongrel/Error404Handler.html#M000128">new (Mongrel::Error404Handler)</a><br />
|
66
|
+
<a href="classes/Mongrel/Rails/RailsHandler.html#M000044">new (Mongrel::Rails::RailsHandler)</a><br />
|
67
|
+
<a href="classes/Mongrel/Command/Base.html#M000026">new (Mongrel::Command::Base)</a><br />
|
68
|
+
<a href="classes/Mongrel/HttpHandlerPlugin.html#M000023">new (Mongrel::HttpHandlerPlugin)</a><br />
|
69
|
+
<a href="classes/Mongrel/HttpResponse.html#M000078">new (Mongrel::HttpResponse)</a><br />
|
70
|
+
<a href="classes/Mongrel/Camping/CampingHandler.html#M000048">new (Mongrel::Camping::CampingHandler)</a><br />
|
71
|
+
<a href="classes/Mongrel/URIClassifier.html#M000092">new (Mongrel::URIClassifier)</a><br />
|
72
|
+
<a href="classes/Mongrel/HttpParser.html#M000050">new (Mongrel::HttpParser)</a><br />
|
73
|
+
<a href="classes/Mongrel/StatusHandler.html#M000072">new (Mongrel::StatusHandler)</a><br />
|
74
|
+
<a href="classes/Mongrel/CGIWrapper.html#M000098">new (Mongrel::CGIWrapper)</a><br />
|
75
|
+
<a href="classes/Mongrel/HttpServer.html#M000063">new (Mongrel::HttpServer)</a><br />
|
76
|
+
<a href="classes/Mongrel/DeflateFilter.html#M000096">new (Mongrel::DeflateFilter)</a><br />
|
77
|
+
<a href="classes/Mongrel/RedirectHandler.html#M000133">new (Mongrel::RedirectHandler)</a><br />
|
78
|
+
<a href="classes/Mongrel/Configurator.html#M000107">new (Mongrel::Configurator)</a><br />
|
79
|
+
<a href="classes/Mongrel/DirHandler.html#M000057">new (Mongrel::DirHandler)</a><br />
|
80
|
+
<a href="classes/Mongrel/HttpRequest.html#M000135">new (Mongrel::HttpRequest)</a><br />
|
75
81
|
<a href="classes/Stats.html#M000005">new (Stats)</a><br />
|
76
|
-
<a href="classes/Mongrel/
|
77
|
-
<a href="classes/Mongrel/
|
78
|
-
<a href="classes/Mongrel/
|
79
|
-
<a href="classes/Mongrel/URIClassifier.html#M000090">new (Mongrel::URIClassifier)</a><br />
|
80
|
-
<a href="classes/Mongrel/Configurator.html#M000105">new (Mongrel::Configurator)</a><br />
|
81
|
-
<a href="classes/Mongrel/CGIWrapper.html#M000096">new (Mongrel::CGIWrapper)</a><br />
|
82
|
-
<a href="classes/Mongrel/Command/Base.html#M000025">new (Mongrel::Command::Base)</a><br />
|
83
|
-
<a href="classes/Mongrel/HttpParser.html#M000055">nread (Mongrel::HttpParser)</a><br />
|
82
|
+
<a href="classes/Mongrel/HeaderOut.html#M000070">new (Mongrel::HeaderOut)</a><br />
|
83
|
+
<a href="classes/Mongrel/StatisticsFilter.html#M000130">new (Mongrel::StatisticsFilter)</a><br />
|
84
|
+
<a href="classes/Mongrel/HttpParser.html#M000056">nread (Mongrel::HttpParser)</a><br />
|
84
85
|
<a href="classes/IO.html#M000001">open (IO)</a><br />
|
85
86
|
<a href="classes/Kernel.html#M000020">open (Kernel)</a><br />
|
86
|
-
<a href="classes/Mongrel/Command/Base.html#
|
87
|
-
<a href="classes/Mongrel/CGIWrapper.html#
|
88
|
-
<a href="classes/Mongrel/Configurator.html#
|
89
|
-
<a href="classes/Mongrel/Command/Registry.html#
|
90
|
-
<a href="classes/Mongrel/
|
91
|
-
<a href="classes/
|
92
|
-
<a href="classes/Mongrel/
|
93
|
-
<a href="classes/
|
94
|
-
<a href="classes/
|
95
|
-
<a href="classes/
|
96
|
-
<a href="classes/Mongrel/
|
97
|
-
<a href="classes/
|
98
|
-
<a href="classes/Mongrel/
|
99
|
-
<a href="classes/
|
100
|
-
<a href="classes/
|
101
|
-
<a href="classes/Mongrel/
|
102
|
-
<a href="classes/
|
103
|
-
<a href="classes/RequestLog/
|
104
|
-
<a href="classes/Mongrel/
|
105
|
-
<a href="classes/Mongrel/
|
106
|
-
<a href="classes/Mongrel/
|
107
|
-
<a href="classes/Mongrel/
|
108
|
-
<a href="classes/Mongrel/HttpServer.html#
|
109
|
-
<a href="classes/Mongrel/
|
110
|
-
<a href="classes/Mongrel/
|
111
|
-
<a href="classes/Mongrel/
|
112
|
-
<a href="classes/Mongrel/
|
113
|
-
<a href="classes/Mongrel/
|
87
|
+
<a href="classes/Mongrel/Command/Base.html#M000025">options (Mongrel::Command::Base)</a><br />
|
88
|
+
<a href="classes/Mongrel/CGIWrapper.html#M000101">out (Mongrel::CGIWrapper)</a><br />
|
89
|
+
<a href="classes/Mongrel/Configurator.html#M000119">plugin (Mongrel::Configurator)</a><br />
|
90
|
+
<a href="classes/Mongrel/Command/Registry.html#M000039">print_command_list (Mongrel::Command::Registry)</a><br />
|
91
|
+
<a href="classes/Mongrel/Camping/CampingHandler.html#M000049">process (Mongrel::Camping::CampingHandler)</a><br />
|
92
|
+
<a href="classes/Mongrel/StatisticsFilter.html#M000131">process (Mongrel::StatisticsFilter)</a><br />
|
93
|
+
<a href="classes/Mongrel/Error404Handler.html#M000129">process (Mongrel::Error404Handler)</a><br />
|
94
|
+
<a href="classes/Mongrel/Rails/RailsHandler.html#M000045">process (Mongrel::Rails::RailsHandler)</a><br />
|
95
|
+
<a href="classes/RequestLog/Params.html#M000143">process (RequestLog::Params)</a><br />
|
96
|
+
<a href="classes/Mongrel/RedirectHandler.html#M000134">process (Mongrel::RedirectHandler)</a><br />
|
97
|
+
<a href="classes/Mongrel/StatusHandler.html#M000075">process (Mongrel::StatusHandler)</a><br />
|
98
|
+
<a href="classes/RequestLog/Access.html#M000139">process (RequestLog::Access)</a><br />
|
99
|
+
<a href="classes/Mongrel/HttpHandler.html#M000077">process (Mongrel::HttpHandler)</a><br />
|
100
|
+
<a href="classes/Mongrel/HttpHandlerPlugin.html#M000024">process (Mongrel::HttpHandlerPlugin)</a><br />
|
101
|
+
<a href="classes/RequestLog/Files.html#M000140">process (RequestLog::Files)</a><br />
|
102
|
+
<a href="classes/Mongrel/DirHandler.html#M000061">process (Mongrel::DirHandler)</a><br />
|
103
|
+
<a href="classes/RequestLog/Threads.html#M000141">process (RequestLog::Threads)</a><br />
|
104
|
+
<a href="classes/RequestLog/Objects.html#M000142">process (RequestLog::Objects)</a><br />
|
105
|
+
<a href="classes/Mongrel/DeflateFilter.html#M000097">process (Mongrel::DeflateFilter)</a><br />
|
106
|
+
<a href="classes/Mongrel/HttpServer.html#M000064">process_client (Mongrel::HttpServer)</a><br />
|
107
|
+
<a href="classes/Mongrel/HttpRequest.html#M000138">query_parse (Mongrel::HttpRequest)</a><br />
|
108
|
+
<a href="classes/Mongrel/Rails/RailsConfigurator.html#M000041">rails (Mongrel::Rails::RailsConfigurator)</a><br />
|
109
|
+
<a href="classes/Mongrel/HttpServer.html#M000065">reap_dead_workers (Mongrel::HttpServer)</a><br />
|
110
|
+
<a href="classes/Mongrel/Configurator.html#M000120">redirect (Mongrel::Configurator)</a><br />
|
111
|
+
<a href="classes/Mongrel/URIClassifier.html#M000093">register (Mongrel::URIClassifier)</a><br />
|
112
|
+
<a href="classes/Mongrel/HttpServer.html#M000067">register (Mongrel::HttpServer)</a><br />
|
113
|
+
<a href="classes/Mongrel/Rails/RailsHandler.html#M000046">reload! (Mongrel::Rails::RailsHandler)</a><br />
|
114
|
+
<a href="classes/Mongrel/Rails/RailsConfigurator.html#M000042">reload! (Mongrel::Rails::RailsConfigurator)</a><br />
|
115
|
+
<a href="classes/Mongrel/HttpHandlerPlugin.html#M000022">request_begins (Mongrel::HttpHandlerPlugin)</a><br />
|
116
|
+
<a href="classes/Mongrel/HttpHandler.html#M000076">request_begins (Mongrel::HttpHandler)</a><br />
|
114
117
|
<a href="classes/Stats.html#M000006">reset (Stats)</a><br />
|
115
|
-
<a href="classes/Mongrel/
|
116
|
-
<a href="classes/Mongrel/
|
117
|
-
<a href="classes/Mongrel/
|
118
|
-
<a href="classes/Mongrel/
|
119
|
-
<a href="classes/Mongrel/Command/Base.html#
|
120
|
-
<a href="classes/Mongrel/
|
121
|
-
<a href="classes/Mongrel/
|
122
|
-
<a href="classes/
|
118
|
+
<a href="classes/Mongrel/HttpParser.html#M000051">reset (Mongrel::HttpParser)</a><br />
|
119
|
+
<a href="classes/Mongrel/HttpResponse.html#M000080">reset (Mongrel::HttpResponse)</a><br />
|
120
|
+
<a href="classes/Mongrel/URIClassifier.html#M000095">resolve (Mongrel::URIClassifier)</a><br />
|
121
|
+
<a href="classes/Mongrel/Configurator.html#M000112">resolve_defaults (Mongrel::Configurator)</a><br />
|
122
|
+
<a href="classes/Mongrel/Command/Base.html#M000030">run (Mongrel::Command::Base)</a><br />
|
123
|
+
<a href="classes/Mongrel/HttpServer.html#M000066">run (Mongrel::HttpServer)</a><br />
|
124
|
+
<a href="classes/Mongrel/Command/Registry.html#M000040">run (Mongrel::Command::Registry)</a><br />
|
125
|
+
<a href="classes/Mongrel/Configurator.html#M000121">run (Mongrel::Configurator)</a><br />
|
126
|
+
<a href="classes/Mongrel/Configurator.html#M000125">run_config (Mongrel::Configurator)</a><br />
|
123
127
|
<a href="classes/Stats.html#M000007">sample (Stats)</a><br />
|
128
|
+
<a href="classes/ObjectTracker.html#M000014">sample (ObjectTracker)</a><br />
|
124
129
|
<a href="classes/Stats.html#M000011">sd (Stats)</a><br />
|
125
|
-
<a href="classes/Mongrel/HttpResponse.html#
|
126
|
-
<a href="classes/Mongrel/CGIWrapper.html#
|
127
|
-
<a href="classes/Mongrel/DirHandler.html#
|
128
|
-
<a href="classes/Mongrel/
|
129
|
-
<a href="classes/Mongrel/
|
130
|
-
<a href="classes/Mongrel/HttpResponse.html#
|
131
|
-
<a href="classes/Mongrel/HttpResponse.html#
|
132
|
-
<a href="classes/Mongrel/Rails/RailsConfigurator.html#
|
133
|
-
<a href="classes/Mongrel/Configurator.html#
|
134
|
-
<a href="classes/Mongrel/HttpResponse.html#
|
135
|
-
<a href="classes/Mongrel/
|
136
|
-
<a href="classes/Mongrel/
|
137
|
-
<a href="classes/Mongrel/CGIWrapper.html#
|
138
|
-
<a href="classes/Mongrel/CGIWrapper.html#
|
139
|
-
<a href="classes/Mongrel/CGIWrapper.html#
|
140
|
-
<a href="classes/Mongrel/
|
141
|
-
<a href="classes/Mongrel/
|
142
|
-
<a href="classes/Mongrel/StatusHandler.html#
|
130
|
+
<a href="classes/Mongrel/HttpResponse.html#M000083">send_body (Mongrel::HttpResponse)</a><br />
|
131
|
+
<a href="classes/Mongrel/CGIWrapper.html#M000100">send_cookies (Mongrel::CGIWrapper)</a><br />
|
132
|
+
<a href="classes/Mongrel/DirHandler.html#M000059">send_dir_listing (Mongrel::DirHandler)</a><br />
|
133
|
+
<a href="classes/Mongrel/DirHandler.html#M000060">send_file (Mongrel::DirHandler)</a><br />
|
134
|
+
<a href="classes/Mongrel/HttpResponse.html#M000084">send_file (Mongrel::HttpResponse)</a><br />
|
135
|
+
<a href="classes/Mongrel/HttpResponse.html#M000082">send_header (Mongrel::HttpResponse)</a><br />
|
136
|
+
<a href="classes/Mongrel/HttpResponse.html#M000081">send_status (Mongrel::HttpResponse)</a><br />
|
137
|
+
<a href="classes/Mongrel/Rails/RailsConfigurator.html#M000043">setup_rails_signals (Mongrel::Rails::RailsConfigurator)</a><br />
|
138
|
+
<a href="classes/Mongrel/Configurator.html#M000126">setup_signals (Mongrel::Configurator)</a><br />
|
139
|
+
<a href="classes/Mongrel/HttpResponse.html#M000085">socket_error (Mongrel::HttpResponse)</a><br />
|
140
|
+
<a href="classes/Mongrel/Camping.html#M000047">start (Mongrel::Camping)</a><br />
|
141
|
+
<a href="classes/Mongrel/HttpResponse.html#M000079">start (Mongrel::HttpResponse)</a><br />
|
142
|
+
<a href="classes/Mongrel/CGIWrapper.html#M000102">status (Mongrel::CGIWrapper)</a><br />
|
143
|
+
<a href="classes/Mongrel/CGIWrapper.html#M000105">stdinput (Mongrel::CGIWrapper)</a><br />
|
144
|
+
<a href="classes/Mongrel/CGIWrapper.html#M000106">stdoutput (Mongrel::CGIWrapper)</a><br />
|
145
|
+
<a href="classes/Mongrel/Configurator.html#M000122">stop (Mongrel::Configurator)</a><br />
|
146
|
+
<a href="classes/Mongrel/HttpServer.html#M000069">stop (Mongrel::HttpServer)</a><br />
|
147
|
+
<a href="classes/Mongrel/StatusHandler.html#M000073">table (Mongrel::StatusHandler)</a><br />
|
143
148
|
<a href="classes/Stats.html#M000012">tick (Stats)</a><br />
|
144
149
|
<a href="classes/Stats.html#M000009">to_s (Stats)</a><br />
|
145
150
|
<a href="classes/MongrelDbg.html#M000016">trace (MongrelDbg)</a><br />
|
146
151
|
<a href="classes/MongrelDbg.html#M000019">tracing? (MongrelDbg)</a><br />
|
147
|
-
<a href="classes/Mongrel/HttpRequest.html#
|
148
|
-
<a href="classes/Mongrel/URIClassifier.html#
|
149
|
-
<a href="classes/Mongrel/HttpServer.html#
|
150
|
-
<a href="classes/Mongrel/Configurator.html#
|
151
|
-
<a href="classes/Mongrel/URIClassifier.html#
|
152
|
-
<a href="classes/Mongrel/Command/Base.html#
|
153
|
-
<a href="classes/Mongrel/Command/Base.html#
|
154
|
-
<a href="classes/Mongrel/Command/Base.html#
|
155
|
-
<a href="classes/Mongrel/Command/Base.html#
|
156
|
-
<a href="classes/Mongrel/Command/Base.html#
|
157
|
-
<a href="classes/Mongrel/Command/Base.html#
|
158
|
-
<a href="classes/Mongrel/Command/Base.html#
|
159
|
-
<a href="classes/Mongrel/HttpResponse.html#
|
160
|
-
<a href="classes/Mongrel/Configurator.html#
|
152
|
+
<a href="classes/Mongrel/HttpRequest.html#M000137">unescape (Mongrel::HttpRequest)</a><br />
|
153
|
+
<a href="classes/Mongrel/URIClassifier.html#M000094">unregister (Mongrel::URIClassifier)</a><br />
|
154
|
+
<a href="classes/Mongrel/HttpServer.html#M000068">unregister (Mongrel::HttpServer)</a><br />
|
155
|
+
<a href="classes/Mongrel/Configurator.html#M000114">uri (Mongrel::Configurator)</a><br />
|
156
|
+
<a href="classes/Mongrel/URIClassifier.html#M000090">uris (Mongrel::URIClassifier)</a><br />
|
157
|
+
<a href="classes/Mongrel/Command/Base.html#M000031">valid? (Mongrel::Command::Base)</a><br />
|
158
|
+
<a href="classes/Mongrel/Command/Base.html#M000034">valid_dir? (Mongrel::Command::Base)</a><br />
|
159
|
+
<a href="classes/Mongrel/Command/Base.html#M000032">valid_exists? (Mongrel::Command::Base)</a><br />
|
160
|
+
<a href="classes/Mongrel/Command/Base.html#M000033">valid_file? (Mongrel::Command::Base)</a><br />
|
161
|
+
<a href="classes/Mongrel/Command/Base.html#M000036">valid_group? (Mongrel::Command::Base)</a><br />
|
162
|
+
<a href="classes/Mongrel/Command/Base.html#M000035">valid_user? (Mongrel::Command::Base)</a><br />
|
163
|
+
<a href="classes/Mongrel/Command/Base.html#M000028">validate (Mongrel::Command::Base)</a><br />
|
164
|
+
<a href="classes/Mongrel/HttpResponse.html#M000086">write (Mongrel::HttpResponse)</a><br />
|
165
|
+
<a href="classes/Mongrel/Configurator.html#M000109">write_pid_file (Mongrel::Configurator)</a><br />
|
161
166
|
</div>
|
162
167
|
</div>
|
163
168
|
</body>
|
data/examples/simpletest.rb
CHANGED
@@ -40,6 +40,8 @@ config = Mongrel::Configurator.new :host => ARGV[0], :port => ARGV[1] do
|
|
40
40
|
uri "/files", :handler => Mongrel::DirHandler.new(ARGV[2])
|
41
41
|
uri "/files", :handler => stats
|
42
42
|
uri "/status", :handler => Mongrel::StatusHandler.new(:stats_filter => stats)
|
43
|
+
redirect "/redir1", "/"
|
44
|
+
redirect "/to", /to/, 'w'
|
43
45
|
end
|
44
46
|
|
45
47
|
trap("INT") { stop }
|
data/ext/http11/http11.c
CHANGED
@@ -554,7 +554,7 @@ void Init_http11()
|
|
554
554
|
DEF_GLOBAL(server_protocol, "SERVER_PROTOCOL");
|
555
555
|
DEF_GLOBAL(server_protocol_value, "HTTP/1.1");
|
556
556
|
DEF_GLOBAL(http_host, "HTTP_HOST");
|
557
|
-
DEF_GLOBAL(mongrel_version, "Mongrel 0.3.13");
|
557
|
+
DEF_GLOBAL(mongrel_version, "Mongrel 0.3.13.1");
|
558
558
|
DEF_GLOBAL(server_software, "SERVER_SOFTWARE");
|
559
559
|
DEF_GLOBAL(port_80, "80");
|
560
560
|
|
data/lib/mongrel.rb
CHANGED
@@ -131,7 +131,7 @@ module Mongrel
|
|
131
131
|
# The original URI requested by the client. Passed to URIClassifier to build PATH_INFO and SCRIPT_NAME.
|
132
132
|
REQUEST_URI='REQUEST_URI'.freeze
|
133
133
|
|
134
|
-
MONGREL_VERSION="0.3.13".freeze
|
134
|
+
MONGREL_VERSION="0.3.13.1".freeze
|
135
135
|
|
136
136
|
# TODO: this use of a base for tempfiles needs to be looked at for security problems
|
137
137
|
MONGREL_TMP_BASE="mongrel".freeze
|
@@ -171,6 +171,7 @@ module Mongrel
|
|
171
171
|
HTTP_X_FORWARDED_FOR="HTTP_X_FORWARDED_FOR".freeze
|
172
172
|
HTTP_IF_UNMODIFIED_SINCE="HTTP_IF_UNMODIFIED_SINCE".freeze
|
173
173
|
HTTP_IF_NONE_MATCH="HTTP_IF_NONE_MATCH".freeze
|
174
|
+
REDIRECT = "HTTP/1.1 302 Found\r\nLocation: %s\r\nConnection: close\r\n\r\n".freeze
|
174
175
|
end
|
175
176
|
|
176
177
|
|
@@ -534,9 +535,15 @@ module Mongrel
|
|
534
535
|
params[Const::PATH_INFO] = path_info
|
535
536
|
params[Const::SCRIPT_NAME] = script_name
|
536
537
|
params[Const::REMOTE_ADDR] = params[Const::HTTP_X_FORWARDED_FOR] || client.peeraddr.last
|
538
|
+
data = data[nparsed ... data.length] || ""
|
539
|
+
|
540
|
+
if handlers[0].request_notify
|
541
|
+
# this first handler wants to be notified when the process starts
|
542
|
+
handlers[0].request_begins(params)
|
543
|
+
end
|
537
544
|
|
538
545
|
# TODO: Find a faster/better way to carve out the range, preferably without copying.
|
539
|
-
request = HttpRequest.new(params, data
|
546
|
+
request = HttpRequest.new(params, data, client)
|
540
547
|
|
541
548
|
# in the case of large file uploads the user could close the socket, so skip those requests
|
542
549
|
break if request.body == nil # nil signals from HttpRequest::initialize that the request was aborted
|
@@ -926,6 +933,16 @@ module Mongrel
|
|
926
933
|
GemPlugin::Manager.instance.create(name, ops)
|
927
934
|
end
|
928
935
|
|
936
|
+
# Let's you do redirects easily as described in Mongrel::RedirectHandler.
|
937
|
+
# You use it inside the configurator like this:
|
938
|
+
#
|
939
|
+
# redirect("/test", "/to/there") # simple
|
940
|
+
# redirect("/to", /t/, 'w') # regexp
|
941
|
+
# redirect("/hey", /(w+)/) {|match| ...} # block
|
942
|
+
#
|
943
|
+
def redirect(from, pattern, replacement = nil, &block)
|
944
|
+
uri from, :handler => Mongrel::RedirectHandler.new(pattern, replacement, &block)
|
945
|
+
end
|
929
946
|
|
930
947
|
# Works like a meta run method which goes through all the
|
931
948
|
# configured listeners. Use the Configurator.join method
|
@@ -968,13 +985,21 @@ module Mongrel
|
|
968
985
|
# found in Rails applications that are either slow or become unresponsive
|
969
986
|
# after a little while.
|
970
987
|
#
|
971
|
-
#
|
988
|
+
# You can pass an extra parameter *what* to indicate what you want to
|
989
|
+
# debug. For example, if you just want to dump rails stuff then do:
|
990
|
+
#
|
991
|
+
# debug "/", what = [:rails]
|
992
|
+
#
|
993
|
+
# And it will only produce the log/mongrel_debug/rails.log file.
|
994
|
+
# Available options are: :object, :railes, :files, :threads, :params
|
995
|
+
#
|
996
|
+
# NOTE: Use [:files] to get acccesses dumped to stderr like with WEBrick.
|
972
997
|
def debug(location, what = [:object, :rails, :files, :threads, :params])
|
973
998
|
require 'mongrel/debug'
|
974
999
|
handlers = {
|
975
|
-
:
|
1000
|
+
:files => "/handlers/requestlog::access",
|
976
1001
|
:rails => "/handlers/requestlog::files",
|
977
|
-
:
|
1002
|
+
:object => "/handlers/requestlog::objects",
|
978
1003
|
:threads => "/handlers/requestlog::threads",
|
979
1004
|
:params => "/handlers/requestlog::params"
|
980
1005
|
}
|
data/lib/mongrel/handlers.rb
CHANGED
@@ -31,11 +31,19 @@ module Mongrel
|
|
31
31
|
# should be implemented using the HttpHandlerPlugin mixin.
|
32
32
|
#
|
33
33
|
class HttpHandler
|
34
|
-
attr_reader :
|
34
|
+
attr_reader :request_notify
|
35
35
|
attr_accessor :listener
|
36
36
|
|
37
|
+
# This will be called by Mongrel on the *first* (index 0) handler *if* it has
|
38
|
+
# HttpHandler.request_notify set to *true*. You only get the parameters
|
39
|
+
# for the request, with the idea that you'd "bound" the beginning of the
|
40
|
+
# request processing and the first call to process.
|
41
|
+
def request_begins(params)
|
42
|
+
end
|
43
|
+
|
37
44
|
def process(request, response)
|
38
45
|
end
|
46
|
+
|
39
47
|
end
|
40
48
|
|
41
49
|
|
@@ -45,9 +53,12 @@ module Mongrel
|
|
45
53
|
# the process method later.
|
46
54
|
module HttpHandlerPlugin
|
47
55
|
attr_reader :options
|
48
|
-
attr_reader :
|
56
|
+
attr_reader :request_notify
|
49
57
|
attr_accessor :listener
|
50
58
|
|
59
|
+
def request_begins(params)
|
60
|
+
end
|
61
|
+
|
51
62
|
def initialize(options={})
|
52
63
|
@options = options
|
53
64
|
@header_only = false
|
@@ -398,4 +409,48 @@ module Mongrel
|
|
398
409
|
end
|
399
410
|
end
|
400
411
|
end
|
412
|
+
|
413
|
+
# This handler allows you to redirect one url to another.
|
414
|
+
# You can use it like String#gsub, where the string is the REQUEST_URI.
|
415
|
+
# REQUEST_URI is the full path with GET parameters.
|
416
|
+
#
|
417
|
+
# Eg. /test/something?help=true&disclaimer=false
|
418
|
+
#
|
419
|
+
# == Examples
|
420
|
+
#
|
421
|
+
# h = Mongrel::HttpServer.new('0.0.0.0')
|
422
|
+
# h.register '/test', Mongrel::RedirectHandler.new('/to/there') # simple
|
423
|
+
# h.register '/to', Mongrel::RedirectHandler.new(/t/, 'w') # regexp
|
424
|
+
# # and with a block
|
425
|
+
# h.register '/hey', Mongrel::RedirectHandler.new(/(\w+)/) { |match| ... }
|
426
|
+
#
|
427
|
+
class RedirectHandler < Mongrel::HttpHandler
|
428
|
+
# You set the rewrite rules when building the object.
|
429
|
+
#
|
430
|
+
# pattern => What to look for or replacement if used alone
|
431
|
+
#
|
432
|
+
# replacement, block => One of them is used to replace the found text
|
433
|
+
|
434
|
+
def initialize(pattern, replacement = nil, &block)
|
435
|
+
unless replacement or block
|
436
|
+
@replacement = pattern
|
437
|
+
else
|
438
|
+
@pattern, @replacement, @block = pattern, replacement, block
|
439
|
+
end
|
440
|
+
end
|
441
|
+
|
442
|
+
# Process the request and return a redirect response
|
443
|
+
def process(request, response)
|
444
|
+
unless @pattern
|
445
|
+
response.socket.write(Mongrel::Const::REDIRECT % @replacement)
|
446
|
+
else
|
447
|
+
if @block
|
448
|
+
new_path = request.params['REQUEST_URI'].gsub(@pattern, &@block)
|
449
|
+
else
|
450
|
+
new_path = request.params['REQUEST_URI'].gsub(@pattern, @replacement)
|
451
|
+
end
|
452
|
+
response.socket.write(Mongrel::Const::REDIRECT % new_path)
|
453
|
+
end
|
454
|
+
end
|
455
|
+
end
|
401
456
|
end
|