mongrel 0.3.13.4 → 1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -75
- data/Rakefile +14 -14
- data/bin/mongrel_rails +35 -23
- data/doc/rdoc/classes/IO.html +12 -12
- data/doc/rdoc/classes/IO.src/{M000001.html → M000003.html} +0 -0
- data/doc/rdoc/classes/IO.src/{M000002.html → M000004.html} +0 -0
- data/doc/rdoc/classes/Kernel.html +11 -11
- data/doc/rdoc/classes/Kernel.src/{M000010.html → M000012.html} +0 -0
- data/doc/rdoc/classes/Kernel.src/{M000011.html → M000013.html} +0 -0
- data/doc/rdoc/classes/Mongrel.html +3 -3
- data/doc/rdoc/classes/Mongrel/CGIWrapper.html +77 -69
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000115.html +12 -19
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000116.html +34 -12
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000117.html +21 -5
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000118.html +19 -5
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000119.html +12 -5
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000120.html +5 -6
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000121.html +18 -0
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000122.html +18 -0
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000123.html +19 -0
- data/doc/rdoc/classes/Mongrel/Camping.html +8 -8
- data/doc/rdoc/classes/Mongrel/Camping.src/M000041.html +22 -0
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.html +31 -12
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000042.html +20 -0
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000043.html +58 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.html +75 -73
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000018.html +11 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000019.html +29 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000020.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000021.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000022.html +5 -9
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000023.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000024.html +9 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000025.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000026.html +5 -11
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000027.html +5 -11
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000028.html +11 -5
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000029.html +24 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000030.html +18 -0
- data/doc/rdoc/classes/Mongrel/Command/Registry.html +20 -20
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000031.html +7 -45
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/{M000030.html → M000032.html} +0 -0
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000033.html +58 -0
- data/doc/rdoc/classes/Mongrel/Configurator.html +163 -140
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000093.html +14 -8
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000094.html +18 -7
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000095.html +5 -10
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000096.html +8 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000097.html +7 -25
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000098.html +10 -6
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000099.html +5 -26
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000100.html +25 -20
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000101.html +6 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000102.html +26 -11
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000103.html +20 -6
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000104.html +5 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000105.html +11 -9
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000106.html +6 -9
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000107.html +5 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000108.html +9 -21
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000109.html +9 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000110.html +5 -23
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000111.html +21 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000112.html +18 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000113.html +36 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000114.html +18 -0
- data/doc/rdoc/classes/Mongrel/Const.html +8 -9
- data/doc/rdoc/classes/Mongrel/DeflateFilter.html +19 -12
- data/doc/rdoc/classes/Mongrel/DeflateFilter.src/{M000121.html → M000124.html} +5 -5
- data/doc/rdoc/classes/Mongrel/DeflateFilter.src/{M000122.html → M000125.html} +9 -14
- data/doc/rdoc/classes/Mongrel/DirHandler.html +43 -43
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000051.html +8 -25
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000052.html +29 -50
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000053.html +25 -26
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000054.html +52 -5
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000055.html +39 -0
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000056.html +18 -0
- data/doc/rdoc/classes/Mongrel/Error404Handler.html +11 -11
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000123.html → M000126.html} +4 -4
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000124.html → M000127.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HeaderOut.html +15 -10
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000066.html +21 -0
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000067.html +21 -0
- data/doc/rdoc/classes/Mongrel/HttpHandler.html +25 -23
- data/doc/rdoc/classes/Mongrel/HttpHandler.src/M000072.html +4 -4
- data/doc/rdoc/classes/Mongrel/HttpHandler.src/{M000071.html → M000073.html} +3 -3
- data/doc/rdoc/classes/Mongrel/{HttpHandlerPlugin.src/M000012.html → HttpHandler.src/M000074.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.html +22 -21
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000014.html +4 -6
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000015.html +4 -4
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000016.html +19 -0
- data/doc/rdoc/classes/Mongrel/{HttpHandler.src/M000070.html → HttpHandlerPlugin.src/M000017.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HttpParser.html +44 -42
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000044.html +6 -7
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000045.html +7 -37
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000046.html +7 -5
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000047.html +37 -5
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000048.html +5 -6
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000042.html → M000049.html} +5 -6
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000043.html → M000050.html} +6 -7
- data/doc/rdoc/classes/Mongrel/HttpRequest.html +37 -40
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000133.html +37 -7
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000134.html +28 -7
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000135.html +16 -19
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000136.html +20 -0
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000137.html +20 -0
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000138.html +32 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.html +95 -85
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000075.html +12 -13
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000076.html +7 -9
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000077.html +13 -9
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000078.html +9 -9
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000079.html +9 -18
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000080.html +9 -8
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000081.html +18 -7
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000082.html +8 -7
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000083.html +7 -7
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000084.html +7 -5
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000085.html +20 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000086.html +18 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.html +59 -63
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000057.html +12 -19
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000058.html +87 -8
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000059.html +19 -9
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000060.html +8 -49
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000061.html +16 -21
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000062.html +52 -5
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000063.html +21 -9
- data/doc/rdoc/classes/Mongrel/{HeaderOut.src → HttpServer.src}/M000064.html +5 -5
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000065.html +22 -0
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.html +27 -25
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000034.html +24 -13
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/{M000033.html → M000035.html} +11 -11
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000036.html +26 -0
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.html +24 -26
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000037.html +10 -8
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000038.html +43 -12
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000039.html +20 -0
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000040.html +25 -0
- data/doc/rdoc/classes/Mongrel/RedirectHandler.html +10 -10
- data/doc/rdoc/classes/Mongrel/RedirectHandler.src/{M000128.html → M000131.html} +8 -8
- data/doc/rdoc/classes/Mongrel/RedirectHandler.src/{M000129.html → M000132.html} +13 -13
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.html +20 -20
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/{M000125.html → M000128.html} +10 -10
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/{M000126.html → M000129.html} +10 -10
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/{M000127.html → M000130.html} +4 -4
- data/doc/rdoc/classes/Mongrel/Stats.html +43 -42
- data/doc/rdoc/classes/Mongrel/Stats.src/M000139.html +6 -5
- data/doc/rdoc/classes/Mongrel/Stats.src/M000140.html +10 -5
- data/doc/rdoc/classes/Mongrel/Stats.src/M000141.html +13 -5
- data/doc/rdoc/classes/Mongrel/Stats.src/M000142.html +5 -10
- data/doc/rdoc/classes/Mongrel/Stats.src/M000143.html +5 -7
- data/doc/rdoc/classes/Mongrel/Stats.src/{M000136.html → M000144.html} +5 -6
- data/doc/rdoc/classes/Mongrel/Stats.src/M000145.html +23 -0
- data/doc/rdoc/classes/Mongrel/Stats.src/M000146.html +20 -0
- data/doc/rdoc/classes/Mongrel/StatusHandler.html +21 -21
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000068.html +5 -29
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000069.html +11 -7
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000070.html +42 -0
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000071.html +20 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.html +58 -55
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000087.html +5 -26
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000088.html +5 -38
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000089.html +18 -15
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000090.html +25 -57
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000091.html +36 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000092.html +83 -0
- data/doc/rdoc/classes/MongrelDbg.html +25 -25
- data/doc/rdoc/classes/MongrelDbg.src/M000007.html +11 -9
- data/doc/rdoc/classes/MongrelDbg.src/M000008.html +7 -8
- data/doc/rdoc/classes/MongrelDbg.src/M000009.html +9 -5
- data/doc/rdoc/classes/MongrelDbg.src/M000010.html +21 -0
- data/doc/rdoc/classes/MongrelDbg.src/M000011.html +18 -0
- data/doc/rdoc/classes/{Sync.html → Mutex.html} +50 -19
- data/doc/rdoc/classes/Mutex.src/M000001.html +24 -0
- data/doc/rdoc/classes/Mutex.src/M000002.html +32 -0
- data/doc/rdoc/classes/RequestLog/Access.html +5 -5
- data/doc/rdoc/classes/RequestLog/Access.src/{M000144.html → M000147.html} +0 -0
- data/doc/rdoc/classes/RequestLog/Files.html +5 -5
- data/doc/rdoc/classes/RequestLog/Files.src/{M000145.html → M000148.html} +0 -0
- data/doc/rdoc/classes/RequestLog/Objects.html +5 -5
- data/doc/rdoc/classes/RequestLog/Objects.src/{M000147.html → M000150.html} +0 -0
- data/doc/rdoc/classes/RequestLog/Params.html +5 -5
- data/doc/rdoc/classes/RequestLog/Params.src/{M000148.html → M000151.html} +0 -0
- data/doc/rdoc/classes/RequestLog/Threads.html +5 -5
- data/doc/rdoc/classes/RequestLog/Threads.src/{M000146.html → M000149.html} +0 -0
- data/doc/rdoc/classes/TCPServer.html +10 -10
- data/doc/rdoc/classes/TCPServer.src/{M000003.html → M000005.html} +0 -0
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/COPYING.html +1 -1
- data/doc/rdoc/files/LICENSE.html +1 -1
- data/doc/rdoc/files/README.html +11 -100
- 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/configurator_rb.html +1 -1
- data/doc/rdoc/files/lib/mongrel/debug_rb.html +2 -2
- data/doc/rdoc/files/lib/mongrel/handlers_rb.html +3 -2
- data/doc/rdoc/files/lib/mongrel/init_rb.html +2 -2
- data/doc/rdoc/files/lib/mongrel/rails_rb.html +2 -3
- 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 +5 -3
- data/doc/rdoc/files/lib/mutex_fix_rb.html +108 -0
- data/doc/rdoc/fr_class_index.html +1 -1
- data/doc/rdoc/fr_file_index.html +1 -0
- data/doc/rdoc/fr_method_index.html +151 -148
- data/ext/http11/http11.c +2 -2
- data/lib/mongrel.rb +85 -38
- data/lib/mongrel/camping.rb +17 -4
- data/lib/mongrel/configurator.rb +11 -7
- data/lib/mongrel/handlers.rb +30 -27
- data/lib/mongrel/mime_types.yml +615 -0
- data/lib/mongrel/rails.rb +21 -28
- data/lib/mutex_fix.rb +34 -0
- data/test/test_handlers.rb +16 -4
- data/test/test_http11.rb +8 -0
- data/test/test_request_progress.rb +45 -2
- data/test/test_response.rb +31 -0
- metadata +95 -71
- data/bin/mongrel_rails_service +0 -246
- data/bin/mongrel_rails_svc +0 -307
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000112.html +0 -25
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000113.html +0 -47
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000114.html +0 -34
- data/doc/rdoc/classes/Mongrel/Camping.src/M000039.html +0 -22
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000040.html +0 -18
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000041.html +0 -51
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000016.html +0 -24
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000017.html +0 -42
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000029.html +0 -20
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000091.html +0 -27
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000092.html +0 -31
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000049.html +0 -21
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000050.html +0 -43
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000065.html +0 -18
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000013.html +0 -17
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000130.html +0 -47
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000131.html +0 -37
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000132.html +0 -29
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000073.html +0 -25
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000074.html +0 -20
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000055.html +0 -25
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000056.html +0 -91
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000032.html +0 -37
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000035.html +0 -23
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000036.html +0 -54
- data/doc/rdoc/classes/Mongrel/Stats.src/M000137.html +0 -23
- data/doc/rdoc/classes/Mongrel/Stats.src/M000138.html +0 -26
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000066.html +0 -18
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000067.html +0 -24
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000085.html +0 -18
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000086.html +0 -18
- data/doc/rdoc/classes/MongrelDbg.src/M000005.html +0 -24
- data/doc/rdoc/classes/MongrelDbg.src/M000006.html +0 -20
@@ -5,34 +5,17 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>new (Mongrel::DirHandler)</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> <span class="ruby-comment cmt"># File lib/mongrel/handlers.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
172: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">200</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
|
21
|
-
173: <span class="ruby-identifier">head</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">CONTENT_TYPE</span>] = <span class="ruby-value str">"text/html"</span>
|
22
|
-
174: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"<html><head><title>Directory Listing</title></head><body>"</span>
|
23
|
-
175: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">entries</span>(<span class="ruby-identifier">dir</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">child</span><span class="ruby-operator">|</span>
|
24
|
-
176: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">child</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"."</span>
|
25
|
-
177: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"<a href=\"#{base}/#{ HttpRequest.escape(child)}\">"</span>
|
26
|
-
178: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> (<span class="ruby-identifier">child</span> <span class="ruby-operator">==</span> <span class="ruby-value str">".."</span> <span class="ruby-operator">?</span> <span class="ruby-value str">"Up to parent.."</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">child</span>)
|
27
|
-
179: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"</a><br/>"</span>
|
28
|
-
180: <span class="ruby-keyword kw">end</span>
|
29
|
-
181: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"</body></html>"</span>
|
30
|
-
182: <span class="ruby-keyword kw">end</span>
|
31
|
-
183: <span class="ruby-keyword kw">else</span>
|
32
|
-
184: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">403</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
|
33
|
-
185: <span class="ruby-identifier">out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">"Directory listings not allowed"</span>)
|
34
|
-
186: <span class="ruby-keyword kw">end</span>
|
35
|
-
187: <span class="ruby-keyword kw">end</span>
|
36
|
-
188: <span class="ruby-keyword kw">end</span></pre>
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel/handlers.rb, line 114</span>
|
14
|
+
114: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">listing_allowed</span>=<span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">index_html</span>=<span class="ruby-value str">"index.html"</span>)
|
15
|
+
115: <span class="ruby-ivar">@path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">path</span>)
|
16
|
+
116: <span class="ruby-ivar">@listing_allowed</span>=<span class="ruby-identifier">listing_allowed</span>
|
17
|
+
117: <span class="ruby-ivar">@index_html</span> = <span class="ruby-identifier">index_html</span>
|
18
|
+
118: <span class="ruby-ivar">@default_content_type</span> = <span class="ruby-value str">"application/octet-stream"</span>.<span class="ruby-identifier">freeze</span>
|
19
|
+
119: <span class="ruby-keyword kw">end</span></pre>
|
37
20
|
</body>
|
38
21
|
</html>
|
@@ -5,59 +5,38 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>can_serve (Mongrel::DirHandler)</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> <span class="ruby-comment cmt"># File lib/mongrel/handlers.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
220: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">304</span>) {}
|
42
|
-
221: <span class="ruby-keyword kw">else</span>
|
43
|
-
222: <span class="ruby-comment cmt"># first we setup the headers and status then we do a very fast send on the socket directly</span>
|
44
|
-
223: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">status</span> = <span class="ruby-value">200</span>
|
45
|
-
224: <span class="ruby-identifier">header</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">LAST_MODIFIED</span>] = <span class="ruby-identifier">mtime</span>.<span class="ruby-identifier">httpdate</span>
|
46
|
-
225:
|
47
|
-
226: <span class="ruby-comment cmt"># set the mime type from our map based on the ending</span>
|
48
|
-
227: <span class="ruby-identifier">dot_at</span> = <span class="ruby-identifier">req_path</span>.<span class="ruby-identifier">rindex</span>(<span class="ruby-value str">'.'</span>)
|
49
|
-
228: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">dot_at</span>
|
50
|
-
229: <span class="ruby-identifier">header</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">CONTENT_TYPE</span>] = <span class="ruby-constant">MIME_TYPES</span>[<span class="ruby-identifier">req_path</span>[<span class="ruby-identifier">dot_at</span> <span class="ruby-operator">..</span> <span class="ruby-value">-1</span>]] <span class="ruby-operator">||</span> <span class="ruby-ivar">@default_content_type</span>
|
51
|
-
230: <span class="ruby-keyword kw">end</span>
|
52
|
-
231:
|
53
|
-
232: <span class="ruby-comment cmt"># send a status with out content length</span>
|
54
|
-
233: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">send_status</span>(<span class="ruby-identifier">stat</span>.<span class="ruby-identifier">size</span>)
|
55
|
-
234: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">send_header</span>
|
56
|
-
235:
|
57
|
-
236: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">header_only</span>
|
58
|
-
237: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">send_file</span>(<span class="ruby-identifier">req_path</span>, <span class="ruby-identifier">stat</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator"><</span> <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">CHUNK_SIZE</span> <span class="ruby-operator">*</span> <span class="ruby-value">2</span>)
|
59
|
-
238: <span class="ruby-keyword kw">end</span>
|
60
|
-
239: <span class="ruby-keyword kw">end</span>
|
61
|
-
240: <span class="ruby-keyword kw">end</span></pre>
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel/handlers.rb, line 122</span>
|
14
|
+
122: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">can_serve</span>(<span class="ruby-identifier">path_info</span>)
|
15
|
+
123: <span class="ruby-identifier">req_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@path</span>,<span class="ruby-constant">HttpRequest</span>.<span class="ruby-identifier">unescape</span>(<span class="ruby-identifier">path_info</span>)), <span class="ruby-ivar">@path</span>)
|
16
|
+
124:
|
17
|
+
125: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">req_path</span>.<span class="ruby-identifier">index</span>(<span class="ruby-ivar">@path</span>) <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">and</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span> <span class="ruby-identifier">req_path</span>
|
18
|
+
126: <span class="ruby-comment cmt"># it exists and it's in the right location</span>
|
19
|
+
127: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span> <span class="ruby-identifier">req_path</span>
|
20
|
+
128: <span class="ruby-comment cmt"># the request is for a directory</span>
|
21
|
+
129: <span class="ruby-identifier">index</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">req_path</span>, <span class="ruby-ivar">@index_html</span>)
|
22
|
+
130: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span> <span class="ruby-identifier">index</span>
|
23
|
+
131: <span class="ruby-comment cmt"># serve the index</span>
|
24
|
+
132: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">index</span>
|
25
|
+
133: <span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@listing_allowed</span>
|
26
|
+
134: <span class="ruby-comment cmt"># serve the directory</span>
|
27
|
+
135: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">req_path</span>
|
28
|
+
136: <span class="ruby-keyword kw">else</span>
|
29
|
+
137: <span class="ruby-comment cmt"># do not serve anything</span>
|
30
|
+
138: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
31
|
+
139: <span class="ruby-keyword kw">end</span>
|
32
|
+
140: <span class="ruby-keyword kw">else</span>
|
33
|
+
141: <span class="ruby-comment cmt"># it's a file and it's there</span>
|
34
|
+
142: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">req_path</span>
|
35
|
+
143: <span class="ruby-keyword kw">end</span>
|
36
|
+
144: <span class="ruby-keyword kw">else</span>
|
37
|
+
145: <span class="ruby-comment cmt"># does not exist or isn't in the right spot</span>
|
38
|
+
146: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
39
|
+
147: <span class="ruby-keyword kw">end</span>
|
40
|
+
148: <span class="ruby-keyword kw">end</span></pre>
|
62
41
|
</body>
|
63
42
|
</html>
|
@@ -5,35 +5,34 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>send_dir_listing (Mongrel::DirHandler)</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> <span class="ruby-comment cmt"># File lib/mongrel/handlers.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
267: <span class="ruby-keyword kw">end</span></pre>
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel/handlers.rb, line 155</span>
|
14
|
+
155: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_dir_listing</span>(<span class="ruby-identifier">base</span>, <span class="ruby-identifier">dir</span>, <span class="ruby-identifier">response</span>)
|
15
|
+
156: <span class="ruby-comment cmt"># take off any trailing / so the links come out right</span>
|
16
|
+
157: <span class="ruby-identifier">base</span> = <span class="ruby-constant">HttpRequest</span>.<span class="ruby-identifier">unescape</span>(<span class="ruby-identifier">base</span>)
|
17
|
+
158: <span class="ruby-identifier">base</span>.<span class="ruby-identifier">chop!</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">base</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">"/"</span>[<span class="ruby-value">-1</span>]
|
18
|
+
159:
|
19
|
+
160: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@listing_allowed</span>
|
20
|
+
161: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">200</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
|
21
|
+
162: <span class="ruby-identifier">head</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">CONTENT_TYPE</span>] = <span class="ruby-value str">"text/html"</span>
|
22
|
+
163: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"<html><head><title>Directory Listing</title></head><body>"</span>
|
23
|
+
164: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">entries</span>(<span class="ruby-identifier">dir</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">child</span><span class="ruby-operator">|</span>
|
24
|
+
165: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">child</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"."</span>
|
25
|
+
166: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"<a href=\"#{base}/#{ HttpRequest.escape(child)}\">"</span>
|
26
|
+
167: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> (<span class="ruby-identifier">child</span> <span class="ruby-operator">==</span> <span class="ruby-value str">".."</span> <span class="ruby-operator">?</span> <span class="ruby-value str">"Up to parent.."</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">child</span>)
|
27
|
+
168: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"</a><br/>"</span>
|
28
|
+
169: <span class="ruby-keyword kw">end</span>
|
29
|
+
170: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"</body></html>"</span>
|
30
|
+
171: <span class="ruby-keyword kw">end</span>
|
31
|
+
172: <span class="ruby-keyword kw">else</span>
|
32
|
+
173: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">403</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
|
33
|
+
174: <span class="ruby-identifier">out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">"Directory listings not allowed"</span>)
|
34
|
+
175: <span class="ruby-keyword kw">end</span>
|
35
|
+
176: <span class="ruby-keyword kw">end</span>
|
36
|
+
177: <span class="ruby-keyword kw">end</span></pre>
|
38
37
|
</body>
|
39
38
|
</html>
|
@@ -5,14 +5,61 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>send_file (Mongrel::DirHandler)</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> <span class="ruby-comment cmt"># File lib/mongrel/handlers.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel/handlers.rb, line 182</span>
|
14
|
+
182: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_file</span>(<span class="ruby-identifier">req_path</span>, <span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>, <span class="ruby-identifier">header_only</span>=<span class="ruby-keyword kw">false</span>)
|
15
|
+
183:
|
16
|
+
184: <span class="ruby-identifier">stat</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">stat</span>(<span class="ruby-identifier">req_path</span>)
|
17
|
+
185:
|
18
|
+
186: <span class="ruby-comment cmt"># Set the last modified times as well and etag for all files</span>
|
19
|
+
187: <span class="ruby-identifier">mtime</span> = <span class="ruby-identifier">stat</span>.<span class="ruby-identifier">mtime</span>
|
20
|
+
188: <span class="ruby-comment cmt"># Calculated the same as apache, not sure how well the works on win32</span>
|
21
|
+
189: <span class="ruby-identifier">etag</span> = <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">ETAG_FORMAT</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">mtime</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-identifier">stat</span>.<span class="ruby-identifier">size</span>, <span class="ruby-identifier">stat</span>.<span class="ruby-identifier">ino</span>]
|
22
|
+
190:
|
23
|
+
191: <span class="ruby-identifier">modified_since</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP_IF_MODIFIED_SINCE</span>]
|
24
|
+
192: <span class="ruby-identifier">none_match</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP_IF_NONE_MATCH</span>]
|
25
|
+
193:
|
26
|
+
194: <span class="ruby-comment cmt"># test to see if this is a conditional request, and test if</span>
|
27
|
+
195: <span class="ruby-comment cmt"># the response would be identical to the last response</span>
|
28
|
+
196: <span class="ruby-identifier">same_response</span> = <span class="ruby-keyword kw">case</span>
|
29
|
+
197: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">modified_since</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">last_response_time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">httpdate</span>(<span class="ruby-identifier">modified_since</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">false</span>
|
30
|
+
198: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">modified_since</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">last_response_time</span> <span class="ruby-operator">></span> <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">false</span>
|
31
|
+
199: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">modified_since</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">mtime</span> <span class="ruby-operator">></span> <span class="ruby-identifier">last_response_time</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">false</span>
|
32
|
+
200: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">none_match</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">none_match</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'*'</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">false</span>
|
33
|
+
201: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">none_match</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">none_match</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/\s*,\s*/</span>).<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">etag</span>) <span class="ruby-operator">:</span> <span class="ruby-keyword kw">false</span>
|
34
|
+
202: <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">modified_since</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">none_match</span> <span class="ruby-comment cmt"># validation successful if we get this far and at least one of the header exists</span>
|
35
|
+
203: <span class="ruby-keyword kw">end</span>
|
36
|
+
204:
|
37
|
+
205: <span class="ruby-identifier">header</span> = <span class="ruby-identifier">response</span>.<span class="ruby-identifier">header</span>
|
38
|
+
206: <span class="ruby-identifier">header</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">ETAG</span>] = <span class="ruby-identifier">etag</span>
|
39
|
+
207:
|
40
|
+
208: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">same_response</span>
|
41
|
+
209: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">304</span>) {}
|
42
|
+
210: <span class="ruby-keyword kw">else</span>
|
43
|
+
211: <span class="ruby-comment cmt"># first we setup the headers and status then we do a very fast send on the socket directly</span>
|
44
|
+
212: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">status</span> = <span class="ruby-value">200</span>
|
45
|
+
213: <span class="ruby-identifier">header</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">LAST_MODIFIED</span>] = <span class="ruby-identifier">mtime</span>.<span class="ruby-identifier">httpdate</span>
|
46
|
+
214:
|
47
|
+
215: <span class="ruby-comment cmt"># set the mime type from our map based on the ending</span>
|
48
|
+
216: <span class="ruby-identifier">dot_at</span> = <span class="ruby-identifier">req_path</span>.<span class="ruby-identifier">rindex</span>(<span class="ruby-value str">'.'</span>)
|
49
|
+
217: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">dot_at</span>
|
50
|
+
218: <span class="ruby-identifier">header</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">CONTENT_TYPE</span>] = <span class="ruby-constant">MIME_TYPES</span>[<span class="ruby-identifier">req_path</span>[<span class="ruby-identifier">dot_at</span> <span class="ruby-operator">..</span> <span class="ruby-value">-1</span>]] <span class="ruby-operator">||</span> <span class="ruby-ivar">@default_content_type</span>
|
51
|
+
219: <span class="ruby-keyword kw">else</span>
|
52
|
+
220: <span class="ruby-identifier">header</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">CONTENT_TYPE</span>] = <span class="ruby-ivar">@default_content_type</span>
|
53
|
+
221: <span class="ruby-keyword kw">end</span>
|
54
|
+
222:
|
55
|
+
223: <span class="ruby-comment cmt"># send a status with out content length</span>
|
56
|
+
224: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">send_status</span>(<span class="ruby-identifier">stat</span>.<span class="ruby-identifier">size</span>)
|
57
|
+
225: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">send_header</span>
|
58
|
+
226:
|
59
|
+
227: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">header_only</span>
|
60
|
+
228: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">send_file</span>(<span class="ruby-identifier">req_path</span>, <span class="ruby-identifier">stat</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator"><</span> <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">CHUNK_SIZE</span> <span class="ruby-operator">*</span> <span class="ruby-value">2</span>)
|
61
|
+
229: <span class="ruby-keyword kw">end</span>
|
62
|
+
230: <span class="ruby-keyword kw">end</span>
|
63
|
+
231: <span class="ruby-keyword kw">end</span></pre>
|
17
64
|
</body>
|
18
65
|
</html>
|
@@ -0,0 +1,39 @@
|
|
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>process (Mongrel::DirHandler)</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> <span class="ruby-comment cmt"># File lib/mongrel/handlers.rb, line 235</span>
|
14
|
+
235: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>)
|
15
|
+
236: <span class="ruby-identifier">req_method</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">REQUEST_METHOD</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">GET</span>
|
16
|
+
237: <span class="ruby-identifier">req_path</span> = <span class="ruby-identifier">can_serve</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">PATH_INFO</span>]
|
17
|
+
238: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">req_path</span>
|
18
|
+
239: <span class="ruby-comment cmt"># not found, return a 404</span>
|
19
|
+
240: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">404</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
|
20
|
+
241: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"File not found"</span>
|
21
|
+
242: <span class="ruby-keyword kw">end</span>
|
22
|
+
243: <span class="ruby-keyword kw">else</span>
|
23
|
+
244: <span class="ruby-keyword kw">begin</span>
|
24
|
+
245: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span> <span class="ruby-identifier">req_path</span>
|
25
|
+
246: <span class="ruby-identifier">send_dir_listing</span>(<span class="ruby-identifier">request</span>.<span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">REQUEST_URI</span>], <span class="ruby-identifier">req_path</span>, <span class="ruby-identifier">response</span>)
|
26
|
+
247: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">req_method</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">HEAD</span>
|
27
|
+
248: <span class="ruby-identifier">send_file</span>(<span class="ruby-identifier">req_path</span>, <span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>, <span class="ruby-keyword kw">true</span>)
|
28
|
+
249: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">req_method</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">GET</span>
|
29
|
+
250: <span class="ruby-identifier">send_file</span>(<span class="ruby-identifier">req_path</span>, <span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>, <span class="ruby-keyword kw">false</span>)
|
30
|
+
251: <span class="ruby-keyword kw">else</span>
|
31
|
+
252: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">403</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span> <span class="ruby-identifier">out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-constant">ONLY_HEAD_GET</span>) }
|
32
|
+
253: <span class="ruby-keyword kw">end</span>
|
33
|
+
254: <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">details</span>
|
34
|
+
255: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"Error sending file #{req_path}: #{details}"</span>
|
35
|
+
256: <span class="ruby-keyword kw">end</span>
|
36
|
+
257: <span class="ruby-keyword kw">end</span>
|
37
|
+
258: <span class="ruby-keyword kw">end</span></pre>
|
38
|
+
</body>
|
39
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
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>add_mime_type (Mongrel::DirHandler)</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> <span class="ruby-comment cmt"># File lib/mongrel/handlers.rb, line 262</span>
|
14
|
+
262: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">DirHandler</span><span class="ruby-operator">::</span><span class="ruby-identifier">add_mime_type</span>(<span class="ruby-identifier">extension</span>, <span class="ruby-identifier">type</span>)
|
15
|
+
263: <span class="ruby-constant">MIME_TYPES</span>[<span class="ruby-identifier">extension</span>] = <span class="ruby-identifier">type</span>
|
16
|
+
264: <span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -96,8 +96,8 @@ with a custom message for special URIs.
|
|
96
96
|
<h3 class="section-bar">Methods</h3>
|
97
97
|
|
98
98
|
<div class="name-list">
|
99
|
-
<a href="#
|
100
|
-
<a href="#
|
99
|
+
<a href="#M000126">new</a>
|
100
|
+
<a href="#M000127">process</a>
|
101
101
|
</div>
|
102
102
|
</div>
|
103
103
|
|
@@ -119,12 +119,12 @@ with a custom message for special URIs.
|
|
119
119
|
<div id="methods">
|
120
120
|
<h3 class="section-bar">Public Class methods</h3>
|
121
121
|
|
122
|
-
<div id="method-
|
123
|
-
<a name="
|
122
|
+
<div id="method-M000126" class="method-detail">
|
123
|
+
<a name="M000126"></a>
|
124
124
|
|
125
125
|
<div class="method-heading">
|
126
|
-
<a href="Error404Handler.src/
|
127
|
-
onclick="popupCode('Error404Handler.src/
|
126
|
+
<a href="Error404Handler.src/M000126.html" target="Code" class="method-signature"
|
127
|
+
onclick="popupCode('Error404Handler.src/M000126.html');return false;">
|
128
128
|
<span class="method-name">new</span><span class="method-args">(msg)</span>
|
129
129
|
</a>
|
130
130
|
</div>
|
@@ -132,19 +132,19 @@ with a custom message for special URIs.
|
|
132
132
|
<div class="method-description">
|
133
133
|
<p>
|
134
134
|
Sets the message to return. This is constructed once for the handler so
|
135
|
-
it&#
|
135
|
+
it‘s pretty efficient.
|
136
136
|
</p>
|
137
137
|
</div>
|
138
138
|
</div>
|
139
139
|
|
140
140
|
<h3 class="section-bar">Public Instance methods</h3>
|
141
141
|
|
142
|
-
<div id="method-
|
143
|
-
<a name="
|
142
|
+
<div id="method-M000127" class="method-detail">
|
143
|
+
<a name="M000127"></a>
|
144
144
|
|
145
145
|
<div class="method-heading">
|
146
|
-
<a href="Error404Handler.src/
|
147
|
-
onclick="popupCode('Error404Handler.src/
|
146
|
+
<a href="Error404Handler.src/M000127.html" target="Code" class="method-signature"
|
147
|
+
onclick="popupCode('Error404Handler.src/M000127.html');return false;">
|
148
148
|
<span class="method-name">process</span><span class="method-args">(request, response)</span>
|
149
149
|
</a>
|
150
150
|
</div>
|
@@ -10,9 +10,9 @@
|
|
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> <span class="ruby-comment cmt"># File lib/mongrel/handlers.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel/handlers.rb, line 79</span>
|
14
|
+
79: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">msg</span>)
|
15
|
+
80: <span class="ruby-ivar">@response</span> = <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">ERROR_404_RESPONSE</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">msg</span>
|
16
|
+
81: <span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -10,9 +10,9 @@
|
|
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> <span class="ruby-comment cmt"># File lib/mongrel/handlers.rb, line
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel/handlers.rb, line 84</span>
|
14
|
+
84: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>)
|
15
|
+
85: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">socket</span>.<span class="ruby-identifier">write</span>(<span class="ruby-ivar">@response</span>)
|
16
|
+
86: <span class="ruby-keyword kw">end</span></pre>
|
17
17
|
</body>
|
18
18
|
</html>
|
@@ -101,8 +101,8 @@ there.
|
|
101
101
|
<h3 class="section-bar">Methods</h3>
|
102
102
|
|
103
103
|
<div class="name-list">
|
104
|
-
<a href="#
|
105
|
-
<a href="#
|
104
|
+
<a href="#M000067">[]=</a>
|
105
|
+
<a href="#M000066">new</a>
|
106
106
|
</div>
|
107
107
|
</div>
|
108
108
|
|
@@ -122,6 +122,11 @@ there.
|
|
122
122
|
|
123
123
|
<div class="name-list">
|
124
124
|
<table>
|
125
|
+
<tr class="top-aligned-row context-row">
|
126
|
+
<td class="context-item-name">allowed_duplicates</td>
|
127
|
+
<td class="context-item-value"> [RW] </td>
|
128
|
+
<td class="context-item-desc"></td>
|
129
|
+
</tr>
|
125
130
|
<tr class="top-aligned-row context-row">
|
126
131
|
<td class="context-item-name">out</td>
|
127
132
|
<td class="context-item-value"> [R] </td>
|
@@ -137,12 +142,12 @@ there.
|
|
137
142
|
<div id="methods">
|
138
143
|
<h3 class="section-bar">Public Class methods</h3>
|
139
144
|
|
140
|
-
<div id="method-
|
141
|
-
<a name="
|
145
|
+
<div id="method-M000066" class="method-detail">
|
146
|
+
<a name="M000066"></a>
|
142
147
|
|
143
148
|
<div class="method-heading">
|
144
|
-
<a href="HeaderOut.src/
|
145
|
-
onclick="popupCode('HeaderOut.src/
|
149
|
+
<a href="HeaderOut.src/M000066.html" target="Code" class="method-signature"
|
150
|
+
onclick="popupCode('HeaderOut.src/M000066.html');return false;">
|
146
151
|
<span class="method-name">new</span><span class="method-args">(out)</span>
|
147
152
|
</a>
|
148
153
|
</div>
|
@@ -153,12 +158,12 @@ there.
|
|
153
158
|
|
154
159
|
<h3 class="section-bar">Public Instance methods</h3>
|
155
160
|
|
156
|
-
<div id="method-
|
157
|
-
<a name="
|
161
|
+
<div id="method-M000067" class="method-detail">
|
162
|
+
<a name="M000067"></a>
|
158
163
|
|
159
164
|
<div class="method-heading">
|
160
|
-
<a href="HeaderOut.src/
|
161
|
-
onclick="popupCode('HeaderOut.src/
|
165
|
+
<a href="HeaderOut.src/M000067.html" target="Code" class="method-signature"
|
166
|
+
onclick="popupCode('HeaderOut.src/M000067.html');return false;">
|
162
167
|
<span class="method-name">[]=</span><span class="method-args">(key,value)</span>
|
163
168
|
</a>
|
164
169
|
</div>
|