mongrel 0.3.13.1 → 0.3.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +3 -1
- data/doc/rdoc/classes/Mongrel.html +3 -2
- data/doc/rdoc/classes/Mongrel/CGIWrapper.html +49 -49
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000101.html +11 -14
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000102.html +34 -12
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000103.html +21 -5
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000104.html +14 -5
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000105.html +12 -5
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000106.html +5 -6
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000107.html +18 -0
- data/doc/rdoc/classes/Mongrel/{URIClassifier.src/M000090.html → CGIWrapper.src/M000108.html} +5 -5
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000109.html +19 -0
- data/doc/rdoc/classes/Mongrel/Camping.html +5 -5
- data/doc/rdoc/classes/Mongrel/Camping.src/{M000047.html → M000048.html} +0 -0
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.html +10 -10
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000049.html +5 -38
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000050.html +51 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.html +65 -65
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000026.html +11 -29
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000027.html +29 -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 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000031.html +5 -9
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000032.html +9 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000033.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000034.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000035.html +5 -11
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000036.html +11 -11
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000037.html +11 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000038.html +18 -0
- data/doc/rdoc/classes/Mongrel/Command/Registry.html +15 -15
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000039.html +7 -12
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000040.html +12 -37
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000041.html +50 -0
- data/doc/rdoc/classes/Mongrel/Configurator.html +120 -114
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000110.html +14 -7
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000111.html +18 -10
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000112.html +7 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000113.html +7 -21
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000114.html +10 -6
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000115.html +5 -17
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000116.html +25 -20
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000117.html +6 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000118.html +17 -11
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000119.html +20 -6
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000120.html +5 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000121.html +11 -9
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000122.html +6 -12
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000123.html +5 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000124.html +9 -22
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000125.html +12 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000126.html +5 -20
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000127.html +22 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000128.html +18 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000129.html +33 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000130.html +18 -0
- data/doc/rdoc/classes/Mongrel/Const.html +1 -1
- data/doc/rdoc/classes/Mongrel/DeflateFilter.html +10 -10
- data/doc/rdoc/classes/Mongrel/DeflateFilter.src/{M000096.html → M000099.html} +5 -5
- data/doc/rdoc/classes/Mongrel/DeflateFilter.src/{M000097.html → M000100.html} +14 -14
- data/doc/rdoc/classes/Mongrel/DirHandler.html +31 -31
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000058.html +8 -30
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000059.html +30 -29
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000060.html +29 -50
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000061.html +50 -26
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000062.html +26 -5
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000063.html +18 -0
- data/doc/rdoc/classes/Mongrel/Error404Handler.html +10 -10
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000128.html → M000131.html} +4 -4
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000129.html → M000132.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HeaderOut.html +10 -10
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000070.html → M000072.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000071.html → M000073.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HttpHandler.html +31 -10
- data/doc/rdoc/classes/Mongrel/HttpHandler.src/{M000076.html → M000078.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpHandler.src/M000079.html +17 -0
- data/doc/rdoc/classes/Mongrel/HttpHandler.src/{M000077.html → M000080.html} +3 -3
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.html +25 -10
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000022.html +3 -3
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000023.html +4 -6
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000024.html +6 -4
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000025.html +17 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.html +35 -35
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000051.html +5 -6
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000052.html +7 -7
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000053.html +7 -37
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000054.html +37 -5
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000055.html +5 -5
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000056.html +5 -6
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000050.html → M000057.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpRequest.html +30 -21
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000138.html +43 -19
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000136.html → M000139.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000137.html → M000140.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000141.html +32 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.html +61 -61
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000081.html +12 -9
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000082.html +7 -9
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000083.html +12 -9
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000084.html +9 -18
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000085.html +9 -8
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000086.html +9 -7
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000087.html +18 -7
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000088.html +8 -7
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000089.html +7 -5
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000090.html +20 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000091.html +20 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000092.html +18 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.html +63 -41
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000064.html +12 -76
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000065.html +74 -13
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000066.html +18 -50
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000067.html +8 -21
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000068.html +38 -5
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000069.html +21 -9
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000070.html +18 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000071.html +22 -0
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.html +15 -15
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000042.html +26 -12
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000043.html +12 -13
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000044.html +26 -0
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.html +15 -15
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000045.html +9 -38
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000046.html +38 -10
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000047.html +23 -0
- data/doc/rdoc/classes/Mongrel/RedirectHandler.html +10 -10
- data/doc/rdoc/classes/Mongrel/RedirectHandler.src/{M000133.html → M000136.html} +8 -8
- data/doc/rdoc/classes/Mongrel/RedirectHandler.src/{M000134.html → M000137.html} +13 -13
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.html +16 -16
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/{M000130.html → M000133.html} +10 -10
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/{M000131.html → M000134.html} +10 -10
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/{M000132.html → M000135.html} +4 -4
- data/doc/rdoc/classes/Mongrel/StatusHandler.html +20 -20
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000074.html +5 -29
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000075.html +11 -7
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000076.html +42 -0
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000077.html +20 -0
- data/doc/rdoc/classes/Mongrel/TimeoutError.html +117 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.html +30 -30
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000093.html +5 -38
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000094.html +5 -23
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000095.html +16 -60
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000096.html +51 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000097.html +36 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000098.html +83 -0
- data/doc/rdoc/classes/RequestLog/Access.html +5 -5
- data/doc/rdoc/classes/RequestLog/Access.src/{M000139.html → M000142.html} +0 -0
- data/doc/rdoc/classes/RequestLog/Files.html +5 -5
- data/doc/rdoc/classes/RequestLog/Files.src/{M000140.html → M000143.html} +0 -0
- data/doc/rdoc/classes/RequestLog/Objects.html +5 -5
- data/doc/rdoc/classes/RequestLog/Objects.src/{M000142.html → M000145.html} +0 -0
- data/doc/rdoc/classes/RequestLog/Params.html +5 -5
- data/doc/rdoc/classes/RequestLog/Params.src/{M000143.html → M000146.html} +0 -0
- data/doc/rdoc/classes/RequestLog/Threads.html +5 -5
- data/doc/rdoc/classes/RequestLog/Threads.src/{M000141.html → M000144.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/camping_rb.html +2 -2
- data/doc/rdoc/files/lib/mongrel/cgi_rb.html +2 -2
- data/doc/rdoc/files/lib/mongrel/command_rb.html +2 -2
- data/doc/rdoc/files/lib/mongrel/debug_rb.html +2 -2
- data/doc/rdoc/files/lib/mongrel/handlers_rb.html +1 -1
- data/doc/rdoc/files/lib/mongrel/init_rb.html +2 -2
- data/doc/rdoc/files/lib/mongrel/rails_rb.html +2 -2
- data/doc/rdoc/files/lib/mongrel/stats_rb.html +2 -2
- data/doc/rdoc/files/lib/mongrel/tcphack_rb.html +2 -2
- data/doc/rdoc/files/lib/mongrel_rb.html +2 -2
- data/doc/rdoc/fr_class_index.html +1 -0
- data/doc/rdoc/fr_method_index.html +125 -122
- data/ext/http11/http11.c +2 -2
- data/ext/http11/http11_parser.c +1 -1
- data/ext/http11/http11_parser.h +1 -1
- data/lib/mongrel.rb +70 -53
- data/lib/mongrel/camping.rb +1 -1
- data/lib/mongrel/cgi.rb +1 -1
- data/lib/mongrel/command.rb +1 -1
- data/lib/mongrel/debug.rb +1 -1
- data/lib/mongrel/handlers.rb +10 -1
- data/lib/mongrel/init.rb +1 -1
- data/lib/mongrel/rails.rb +1 -1
- data/lib/mongrel/stats.rb +1 -1
- data/lib/mongrel/tcphack.rb +1 -1
- data/test/test_command.rb +1 -1
- data/test/test_conditional.rb +1 -1
- data/test/test_configurator.rb +1 -1
- data/test/test_debug.rb +1 -1
- data/test/test_handlers.rb +1 -1
- data/test/test_http11.rb +1 -1
- data/test/test_response.rb +1 -1
- data/test/test_stats.rb +1 -1
- data/test/test_uriclassifier.rb +1 -1
- data/test/test_ws.rb +1 -1
- data/tools/trickletest.rb +28 -20
- metadata +50 -46
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000098.html +0 -24
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000099.html +0 -47
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000100.html +0 -34
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000048.html +0 -18
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000025.html +0 -24
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000038.html +0 -20
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000107.html +0 -29
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000108.html +0 -31
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000109.html +0 -20
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000057.html +0 -21
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000135.html +0 -52
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000078.html +0 -25
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000079.html +0 -20
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000080.html +0 -25
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000063.html +0 -25
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000041.html +0 -39
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000044.html +0 -22
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000072.html +0 -18
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000073.html +0 -24
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000091.html +0 -18
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000092.html +0 -39
|
@@ -90,12 +90,12 @@
|
|
|
90
90
|
<h3 class="section-bar">Methods</h3>
|
|
91
91
|
|
|
92
92
|
<div class="name-list">
|
|
93
|
-
<a href="#
|
|
94
|
-
<a href="#
|
|
95
|
-
<a href="#
|
|
96
|
-
<a href="#
|
|
97
|
-
<a href="#
|
|
98
|
-
<a href="#
|
|
93
|
+
<a href="#M000094">inspect</a>
|
|
94
|
+
<a href="#M000095">new</a>
|
|
95
|
+
<a href="#M000096">register</a>
|
|
96
|
+
<a href="#M000098">resolve</a>
|
|
97
|
+
<a href="#M000097">unregister</a>
|
|
98
|
+
<a href="#M000093">uris</a>
|
|
99
99
|
</div>
|
|
100
100
|
</div>
|
|
101
101
|
|
|
@@ -130,12 +130,12 @@
|
|
|
130
130
|
<div id="methods">
|
|
131
131
|
<h3 class="section-bar">Public Class methods</h3>
|
|
132
132
|
|
|
133
|
-
<div id="method-
|
|
134
|
-
<a name="
|
|
133
|
+
<div id="method-M000095" class="method-detail">
|
|
134
|
+
<a name="M000095"></a>
|
|
135
135
|
|
|
136
136
|
<div class="method-heading">
|
|
137
|
-
<a href="URIClassifier.src/
|
|
138
|
-
onclick="popupCode('URIClassifier.src/
|
|
137
|
+
<a href="URIClassifier.src/M000095.html" target="Code" class="method-signature"
|
|
138
|
+
onclick="popupCode('URIClassifier.src/M000095.html');return false;">
|
|
139
139
|
<span class="method-name">URIClassifier.new → URIClassifier<br />
|
|
140
140
|
</span>
|
|
141
141
|
</a>
|
|
@@ -162,12 +162,12 @@ portion.
|
|
|
162
162
|
|
|
163
163
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
164
164
|
|
|
165
|
-
<div id="method-
|
|
166
|
-
<a name="
|
|
165
|
+
<div id="method-M000094" class="method-detail">
|
|
166
|
+
<a name="M000094"></a>
|
|
167
167
|
|
|
168
168
|
<div class="method-heading">
|
|
169
|
-
<a href="URIClassifier.src/
|
|
170
|
-
onclick="popupCode('URIClassifier.src/
|
|
169
|
+
<a href="URIClassifier.src/M000094.html" target="Code" class="method-signature"
|
|
170
|
+
onclick="popupCode('URIClassifier.src/M000094.html');return false;">
|
|
171
171
|
<span class="method-name">inspect</span><span class="method-args">()</span>
|
|
172
172
|
</a>
|
|
173
173
|
</div>
|
|
@@ -179,12 +179,12 @@ Simply does an inspect that looks like a Hash inspect.
|
|
|
179
179
|
</div>
|
|
180
180
|
</div>
|
|
181
181
|
|
|
182
|
-
<div id="method-
|
|
183
|
-
<a name="
|
|
182
|
+
<div id="method-M000096" class="method-detail">
|
|
183
|
+
<a name="M000096"></a>
|
|
184
184
|
|
|
185
185
|
<div class="method-heading">
|
|
186
|
-
<a href="URIClassifier.src/
|
|
187
|
-
onclick="popupCode('URIClassifier.src/
|
|
186
|
+
<a href="URIClassifier.src/M000096.html" target="Code" class="method-signature"
|
|
187
|
+
onclick="popupCode('URIClassifier.src/M000096.html');return false;">
|
|
188
188
|
<span class="method-name">uc.register("/someuri", SampleHandler.new) → nil<br />
|
|
189
189
|
</span>
|
|
190
190
|
</a>
|
|
@@ -209,12 +209,12 @@ to get right with a Hash.
|
|
|
209
209
|
</div>
|
|
210
210
|
</div>
|
|
211
211
|
|
|
212
|
-
<div id="method-
|
|
213
|
-
<a name="
|
|
212
|
+
<div id="method-M000098" class="method-detail">
|
|
213
|
+
<a name="M000098"></a>
|
|
214
214
|
|
|
215
215
|
<div class="method-heading">
|
|
216
|
-
<a href="URIClassifier.src/
|
|
217
|
-
onclick="popupCode('URIClassifier.src/
|
|
216
|
+
<a href="URIClassifier.src/M000098.html" target="Code" class="method-signature"
|
|
217
|
+
onclick="popupCode('URIClassifier.src/M000098.html');return false;">
|
|
218
218
|
<span class="method-name">uc.resolve("/someuri") → "/someuri", "", handler<br />
|
|
219
219
|
uc.resolve("/someuri/pathinfo") → "/someuri", "/pathinfo", handler<br />
|
|
220
220
|
uc.resolve("/notfound/orhere") → nil, nil, nil<br />
|
|
@@ -261,12 +261,12 @@ Don‘t try other string-like stuff yet.
|
|
|
261
261
|
</div>
|
|
262
262
|
</div>
|
|
263
263
|
|
|
264
|
-
<div id="method-
|
|
265
|
-
<a name="
|
|
264
|
+
<div id="method-M000097" class="method-detail">
|
|
265
|
+
<a name="M000097"></a>
|
|
266
266
|
|
|
267
267
|
<div class="method-heading">
|
|
268
|
-
<a href="URIClassifier.src/
|
|
269
|
-
onclick="popupCode('URIClassifier.src/
|
|
268
|
+
<a href="URIClassifier.src/M000097.html" target="Code" class="method-signature"
|
|
269
|
+
onclick="popupCode('URIClassifier.src/M000097.html');return false;">
|
|
270
270
|
<span class="method-name">uc.unregister("/someuri")<br />
|
|
271
271
|
</span>
|
|
272
272
|
</a>
|
|
@@ -279,12 +279,12 @@ Yep, just removes this uri and it’s handler from the trie.
|
|
|
279
279
|
</div>
|
|
280
280
|
</div>
|
|
281
281
|
|
|
282
|
-
<div id="method-
|
|
283
|
-
<a name="
|
|
282
|
+
<div id="method-M000093" class="method-detail">
|
|
283
|
+
<a name="M000093"></a>
|
|
284
284
|
|
|
285
285
|
<div class="method-heading">
|
|
286
|
-
<a href="URIClassifier.src/
|
|
287
|
-
onclick="popupCode('URIClassifier.src/
|
|
286
|
+
<a href="URIClassifier.src/M000093.html" target="Code" class="method-signature"
|
|
287
|
+
onclick="popupCode('URIClassifier.src/M000093.html');return false;">
|
|
288
288
|
<span class="method-name">uris</span><span class="method-args">()</span>
|
|
289
289
|
</a>
|
|
290
290
|
</div>
|
|
@@ -5,47 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>uris (Mongrel::URIClassifier)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* Registers the SampleHandler (one for all requests) with the "/someuri".
|
|
18
|
-
* When URIClassifier::resolve is called with "/someuri" it'll return
|
|
19
|
-
* SampleHandler immediately. When called with "/someuri/iwant" it'll also
|
|
20
|
-
* return SomeHandler immediatly, with no additional searches, but it will
|
|
21
|
-
* return path info with "/iwant".
|
|
22
|
-
*
|
|
23
|
-
* You actually can reuse this class to register nearly anything and
|
|
24
|
-
* quickly resolve it. This could be used for caching, fast mapping, etc.
|
|
25
|
-
* The downside is it uses much more memory than a Hash, but it can be
|
|
26
|
-
* a lot faster. It's main advantage is that it works on prefixes, which
|
|
27
|
-
* is damn hard to get right with a Hash.
|
|
28
|
-
*/
|
|
29
|
-
VALUE URIClassifier_register(VALUE self, VALUE uri, VALUE handler)
|
|
30
|
-
{
|
|
31
|
-
int rc = 0;
|
|
32
|
-
void *ptr = NULL;
|
|
33
|
-
struct tst *tst = NULL;
|
|
34
|
-
DATA_GET(self, struct tst, tst);
|
|
35
|
-
|
|
36
|
-
rc = tst_insert((unsigned char *)StringValueCStr(uri), (void *)handler , tst, 0, &ptr);
|
|
37
|
-
|
|
38
|
-
if(rc == TST_DUPLICATE_KEY) {
|
|
39
|
-
rb_raise(rb_eStandardError, "Handler already registered with that name");
|
|
40
|
-
} else if(rc == TST_ERROR) {
|
|
41
|
-
rb_raise(rb_eStandardError, "Memory error registering handler");
|
|
42
|
-
} else if(rc == TST_NULL_KEY) {
|
|
43
|
-
rb_raise(rb_eStandardError, "URI was empty");
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
rb_hash_aset(rb_ivar_get(self, id_handler_map), uri, handler);
|
|
47
|
-
|
|
48
|
-
return Qnil;
|
|
49
|
-
}</pre>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 52</span>
|
|
14
|
+
52: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">uris</span>
|
|
15
|
+
53: <span class="ruby-ivar">@handler_map</span>.<span class="ruby-identifier">keys</span>
|
|
16
|
+
54: <span class="ruby-keyword kw">end</span></pre>
|
|
50
17
|
</body>
|
|
51
18
|
</html>
|
|
@@ -5,32 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>inspect (Mongrel::URIClassifier)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* Yep, just removes this uri and it's handler from the trie.
|
|
18
|
-
*/
|
|
19
|
-
VALUE URIClassifier_unregister(VALUE self, VALUE uri)
|
|
20
|
-
{
|
|
21
|
-
void *handler = NULL;
|
|
22
|
-
struct tst *tst = NULL;
|
|
23
|
-
DATA_GET(self, struct tst, tst);
|
|
24
|
-
|
|
25
|
-
handler = tst_delete((unsigned char *)StringValueCStr(uri), tst);
|
|
26
|
-
|
|
27
|
-
if(handler) {
|
|
28
|
-
rb_hash_delete(rb_ivar_get(self, id_handler_map), uri);
|
|
29
|
-
|
|
30
|
-
return (VALUE)handler;
|
|
31
|
-
} else {
|
|
32
|
-
return Qnil;
|
|
33
|
-
}
|
|
34
|
-
}</pre>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 57</span>
|
|
14
|
+
57: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inspect</span>
|
|
15
|
+
58: <span class="ruby-ivar">@handler_map</span>.<span class="ruby-identifier">inspect</span>
|
|
16
|
+
59: <span class="ruby-keyword kw">end</span></pre>
|
|
35
17
|
</body>
|
|
36
18
|
</html>
|
|
@@ -5,79 +5,35 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>new (Mongrel::URIClassifier)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
13
|
<pre>/**
|
|
14
14
|
* call-seq:
|
|
15
|
-
*
|
|
16
|
-
* uc.resolve("/someuri/pathinfo") -> "/someuri", "/pathinfo", handler
|
|
17
|
-
* uc.resolve("/notfound/orhere") -> nil, nil, nil
|
|
18
|
-
* uc.resolve("/") -> "/", "/", handler # if uc.register("/", handler)
|
|
19
|
-
* uc.resolve("/path/from/root") -> "/", "/path/from/root", handler # if uc.register("/", handler)
|
|
20
|
-
*
|
|
21
|
-
* Attempts to resolve either the whole URI or at the longest prefix, returning
|
|
22
|
-
* the prefix (as script_info), path (as path_info), and registered handler
|
|
23
|
-
* (usually an HttpHandler). If it doesn't find a handler registered at the longest
|
|
24
|
-
* match then it returns nil,nil,nil.
|
|
15
|
+
* URIClassifier.new -> URIClassifier
|
|
25
16
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* a search for "/something/like" would give you #1. A search for "/something/like/that/too"
|
|
30
|
-
* would give you #2.
|
|
31
|
-
*
|
|
32
|
-
* This is very powerful since it means you can also attach handlers to parts of the ;
|
|
33
|
-
* (semi-colon) separated path params, any part of the path, use off chars, anything really.
|
|
34
|
-
* It also means that it's very efficient to do this only taking as long as the URI has
|
|
35
|
-
* characters.
|
|
17
|
+
* Initializes a new URIClassifier object that you can use to associate URI sequences
|
|
18
|
+
* with objects. You can actually use it with any string sequence and any objects,
|
|
19
|
+
* but it's mostly used with URIs.
|
|
36
20
|
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
21
|
+
* It uses TST from http://www.octavian.org/cs/software.html to build an ternary search
|
|
22
|
+
* trie to hold all of the URIs. It uses this to do an initial search for the a URI
|
|
23
|
+
* prefix, and then to break the URI into SCRIPT_NAME and PATH_INFO portions. It actually
|
|
24
|
+
* will do two searches most of the time in order to find the right handler for the
|
|
25
|
+
* registered prefix portion.
|
|
42
26
|
*
|
|
43
|
-
* It expects strings with no embedded '\0' characters. Don't try other string-like stuff yet.
|
|
44
27
|
*/
|
|
45
|
-
VALUE
|
|
28
|
+
VALUE URIClassifier_init(VALUE self)
|
|
46
29
|
{
|
|
47
|
-
|
|
48
|
-
int pref_len = 0;
|
|
49
|
-
struct tst *tst = NULL;
|
|
50
|
-
VALUE result;
|
|
51
|
-
unsigned char *uri_str = NULL;
|
|
30
|
+
VALUE hash;
|
|
52
31
|
|
|
53
|
-
|
|
54
|
-
|
|
32
|
+
// we create an internal hash to protect stuff from the GC
|
|
33
|
+
hash = rb_hash_new();
|
|
34
|
+
rb_ivar_set(self, id_handler_map, hash);
|
|
55
35
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
// setup for multiple return values
|
|
59
|
-
result = rb_ary_new();
|
|
60
|
-
|
|
61
|
-
if(handler) {
|
|
62
|
-
rb_ary_push(result, rb_str_substr (uri, 0, pref_len));
|
|
63
|
-
// compensate for a script_name="/" where we need to add the "/" to path_info to keep it consistent
|
|
64
|
-
if(pref_len == 1 && uri_str[0] == '/') {
|
|
65
|
-
// matches the root URI so we have to use the whole URI as the path_info
|
|
66
|
-
rb_ary_push(result, uri);
|
|
67
|
-
} else {
|
|
68
|
-
// matches a script so process like normal
|
|
69
|
-
rb_ary_push(result, rb_str_substr(uri, pref_len, RSTRING(uri)->len));
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
rb_ary_push(result, (VALUE)handler);
|
|
73
|
-
} else {
|
|
74
|
-
// not found so push back nothing
|
|
75
|
-
rb_ary_push(result, Qnil);
|
|
76
|
-
rb_ary_push(result, Qnil);
|
|
77
|
-
rb_ary_push(result, Qnil);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return result;
|
|
36
|
+
return self;
|
|
81
37
|
}</pre>
|
|
82
38
|
</body>
|
|
83
39
|
</html>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html>
|
|
7
|
+
<head>
|
|
8
|
+
<title>register (Mongrel::URIClassifier)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre>/**
|
|
14
|
+
* call-seq:
|
|
15
|
+
* uc.register("/someuri", SampleHandler.new) -> nil
|
|
16
|
+
*
|
|
17
|
+
* Registers the SampleHandler (one for all requests) with the "/someuri".
|
|
18
|
+
* When URIClassifier::resolve is called with "/someuri" it'll return
|
|
19
|
+
* SampleHandler immediately. When called with "/someuri/iwant" it'll also
|
|
20
|
+
* return SomeHandler immediatly, with no additional searches, but it will
|
|
21
|
+
* return path info with "/iwant".
|
|
22
|
+
*
|
|
23
|
+
* You actually can reuse this class to register nearly anything and
|
|
24
|
+
* quickly resolve it. This could be used for caching, fast mapping, etc.
|
|
25
|
+
* The downside is it uses much more memory than a Hash, but it can be
|
|
26
|
+
* a lot faster. It's main advantage is that it works on prefixes, which
|
|
27
|
+
* is damn hard to get right with a Hash.
|
|
28
|
+
*/
|
|
29
|
+
VALUE URIClassifier_register(VALUE self, VALUE uri, VALUE handler)
|
|
30
|
+
{
|
|
31
|
+
int rc = 0;
|
|
32
|
+
void *ptr = NULL;
|
|
33
|
+
struct tst *tst = NULL;
|
|
34
|
+
DATA_GET(self, struct tst, tst);
|
|
35
|
+
|
|
36
|
+
rc = tst_insert((unsigned char *)StringValueCStr(uri), (void *)handler , tst, 0, &ptr);
|
|
37
|
+
|
|
38
|
+
if(rc == TST_DUPLICATE_KEY) {
|
|
39
|
+
rb_raise(rb_eStandardError, "Handler already registered with that name");
|
|
40
|
+
} else if(rc == TST_ERROR) {
|
|
41
|
+
rb_raise(rb_eStandardError, "Memory error registering handler");
|
|
42
|
+
} else if(rc == TST_NULL_KEY) {
|
|
43
|
+
rb_raise(rb_eStandardError, "URI was empty");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
rb_hash_aset(rb_ivar_get(self, id_handler_map), uri, handler);
|
|
47
|
+
|
|
48
|
+
return Qnil;
|
|
49
|
+
}</pre>
|
|
50
|
+
</body>
|
|
51
|
+
</html>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html>
|
|
7
|
+
<head>
|
|
8
|
+
<title>unregister (Mongrel::URIClassifier)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre>/**
|
|
14
|
+
* call-seq:
|
|
15
|
+
* uc.unregister("/someuri")
|
|
16
|
+
*
|
|
17
|
+
* Yep, just removes this uri and it's handler from the trie.
|
|
18
|
+
*/
|
|
19
|
+
VALUE URIClassifier_unregister(VALUE self, VALUE uri)
|
|
20
|
+
{
|
|
21
|
+
void *handler = NULL;
|
|
22
|
+
struct tst *tst = NULL;
|
|
23
|
+
DATA_GET(self, struct tst, tst);
|
|
24
|
+
|
|
25
|
+
handler = tst_delete((unsigned char *)StringValueCStr(uri), tst);
|
|
26
|
+
|
|
27
|
+
if(handler) {
|
|
28
|
+
rb_hash_delete(rb_ivar_get(self, id_handler_map), uri);
|
|
29
|
+
|
|
30
|
+
return (VALUE)handler;
|
|
31
|
+
} else {
|
|
32
|
+
return Qnil;
|
|
33
|
+
}
|
|
34
|
+
}</pre>
|
|
35
|
+
</body>
|
|
36
|
+
</html>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html>
|
|
7
|
+
<head>
|
|
8
|
+
<title>resolve (Mongrel::URIClassifier)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre>/**
|
|
14
|
+
* call-seq:
|
|
15
|
+
* uc.resolve("/someuri") -> "/someuri", "", handler
|
|
16
|
+
* uc.resolve("/someuri/pathinfo") -> "/someuri", "/pathinfo", handler
|
|
17
|
+
* uc.resolve("/notfound/orhere") -> nil, nil, nil
|
|
18
|
+
* uc.resolve("/") -> "/", "/", handler # if uc.register("/", handler)
|
|
19
|
+
* uc.resolve("/path/from/root") -> "/", "/path/from/root", handler # if uc.register("/", handler)
|
|
20
|
+
*
|
|
21
|
+
* Attempts to resolve either the whole URI or at the longest prefix, returning
|
|
22
|
+
* the prefix (as script_info), path (as path_info), and registered handler
|
|
23
|
+
* (usually an HttpHandler). If it doesn't find a handler registered at the longest
|
|
24
|
+
* match then it returns nil,nil,nil.
|
|
25
|
+
*
|
|
26
|
+
* Because the resolver uses a trie you are able to register a handler at *any* character
|
|
27
|
+
* in the URI and it will be handled as long as it's the longest prefix. So, if you
|
|
28
|
+
* registered handler #1 at "/something/lik", and #2 at "/something/like/that", then a
|
|
29
|
+
* a search for "/something/like" would give you #1. A search for "/something/like/that/too"
|
|
30
|
+
* would give you #2.
|
|
31
|
+
*
|
|
32
|
+
* This is very powerful since it means you can also attach handlers to parts of the ;
|
|
33
|
+
* (semi-colon) separated path params, any part of the path, use off chars, anything really.
|
|
34
|
+
* It also means that it's very efficient to do this only taking as long as the URI has
|
|
35
|
+
* characters.
|
|
36
|
+
*
|
|
37
|
+
* A slight modification to the CGI 1.2 standard is given for handlers registered to "/".
|
|
38
|
+
* CGI expects all CGI scripts to be at some script path, so it doesn't really say anything
|
|
39
|
+
* about a script that handles the root. To make this work, the resolver will detect that
|
|
40
|
+
* the requested handler is at "/", and return that for script_name, and then simply return
|
|
41
|
+
* the full URI back as path_info.
|
|
42
|
+
*
|
|
43
|
+
* It expects strings with no embedded '\0' characters. Don't try other string-like stuff yet.
|
|
44
|
+
*/
|
|
45
|
+
VALUE URIClassifier_resolve(VALUE self, VALUE uri)
|
|
46
|
+
{
|
|
47
|
+
void *handler = NULL;
|
|
48
|
+
int pref_len = 0;
|
|
49
|
+
struct tst *tst = NULL;
|
|
50
|
+
VALUE result;
|
|
51
|
+
unsigned char *uri_str = NULL;
|
|
52
|
+
|
|
53
|
+
DATA_GET(self, struct tst, tst);
|
|
54
|
+
uri_str = (unsigned char *)StringValueCStr(uri);
|
|
55
|
+
|
|
56
|
+
handler = tst_search(uri_str, tst, &pref_len);
|
|
57
|
+
|
|
58
|
+
// setup for multiple return values
|
|
59
|
+
result = rb_ary_new();
|
|
60
|
+
|
|
61
|
+
if(handler) {
|
|
62
|
+
rb_ary_push(result, rb_str_substr (uri, 0, pref_len));
|
|
63
|
+
// compensate for a script_name="/" where we need to add the "/" to path_info to keep it consistent
|
|
64
|
+
if(pref_len == 1 && uri_str[0] == '/') {
|
|
65
|
+
// matches the root URI so we have to use the whole URI as the path_info
|
|
66
|
+
rb_ary_push(result, uri);
|
|
67
|
+
} else {
|
|
68
|
+
// matches a script so process like normal
|
|
69
|
+
rb_ary_push(result, rb_str_substr(uri, pref_len, RSTRING(uri)->len));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
rb_ary_push(result, (VALUE)handler);
|
|
73
|
+
} else {
|
|
74
|
+
// not found so push back nothing
|
|
75
|
+
rb_ary_push(result, Qnil);
|
|
76
|
+
rb_ary_push(result, Qnil);
|
|
77
|
+
rb_ary_push(result, Qnil);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return result;
|
|
81
|
+
}</pre>
|
|
82
|
+
</body>
|
|
83
|
+
</html>
|