mongrel 0.3.13.3 → 0.3.13.4
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 +5 -4
- data/bin/mongrel_rails +162 -169
- data/doc/rdoc/classes/IO.src/M000001.html +5 -5
- data/doc/rdoc/classes/IO.src/M000002.html +5 -5
- data/doc/rdoc/classes/Kernel.html +10 -10
- data/doc/rdoc/classes/Kernel.src/M000010.html +19 -0
- data/doc/rdoc/classes/Kernel.src/M000011.html +23 -0
- data/doc/rdoc/classes/Mongrel.html +27 -10
- data/doc/rdoc/classes/Mongrel/CGIWrapper.html +67 -54
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/{M000101.html → M000112.html} +11 -10
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/{M000102.html → M000113.html} +31 -31
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/{M000103.html → M000114.html} +20 -20
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000115.html +32 -0
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/{M000105.html → M000116.html} +11 -11
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/{M000106.html → M000117.html} +4 -4
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/{M000107.html → M000118.html} +4 -4
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/{M000108.html → M000119.html} +4 -4
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/{M000109.html → M000120.html} +5 -5
- data/doc/rdoc/classes/Mongrel/Camping.html +5 -5
- data/doc/rdoc/classes/Mongrel/Camping.src/{M000048.html → M000039.html} +0 -0
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.html +10 -10
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/{M000049.html → M000040.html} +0 -0
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/{M000050.html → M000041.html} +0 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.html +65 -65
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000016.html +24 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000017.html +42 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000018.html +18 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/{M000029.html → M000019.html} +0 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/{M000030.html → M000020.html} +0 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/{M000031.html → M000021.html} +0 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/{M000032.html → M000022.html} +0 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/{M000033.html → M000023.html} +0 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/{M000034.html → M000024.html} +0 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/{M000035.html → M000025.html} +0 -0
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000026.html +11 -11
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000027.html +11 -29
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000028.html +5 -5
- data/doc/rdoc/classes/Mongrel/Command/Registry.html +15 -15
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/{M000039.html → M000029.html} +0 -0
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/{M000040.html → M000030.html} +10 -6
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000031.html +58 -0
- data/doc/rdoc/classes/Mongrel/Configurator.html +115 -115
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000091.html +27 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000092.html +31 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000093.html +21 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000094.html +20 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000095.html +23 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/{M000115.html → M000096.html} +4 -4
- data/doc/rdoc/classes/Mongrel/Configurator.src/{M000116.html → M000097.html} +24 -24
- data/doc/rdoc/classes/Mongrel/Configurator.src/{M000117.html → M000098.html} +5 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000099.html +39 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/{M000119.html → M000100.html} +19 -19
- data/doc/rdoc/classes/Mongrel/Configurator.src/{M000120.html → M000101.html} +4 -4
- data/doc/rdoc/classes/Mongrel/Configurator.src/{M000121.html → M000102.html} +10 -10
- data/doc/rdoc/classes/Mongrel/Configurator.src/{M000122.html → M000103.html} +5 -5
- data/doc/rdoc/classes/Mongrel/Configurator.src/{M000123.html → M000104.html} +4 -4
- data/doc/rdoc/classes/Mongrel/Configurator.src/{M000124.html → M000105.html} +8 -8
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000106.html +22 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/{M000126.html → M000107.html} +4 -4
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000108.html +34 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000109.html +18 -0
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000110.html +23 -14
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000111.html +5 -18
- data/doc/rdoc/classes/Mongrel/Const.html +11 -6
- data/doc/rdoc/classes/Mongrel/DeflateFilter.html +10 -10
- data/doc/rdoc/classes/Mongrel/DeflateFilter.src/{M000099.html → M000121.html} +5 -5
- data/doc/rdoc/classes/Mongrel/DeflateFilter.src/{M000100.html → M000122.html} +14 -14
- data/doc/rdoc/classes/Mongrel/DirHandler.html +31 -31
- data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000058.html → M000049.html} +0 -0
- data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000059.html → M000050.html} +0 -0
- data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000060.html → M000051.html} +12 -16
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000052.html +63 -0
- data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000062.html → M000053.html} +25 -25
- data/doc/rdoc/classes/Mongrel/DirHandler.src/{M000063.html → M000054.html} +4 -4
- data/doc/rdoc/classes/Mongrel/Error404Handler.html +10 -10
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000131.html → M000123.html} +0 -0
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000132.html → M000124.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HeaderOut.html +10 -10
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000072.html → M000064.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000073.html → M000065.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HttpHandler.html +15 -15
- data/doc/rdoc/classes/Mongrel/HttpHandler.src/{M000078.html → M000070.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpHandler.src/{M000079.html → M000071.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpHandler.src/{M000080.html → M000072.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.html +20 -20
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/{M000022.html → M000012.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/{M000023.html → M000013.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/{M000024.html → M000014.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/{M000025.html → M000015.html} +0 -0
- data/doc/rdoc/classes/Mongrel/HttpParams.html +131 -0
- data/doc/rdoc/classes/Mongrel/HttpParser.html +35 -35
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000051.html → M000042.html} +1 -1
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000052.html → M000043.html} +1 -1
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000053.html → M000044.html} +1 -1
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000054.html → M000045.html} +3 -3
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000055.html → M000046.html} +1 -1
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000056.html → M000047.html} +1 -1
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000057.html → M000048.html} +1 -1
- data/doc/rdoc/classes/Mongrel/HttpRequest.html +63 -24
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000130.html +47 -0
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000131.html +37 -0
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000132.html +29 -0
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000139.html → M000133.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000140.html → M000134.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000141.html → M000135.html} +18 -18
- data/doc/rdoc/classes/Mongrel/HttpResponse.html +66 -72
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000073.html +25 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000074.html +20 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000075.html +26 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000076.html +22 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000085.html → M000077.html} +8 -8
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000086.html → M000078.html} +8 -8
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000079.html +31 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/{M000088.html → M000080.html} +7 -7
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000081.html +7 -12
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000082.html +7 -7
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000083.html +7 -12
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000084.html +5 -9
- data/doc/rdoc/classes/Mongrel/HttpServer.html +58 -43
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000064.html → M000055.html} +11 -11
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000065.html → M000056.html} +76 -72
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000066.html → M000057.html} +18 -17
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000067.html → M000058.html} +7 -7
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000059.html +22 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000060.html +62 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000069.html → M000061.html} +20 -20
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000070.html → M000062.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HttpServer.src/{M000071.html → M000063.html} +8 -8
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.html +15 -15
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/{M000042.html → M000032.html} +23 -25
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/{M000043.html → M000033.html} +11 -11
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/{M000044.html → M000034.html} +12 -12
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.html +30 -15
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/{M000045.html → M000035.html} +9 -8
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000036.html +54 -0
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000037.html +21 -0
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000038.html +25 -0
- data/doc/rdoc/classes/Mongrel/RedirectHandler.html +10 -10
- data/doc/rdoc/classes/Mongrel/RedirectHandler.src/{M000136.html → M000128.html} +8 -8
- data/doc/rdoc/classes/Mongrel/RedirectHandler.src/{M000137.html → M000129.html} +13 -13
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.html +16 -16
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/M000125.html +24 -0
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/{M000134.html → M000126.html} +10 -10
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/{M000135.html → M000127.html} +4 -4
- data/doc/rdoc/classes/{Stats.html → Mongrel/Stats.html} +44 -60
- data/doc/rdoc/classes/Mongrel/Stats.src/M000136.html +19 -0
- data/doc/rdoc/classes/Mongrel/Stats.src/M000137.html +23 -0
- data/doc/rdoc/classes/Mongrel/Stats.src/M000138.html +26 -0
- data/doc/rdoc/classes/Mongrel/Stats.src/M000139.html +18 -0
- data/doc/rdoc/classes/{Stats.src/M000009.html → Mongrel/Stats.src/M000140.html} +6 -6
- data/doc/rdoc/classes/Mongrel/Stats.src/M000141.html +18 -0
- data/doc/rdoc/classes/Mongrel/Stats.src/M000142.html +23 -0
- data/doc/rdoc/classes/Mongrel/Stats.src/M000143.html +20 -0
- data/doc/rdoc/classes/Mongrel/StatusHandler.html +20 -20
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/{M000074.html → M000066.html} +4 -4
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/{M000075.html → M000067.html} +10 -10
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/{M000076.html → M000068.html} +28 -28
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/{M000077.html → M000069.html} +6 -6
- data/doc/rdoc/classes/Mongrel/URIClassifier.html +30 -30
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000093.html → M000085.html} +4 -4
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000094.html → M000086.html} +4 -4
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000095.html → M000087.html} +0 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000096.html → M000088.html} +1 -1
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000097.html → M000089.html} +0 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/{M000098.html → M000090.html} +1 -1
- data/doc/rdoc/classes/MongrelDbg.html +26 -26
- data/doc/rdoc/classes/MongrelDbg.src/M000005.html +24 -0
- data/doc/rdoc/classes/MongrelDbg.src/{M000016.html → M000006.html} +6 -6
- data/doc/rdoc/classes/MongrelDbg.src/{M000017.html → M000007.html} +8 -8
- data/doc/rdoc/classes/MongrelDbg.src/{M000018.html → M000008.html} +7 -7
- data/doc/rdoc/classes/MongrelDbg.src/{M000019.html → M000009.html} +4 -4
- data/doc/rdoc/classes/RequestLog/Access.html +5 -5
- data/doc/rdoc/classes/RequestLog/Access.src/{M000142.html → M000144.html} +5 -5
- data/doc/rdoc/classes/RequestLog/Files.html +5 -5
- data/doc/rdoc/classes/RequestLog/Files.src/{M000143.html → M000145.html} +5 -5
- data/doc/rdoc/classes/RequestLog/Objects.html +12 -6
- data/doc/rdoc/classes/RequestLog/Objects.src/M000147.html +51 -0
- data/doc/rdoc/classes/RequestLog/Params.html +5 -5
- data/doc/rdoc/classes/RequestLog/Params.src/{M000146.html → M000148.html} +5 -5
- data/doc/rdoc/classes/RequestLog/Threads.html +5 -5
- data/doc/rdoc/classes/RequestLog/Threads.src/{M000144.html → M000146.html} +20 -20
- data/doc/rdoc/classes/{ObjectTracker.html → Sync.html} +26 -45
- 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 +1 -1
- data/doc/rdoc/files/ext/http11/http11_c.html +1 -1
- data/doc/rdoc/files/lib/mongrel/camping_rb.html +1 -1
- data/doc/rdoc/files/lib/mongrel/cgi_rb.html +1 -1
- data/doc/rdoc/files/lib/mongrel/command_rb.html +1 -1
- data/doc/rdoc/files/lib/mongrel/configurator_rb.html +111 -0
- data/doc/rdoc/files/lib/mongrel/debug_rb.html +1 -1
- data/doc/rdoc/files/lib/mongrel/handlers_rb.html +1 -1
- data/doc/rdoc/files/lib/mongrel/init_rb.html +1 -1
- data/doc/rdoc/files/lib/mongrel/rails_rb.html +2 -1
- data/doc/rdoc/files/lib/mongrel/stats_rb.html +1 -1
- data/doc/rdoc/files/lib/mongrel/tcphack_rb.html +1 -1
- data/doc/rdoc/files/lib/mongrel_rb.html +2 -4
- data/doc/rdoc/fr_class_index.html +3 -2
- data/doc/rdoc/fr_file_index.html +1 -0
- data/doc/rdoc/fr_method_index.html +144 -142
- data/ext/http11/http11.c +69 -52
- data/ext/http11/http11_parser.c +366 -282
- data/ext/http11/http11_parser.h +2 -0
- data/ext/http11/http11_parser.rl +192 -0
- data/lib/mongrel.rb +127 -433
- data/lib/mongrel/cgi.rb +19 -6
- data/lib/mongrel/command.rb +15 -3
- data/lib/mongrel/configurator.rb +374 -0
- data/lib/mongrel/debug.rb +47 -56
- data/lib/mongrel/handlers.rb +16 -20
- data/lib/mongrel/rails.rb +36 -20
- data/lib/mongrel/stats.rb +60 -58
- data/test/test_conditional.rb +37 -30
- data/test/test_http11.rb +14 -14
- data/test/test_stats.rb +2 -2
- data/test/test_ws.rb +4 -2
- data/tools/rakehelp.rb +4 -4
- metadata +262 -260
- data/doc/rdoc/classes/Kernel.src/M000020.html +0 -19
- data/doc/rdoc/classes/Kernel.src/M000021.html +0 -23
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000104.html +0 -27
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000036.html +0 -24
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000037.html +0 -24
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000038.html +0 -18
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000041.html +0 -50
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000112.html +0 -20
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000113.html +0 -20
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000114.html +0 -23
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000118.html +0 -30
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000125.html +0 -25
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000127.html +0 -35
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000128.html +0 -18
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000129.html +0 -33
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000130.html +0 -18
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000061.html +0 -63
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000138.html +0 -56
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000087.html +0 -31
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000089.html +0 -20
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000090.html +0 -20
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000091.html +0 -20
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000092.html +0 -18
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000068.html +0 -50
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000046.html +0 -51
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000047.html +0 -23
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/M000133.html +0 -24
- data/doc/rdoc/classes/MongrelDbg.src/M000015.html +0 -19
- data/doc/rdoc/classes/ObjectTracker.src/M000013.html +0 -27
- data/doc/rdoc/classes/ObjectTracker.src/M000014.html +0 -44
- data/doc/rdoc/classes/RequestLog/Objects.src/M000145.html +0 -19
- data/doc/rdoc/classes/Stats.src/M000005.html +0 -19
- data/doc/rdoc/classes/Stats.src/M000006.html +0 -23
- data/doc/rdoc/classes/Stats.src/M000007.html +0 -26
- data/doc/rdoc/classes/Stats.src/M000008.html +0 -18
- data/doc/rdoc/classes/Stats.src/M000010.html +0 -18
- data/doc/rdoc/classes/Stats.src/M000011.html +0 -23
- data/doc/rdoc/classes/Stats.src/M000012.html +0 -20
- data/lib/http11.so +0 -0
|
@@ -10,13 +10,13 @@
|
|
|
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.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 423</span>
|
|
14
|
+
423: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_body</span>
|
|
15
|
+
424: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@body_sent</span>
|
|
16
|
+
425: <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">rewind</span>
|
|
17
|
+
426: <span class="ruby-identifier">write</span>(<span class="ruby-ivar">@body</span>.<span class="ruby-identifier">read</span>)
|
|
18
|
+
427: <span class="ruby-ivar">@body_sent</span> = <span class="ruby-keyword kw">true</span>
|
|
19
|
+
428: <span class="ruby-keyword kw">end</span>
|
|
20
|
+
429: <span class="ruby-keyword kw">end</span></pre>
|
|
21
21
|
</body>
|
|
22
22
|
</html>
|
|
@@ -0,0 +1,31 @@
|
|
|
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>send_file (Mongrel::HttpResponse)</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.rb, line 435</span>
|
|
14
|
+
435: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_file</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">small_file</span> = <span class="ruby-keyword kw">false</span>)
|
|
15
|
+
436: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">small_file</span>
|
|
16
|
+
437: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">path</span>, <span class="ruby-value str">"rb"</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@socket</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">read</span> }
|
|
17
|
+
438: <span class="ruby-keyword kw">else</span>
|
|
18
|
+
439: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">path</span>, <span class="ruby-value str">"rb"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
|
|
19
|
+
440: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">chunk</span> = <span class="ruby-identifier">f</span>.<span class="ruby-identifier">read</span>(<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">CHUNK_SIZE</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">chunk</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
|
20
|
+
441: <span class="ruby-keyword kw">begin</span>
|
|
21
|
+
442: <span class="ruby-identifier">write</span>(<span class="ruby-identifier">chunk</span>)
|
|
22
|
+
443: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Object</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">exc</span>
|
|
23
|
+
444: <span class="ruby-keyword kw">break</span>
|
|
24
|
+
445: <span class="ruby-keyword kw">end</span>
|
|
25
|
+
446: <span class="ruby-keyword kw">end</span>
|
|
26
|
+
447: <span class="ruby-keyword kw">end</span>
|
|
27
|
+
448: <span class="ruby-keyword kw">end</span>
|
|
28
|
+
449: <span class="ruby-ivar">@body_sent</span> = <span class="ruby-keyword kw">true</span>
|
|
29
|
+
450: <span class="ruby-keyword kw">end</span></pre>
|
|
30
|
+
</body>
|
|
31
|
+
</html>
|
|
@@ -10,12 +10,12 @@
|
|
|
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.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 452</span>
|
|
14
|
+
452: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">socket_error</span>(<span class="ruby-identifier">details</span>)
|
|
15
|
+
453: <span class="ruby-comment cmt"># ignore these since it means the client closed off early</span>
|
|
16
|
+
454: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Object</span>
|
|
17
|
+
455: <span class="ruby-identifier">done</span> = <span class="ruby-keyword kw">true</span>
|
|
18
|
+
456: <span class="ruby-identifier">raise</span> <span class="ruby-identifier">details</span>
|
|
19
|
+
457: <span class="ruby-keyword kw">end</span></pre>
|
|
20
20
|
</body>
|
|
21
21
|
</html>
|
|
@@ -5,21 +5,16 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>write (Mongrel::HttpResponse)</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.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
337: <span class="ruby-ivar">@header</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">DATE</span>] = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">httpdate</span>
|
|
20
|
-
338: <span class="ruby-ivar">@body_sent</span> = <span class="ruby-keyword kw">false</span>
|
|
21
|
-
339: <span class="ruby-ivar">@header_sent</span> = <span class="ruby-keyword kw">false</span>
|
|
22
|
-
340: <span class="ruby-ivar">@status_sent</span> = <span class="ruby-keyword kw">false</span>
|
|
23
|
-
341: <span class="ruby-keyword kw">end</span></pre>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 459</span>
|
|
14
|
+
459: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write</span>(<span class="ruby-identifier">data</span>)
|
|
15
|
+
460: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">data</span>)
|
|
16
|
+
461: <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">details</span>
|
|
17
|
+
462: <span class="ruby-identifier">socket_error</span>(<span class="ruby-identifier">details</span>)
|
|
18
|
+
463: <span class="ruby-keyword kw">end</span></pre>
|
|
24
19
|
</body>
|
|
25
20
|
</html>
|
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>finished (Mongrel::HttpResponse)</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.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 467</span>
|
|
14
|
+
467: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">finished</span>
|
|
15
|
+
468: <span class="ruby-identifier">send_status</span>
|
|
16
|
+
469: <span class="ruby-identifier">send_header</span>
|
|
17
|
+
470: <span class="ruby-identifier">send_body</span>
|
|
18
|
+
471: <span class="ruby-keyword kw">end</span></pre>
|
|
19
19
|
</body>
|
|
20
20
|
</html>
|
|
@@ -5,21 +5,16 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>done= (Mongrel::HttpResponse)</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.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
365: <span class="ruby-keyword kw">else</span>
|
|
20
|
-
366: <span class="ruby-ivar">@header</span>.<span class="ruby-identifier">out</span>.<span class="ruby-identifier">rewind</span>
|
|
21
|
-
367: <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">rewind</span>
|
|
22
|
-
368: <span class="ruby-keyword kw">end</span>
|
|
23
|
-
369: <span class="ruby-keyword kw">end</span></pre>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 475</span>
|
|
14
|
+
475: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">done=</span>(<span class="ruby-identifier">val</span>)
|
|
15
|
+
476: <span class="ruby-ivar">@status_sent</span> = <span class="ruby-keyword kw">true</span>
|
|
16
|
+
477: <span class="ruby-ivar">@header_sent</span> = <span class="ruby-keyword kw">true</span>
|
|
17
|
+
478: <span class="ruby-ivar">@body_sent</span> = <span class="ruby-keyword kw">true</span>
|
|
18
|
+
479: <span class="ruby-keyword kw">end</span></pre>
|
|
24
19
|
</body>
|
|
25
20
|
</html>
|
|
@@ -5,18 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>done (Mongrel::HttpResponse)</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.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
374: <span class="ruby-identifier">write</span>(<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">STATUS_FORMAT</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">status</span>, <span class="ruby-constant">HTTP_STATUS_CODES</span>[<span class="ruby-ivar">@status</span>], <span class="ruby-identifier">content_length</span>])
|
|
18
|
-
375: <span class="ruby-ivar">@status_sent</span> = <span class="ruby-keyword kw">true</span>
|
|
19
|
-
376: <span class="ruby-keyword kw">end</span>
|
|
20
|
-
377: <span class="ruby-keyword kw">end</span></pre>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 481</span>
|
|
14
|
+
481: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">done</span>
|
|
15
|
+
482: (<span class="ruby-ivar">@status_sent</span> <span class="ruby-keyword kw">and</span> <span class="ruby-ivar">@header_sent</span> <span class="ruby-keyword kw">and</span> <span class="ruby-ivar">@body_sent</span>)
|
|
16
|
+
483: <span class="ruby-keyword kw">end</span></pre>
|
|
21
17
|
</body>
|
|
22
18
|
</html>
|
|
@@ -85,7 +85,7 @@ This is the main driver of <a href="../Mongrel.html">Mongrel</a>, while the
|
|
|
85
85
|
href="URIClassifier.html">Mongrel::URIClassifier</a> make up the majority
|
|
86
86
|
of how the server functions. It’s a very simple class that just has a
|
|
87
87
|
thread accepting connections and a simple <a
|
|
88
|
-
href="HttpServer.html#
|
|
88
|
+
href="HttpServer.html#M000056">HttpServer.process_client</a> function to do
|
|
89
89
|
the heavy lifting with the <a href="../IO.html">IO</a> and Ruby.
|
|
90
90
|
</p>
|
|
91
91
|
<p>
|
|
@@ -119,14 +119,15 @@ ways to make threads faster, but don’t hold your breath until Ruby
|
|
|
119
119
|
<h3 class="section-bar">Methods</h3>
|
|
120
120
|
|
|
121
121
|
<div class="name-list">
|
|
122
|
-
<a href="#
|
|
123
|
-
<a href="#
|
|
124
|
-
<a href="#
|
|
125
|
-
<a href="#
|
|
126
|
-
<a href="#
|
|
127
|
-
<a href="#
|
|
128
|
-
<a href="#
|
|
129
|
-
<a href="#
|
|
122
|
+
<a href="#M000059">configure_socket_options</a>
|
|
123
|
+
<a href="#M000058">graceful_shutdown</a>
|
|
124
|
+
<a href="#M000055">new</a>
|
|
125
|
+
<a href="#M000056">process_client</a>
|
|
126
|
+
<a href="#M000057">reap_dead_workers</a>
|
|
127
|
+
<a href="#M000061">register</a>
|
|
128
|
+
<a href="#M000060">run</a>
|
|
129
|
+
<a href="#M000063">stop</a>
|
|
130
|
+
<a href="#M000062">unregister</a>
|
|
130
131
|
</div>
|
|
131
132
|
</div>
|
|
132
133
|
|
|
@@ -191,12 +192,12 @@ ways to make threads faster, but don’t hold your breath until Ruby
|
|
|
191
192
|
<div id="methods">
|
|
192
193
|
<h3 class="section-bar">Public Class methods</h3>
|
|
193
194
|
|
|
194
|
-
<div id="method-
|
|
195
|
-
<a name="
|
|
195
|
+
<div id="method-M000055" class="method-detail">
|
|
196
|
+
<a name="M000055"></a>
|
|
196
197
|
|
|
197
198
|
<div class="method-heading">
|
|
198
|
-
<a href="HttpServer.src/
|
|
199
|
-
onclick="popupCode('HttpServer.src/
|
|
199
|
+
<a href="HttpServer.src/M000055.html" target="Code" class="method-signature"
|
|
200
|
+
onclick="popupCode('HttpServer.src/M000055.html');return false;">
|
|
200
201
|
<span class="method-name">new</span><span class="method-args">(host, port, num_processors=(2**30-1), timeout=0)</span>
|
|
201
202
|
</a>
|
|
202
203
|
</div>
|
|
@@ -231,12 +232,26 @@ cause problems on FBSD.
|
|
|
231
232
|
|
|
232
233
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
233
234
|
|
|
234
|
-
<div id="method-
|
|
235
|
-
<a name="
|
|
235
|
+
<div id="method-M000059" class="method-detail">
|
|
236
|
+
<a name="M000059"></a>
|
|
236
237
|
|
|
237
238
|
<div class="method-heading">
|
|
238
|
-
<a href="HttpServer.src/
|
|
239
|
-
onclick="popupCode('HttpServer.src/
|
|
239
|
+
<a href="HttpServer.src/M000059.html" target="Code" class="method-signature"
|
|
240
|
+
onclick="popupCode('HttpServer.src/M000059.html');return false;">
|
|
241
|
+
<span class="method-name">configure_socket_options</span><span class="method-args">()</span>
|
|
242
|
+
</a>
|
|
243
|
+
</div>
|
|
244
|
+
|
|
245
|
+
<div class="method-description">
|
|
246
|
+
</div>
|
|
247
|
+
</div>
|
|
248
|
+
|
|
249
|
+
<div id="method-M000058" class="method-detail">
|
|
250
|
+
<a name="M000058"></a>
|
|
251
|
+
|
|
252
|
+
<div class="method-heading">
|
|
253
|
+
<a href="HttpServer.src/M000058.html" target="Code" class="method-signature"
|
|
254
|
+
onclick="popupCode('HttpServer.src/M000058.html');return false;">
|
|
240
255
|
<span class="method-name">graceful_shutdown</span><span class="method-args">()</span>
|
|
241
256
|
</a>
|
|
242
257
|
</div>
|
|
@@ -251,12 +266,12 @@ much longer.
|
|
|
251
266
|
</div>
|
|
252
267
|
</div>
|
|
253
268
|
|
|
254
|
-
<div id="method-
|
|
255
|
-
<a name="
|
|
269
|
+
<div id="method-M000056" class="method-detail">
|
|
270
|
+
<a name="M000056"></a>
|
|
256
271
|
|
|
257
272
|
<div class="method-heading">
|
|
258
|
-
<a href="HttpServer.src/
|
|
259
|
-
onclick="popupCode('HttpServer.src/
|
|
273
|
+
<a href="HttpServer.src/M000056.html" target="Code" class="method-signature"
|
|
274
|
+
onclick="popupCode('HttpServer.src/M000056.html');return false;">
|
|
260
275
|
<span class="method-name">process_client</span><span class="method-args">(client)</span>
|
|
261
276
|
</a>
|
|
262
277
|
</div>
|
|
@@ -273,12 +288,12 @@ make it faster is more than welcome to take a crack at it.
|
|
|
273
288
|
</div>
|
|
274
289
|
</div>
|
|
275
290
|
|
|
276
|
-
<div id="method-
|
|
277
|
-
<a name="
|
|
291
|
+
<div id="method-M000057" class="method-detail">
|
|
292
|
+
<a name="M000057"></a>
|
|
278
293
|
|
|
279
294
|
<div class="method-heading">
|
|
280
|
-
<a href="HttpServer.src/
|
|
281
|
-
onclick="popupCode('HttpServer.src/
|
|
295
|
+
<a href="HttpServer.src/M000057.html" target="Code" class="method-signature"
|
|
296
|
+
onclick="popupCode('HttpServer.src/M000057.html');return false;">
|
|
282
297
|
<span class="method-name">reap_dead_workers</span><span class="method-args">(reason='unknown')</span>
|
|
283
298
|
</a>
|
|
284
299
|
</div>
|
|
@@ -293,12 +308,12 @@ done. It only runs if there are workers to reap.
|
|
|
293
308
|
</div>
|
|
294
309
|
</div>
|
|
295
310
|
|
|
296
|
-
<div id="method-
|
|
297
|
-
<a name="
|
|
311
|
+
<div id="method-M000061" class="method-detail">
|
|
312
|
+
<a name="M000061"></a>
|
|
298
313
|
|
|
299
314
|
<div class="method-heading">
|
|
300
|
-
<a href="HttpServer.src/
|
|
301
|
-
onclick="popupCode('HttpServer.src/
|
|
315
|
+
<a href="HttpServer.src/M000061.html" target="Code" class="method-signature"
|
|
316
|
+
onclick="popupCode('HttpServer.src/M000061.html');return false;">
|
|
302
317
|
<span class="method-name">register</span><span class="method-args">(uri, handler, in_front=false)</span>
|
|
303
318
|
</a>
|
|
304
319
|
</div>
|
|
@@ -309,7 +324,7 @@ Simply registers a handler with the internal <a
|
|
|
309
324
|
href="URIClassifier.html">URIClassifier</a>. When the URI is found in the
|
|
310
325
|
prefix of a request then your handler’s HttpHandler::process method
|
|
311
326
|
is called. See <a
|
|
312
|
-
href="URIClassifier.html#
|
|
327
|
+
href="URIClassifier.html#M000088">Mongrel::URIClassifier#register</a> for
|
|
313
328
|
more information.
|
|
314
329
|
</p>
|
|
315
330
|
<p>
|
|
@@ -319,12 +334,12 @@ the list. Otherwise it’s placed at the end of the list.
|
|
|
319
334
|
</div>
|
|
320
335
|
</div>
|
|
321
336
|
|
|
322
|
-
<div id="method-
|
|
323
|
-
<a name="
|
|
337
|
+
<div id="method-M000060" class="method-detail">
|
|
338
|
+
<a name="M000060"></a>
|
|
324
339
|
|
|
325
340
|
<div class="method-heading">
|
|
326
|
-
<a href="HttpServer.src/
|
|
327
|
-
onclick="popupCode('HttpServer.src/
|
|
341
|
+
<a href="HttpServer.src/M000060.html" target="Code" class="method-signature"
|
|
342
|
+
onclick="popupCode('HttpServer.src/M000060.html');return false;">
|
|
328
343
|
<span class="method-name">run</span><span class="method-args">()</span>
|
|
329
344
|
</a>
|
|
330
345
|
</div>
|
|
@@ -338,12 +353,12 @@ later.
|
|
|
338
353
|
</div>
|
|
339
354
|
</div>
|
|
340
355
|
|
|
341
|
-
<div id="method-
|
|
342
|
-
<a name="
|
|
356
|
+
<div id="method-M000063" class="method-detail">
|
|
357
|
+
<a name="M000063"></a>
|
|
343
358
|
|
|
344
359
|
<div class="method-heading">
|
|
345
|
-
<a href="HttpServer.src/
|
|
346
|
-
onclick="popupCode('HttpServer.src/
|
|
360
|
+
<a href="HttpServer.src/M000063.html" target="Code" class="method-signature"
|
|
361
|
+
onclick="popupCode('HttpServer.src/M000063.html');return false;">
|
|
347
362
|
<span class="method-name">stop</span><span class="method-args">()</span>
|
|
348
363
|
</a>
|
|
349
364
|
</div>
|
|
@@ -356,12 +371,12 @@ the request queue before finally exiting.
|
|
|
356
371
|
</div>
|
|
357
372
|
</div>
|
|
358
373
|
|
|
359
|
-
<div id="method-
|
|
360
|
-
<a name="
|
|
374
|
+
<div id="method-M000062" class="method-detail">
|
|
375
|
+
<a name="M000062"></a>
|
|
361
376
|
|
|
362
377
|
<div class="method-heading">
|
|
363
|
-
<a href="HttpServer.src/
|
|
364
|
-
onclick="popupCode('HttpServer.src/
|
|
378
|
+
<a href="HttpServer.src/M000062.html" target="Code" class="method-signature"
|
|
379
|
+
onclick="popupCode('HttpServer.src/M000062.html');return false;">
|
|
365
380
|
<span class="method-name">unregister</span><span class="method-args">(uri)</span>
|
|
366
381
|
</a>
|
|
367
382
|
</div>
|
|
@@ -369,7 +384,7 @@ the request queue before finally exiting.
|
|
|
369
384
|
<div class="method-description">
|
|
370
385
|
<p>
|
|
371
386
|
Removes any handlers registered at the given URI. See <a
|
|
372
|
-
href="URIClassifier.html#
|
|
387
|
+
href="URIClassifier.html#M000089">Mongrel::URIClassifier#unregister</a> for
|
|
373
388
|
more information. Remember this removes them <b>all</b> so the entire
|
|
374
389
|
processing chain goes away.
|
|
375
390
|
</p>
|
|
@@ -10,16 +10,16 @@
|
|
|
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.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 529</span>
|
|
14
|
+
529: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">host</span>, <span class="ruby-identifier">port</span>, <span class="ruby-identifier">num_processors</span>=(<span class="ruby-value">2</span><span class="ruby-operator">**</span><span class="ruby-value">30</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>), <span class="ruby-identifier">timeout</span>=<span class="ruby-value">0</span>)
|
|
15
|
+
530: <span class="ruby-ivar">@socket</span> = <span class="ruby-constant">TCPServer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">host</span>, <span class="ruby-identifier">port</span>)
|
|
16
|
+
531: <span class="ruby-ivar">@classifier</span> = <span class="ruby-constant">URIClassifier</span>.<span class="ruby-identifier">new</span>
|
|
17
|
+
532: <span class="ruby-ivar">@host</span> = <span class="ruby-identifier">host</span>
|
|
18
|
+
533: <span class="ruby-ivar">@port</span> = <span class="ruby-identifier">port</span>
|
|
19
|
+
534: <span class="ruby-ivar">@workers</span> = <span class="ruby-constant">ThreadGroup</span>.<span class="ruby-identifier">new</span>
|
|
20
|
+
535: <span class="ruby-ivar">@timeout</span> = <span class="ruby-identifier">timeout</span>
|
|
21
|
+
536: <span class="ruby-ivar">@num_processors</span> = <span class="ruby-identifier">num_processors</span>
|
|
22
|
+
537: <span class="ruby-ivar">@death_time</span> = <span class="ruby-value">60</span>
|
|
23
|
+
538: <span class="ruby-keyword kw">end</span></pre>
|
|
24
24
|
</body>
|
|
25
25
|
</html>
|
|
@@ -10,78 +10,82 @@
|
|
|
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.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
531:
|
|
32
|
-
532: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">handlers</span>
|
|
33
|
-
533: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">PATH_INFO</span>] = <span class="ruby-identifier">path_info</span>
|
|
34
|
-
534: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SCRIPT_NAME</span>] = <span class="ruby-identifier">script_name</span>
|
|
35
|
-
535: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">REMOTE_ADDR</span>] = <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP_X_FORWARDED_FOR</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">client</span>.<span class="ruby-identifier">peeraddr</span>.<span class="ruby-identifier">last</span>
|
|
36
|
-
536: <span class="ruby-identifier">notifier</span> = <span class="ruby-identifier">handlers</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">request_notify</span> <span class="ruby-value">? </span><span class="ruby-identifier">handlers</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
|
|
37
|
-
537:
|
|
38
|
-
538: <span class="ruby-comment cmt"># TODO: Find a faster/better way to carve out the range, preferably without copying.</span>
|
|
39
|
-
539: <span class="ruby-identifier">data</span> = <span class="ruby-identifier">data</span>[<span class="ruby-identifier">nparsed</span> <span class="ruby-operator">...</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">length</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">""</span>
|
|
40
|
-
540:
|
|
41
|
-
541: <span class="ruby-identifier">request</span> = <span class="ruby-constant">HttpRequest</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">params</span>, <span class="ruby-identifier">data</span>, <span class="ruby-identifier">client</span>, <span class="ruby-identifier">notifier</span>)
|
|
42
|
-
542:
|
|
43
|
-
543: <span class="ruby-comment cmt"># in the case of large file uploads the user could close the socket, so skip those requests</span>
|
|
44
|
-
544: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-comment cmt"># nil signals from HttpRequest::initialize that the request was aborted</span>
|
|
45
|
-
545:
|
|
46
|
-
546: <span class="ruby-comment cmt"># request is good so far, continue processing the response</span>
|
|
47
|
-
547: <span class="ruby-identifier">response</span> = <span class="ruby-constant">HttpResponse</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">client</span>)
|
|
48
|
-
548:
|
|
49
|
-
549: <span class="ruby-comment cmt"># Process each handler in registered order until we run out or one finalizes the response.</span>
|
|
50
|
-
550: <span class="ruby-identifier">handlers</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">handler</span><span class="ruby-operator">|</span>
|
|
51
|
-
551: <span class="ruby-identifier">handler</span>.<span class="ruby-identifier">process</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>)
|
|
52
|
-
552: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">done</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">client</span>.<span class="ruby-identifier">closed?</span>
|
|
53
|
-
553: <span class="ruby-keyword kw">end</span>
|
|
54
|
-
554:
|
|
55
|
-
555: <span class="ruby-comment cmt"># And finally, if nobody closed the response off, we finalize it.</span>
|
|
56
|
-
556: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">done</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">client</span>.<span class="ruby-identifier">closed?</span>
|
|
57
|
-
557: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">finished</span>
|
|
58
|
-
558: <span class="ruby-keyword kw">end</span>
|
|
59
|
-
559: <span class="ruby-keyword kw">else</span>
|
|
60
|
-
560: <span class="ruby-comment cmt"># Didn't find it, return a stock 404 response.</span>
|
|
61
|
-
561: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">write</span>(<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">ERROR_404_RESPONSE</span>)
|
|
62
|
-
562: <span class="ruby-keyword kw">end</span>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 546</span>
|
|
14
|
+
546: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_client</span>(<span class="ruby-identifier">client</span>)
|
|
15
|
+
547: <span class="ruby-keyword kw">begin</span>
|
|
16
|
+
548: <span class="ruby-identifier">parser</span> = <span class="ruby-constant">HttpParser</span>.<span class="ruby-identifier">new</span>
|
|
17
|
+
549: <span class="ruby-identifier">params</span> = <span class="ruby-constant">HttpParams</span>.<span class="ruby-identifier">new</span>
|
|
18
|
+
550: <span class="ruby-identifier">request</span> = <span class="ruby-keyword kw">nil</span>
|
|
19
|
+
551: <span class="ruby-identifier">data</span> = <span class="ruby-identifier">client</span>.<span class="ruby-identifier">readpartial</span>(<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">CHUNK_SIZE</span>)
|
|
20
|
+
552: <span class="ruby-identifier">nparsed</span> = <span class="ruby-value">0</span>
|
|
21
|
+
553:
|
|
22
|
+
554: <span class="ruby-comment cmt"># Assumption: nparsed will always be less since data will get filled with more</span>
|
|
23
|
+
555: <span class="ruby-comment cmt"># after each parsing. If it doesn't get more then there was a problem</span>
|
|
24
|
+
556: <span class="ruby-comment cmt"># with the read operation on the client socket. Effect is to stop processing when the</span>
|
|
25
|
+
557: <span class="ruby-comment cmt"># socket can't fill the buffer for further parsing.</span>
|
|
26
|
+
558: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">nparsed</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">length</span>
|
|
27
|
+
559: <span class="ruby-identifier">nparsed</span> = <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">execute</span>(<span class="ruby-identifier">params</span>, <span class="ruby-identifier">data</span>, <span class="ruby-identifier">nparsed</span>)
|
|
28
|
+
560:
|
|
29
|
+
561: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">finished?</span>
|
|
30
|
+
562: <span class="ruby-identifier">script_name</span>, <span class="ruby-identifier">path_info</span>, <span class="ruby-identifier">handlers</span> = <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">resolve</span>(<span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">REQUEST_PATH</span>])
|
|
63
31
|
563:
|
|
64
|
-
564: <span class="ruby-keyword kw">
|
|
65
|
-
565:
|
|
66
|
-
566:
|
|
67
|
-
567:
|
|
68
|
-
568:
|
|
69
|
-
569:
|
|
70
|
-
570:
|
|
71
|
-
571:
|
|
72
|
-
572:
|
|
73
|
-
573:
|
|
74
|
-
574:
|
|
75
|
-
575:
|
|
76
|
-
576:
|
|
77
|
-
577:
|
|
78
|
-
578:
|
|
79
|
-
579:
|
|
80
|
-
580:
|
|
81
|
-
581:
|
|
82
|
-
582:
|
|
83
|
-
583:
|
|
84
|
-
584:
|
|
85
|
-
585:
|
|
32
|
+
564: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">handlers</span>
|
|
33
|
+
565: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">PATH_INFO</span>] = <span class="ruby-identifier">path_info</span>
|
|
34
|
+
566: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SCRIPT_NAME</span>] = <span class="ruby-identifier">script_name</span>
|
|
35
|
+
567: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">REMOTE_ADDR</span>] = <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP_X_FORWARDED_FOR</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">client</span>.<span class="ruby-identifier">peeraddr</span>.<span class="ruby-identifier">last</span>
|
|
36
|
+
568: <span class="ruby-identifier">notifier</span> = <span class="ruby-identifier">handlers</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">request_notify</span> <span class="ruby-value">? </span><span class="ruby-identifier">handlers</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
|
|
37
|
+
569:
|
|
38
|
+
570: <span class="ruby-identifier">request</span> = <span class="ruby-constant">HttpRequest</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">params</span>, <span class="ruby-identifier">client</span>, <span class="ruby-identifier">notifier</span>)
|
|
39
|
+
571:
|
|
40
|
+
572: <span class="ruby-comment cmt"># in the case of large file uploads the user could close the socket, so skip those requests</span>
|
|
41
|
+
573: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-comment cmt"># nil signals from HttpRequest::initialize that the request was aborted</span>
|
|
42
|
+
574:
|
|
43
|
+
575: <span class="ruby-comment cmt"># request is good so far, continue processing the response</span>
|
|
44
|
+
576: <span class="ruby-identifier">response</span> = <span class="ruby-constant">HttpResponse</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">client</span>)
|
|
45
|
+
577:
|
|
46
|
+
578: <span class="ruby-comment cmt"># Process each handler in registered order until we run out or one finalizes the response.</span>
|
|
47
|
+
579: <span class="ruby-identifier">handlers</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">handler</span><span class="ruby-operator">|</span>
|
|
48
|
+
580: <span class="ruby-identifier">handler</span>.<span class="ruby-identifier">process</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>)
|
|
49
|
+
581: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">done</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">client</span>.<span class="ruby-identifier">closed?</span>
|
|
50
|
+
582: <span class="ruby-keyword kw">end</span>
|
|
51
|
+
583:
|
|
52
|
+
584: <span class="ruby-comment cmt"># And finally, if nobody closed the response off, we finalize it.</span>
|
|
53
|
+
585: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">done</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">client</span>.<span class="ruby-identifier">closed?</span>
|
|
54
|
+
586: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">finished</span>
|
|
55
|
+
587: <span class="ruby-keyword kw">end</span>
|
|
56
|
+
588: <span class="ruby-keyword kw">else</span>
|
|
57
|
+
589: <span class="ruby-comment cmt"># Didn't find it, return a stock 404 response.</span>
|
|
58
|
+
590: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">write</span>(<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">ERROR_404_RESPONSE</span>)
|
|
59
|
+
591: <span class="ruby-keyword kw">end</span>
|
|
60
|
+
592:
|
|
61
|
+
593: <span class="ruby-keyword kw">break</span> <span class="ruby-comment cmt">#done</span>
|
|
62
|
+
594: <span class="ruby-keyword kw">else</span>
|
|
63
|
+
595: <span class="ruby-comment cmt"># Parser is not done, queue up more data to read and continue parsing</span>
|
|
64
|
+
596: <span class="ruby-identifier">chunk</span> = <span class="ruby-identifier">client</span>.<span class="ruby-identifier">readpartial</span>(<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">CHUNK_SIZE</span>)
|
|
65
|
+
597: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">chunk</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">chunk</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-comment cmt"># read failed, stop processing</span>
|
|
66
|
+
598:
|
|
67
|
+
599: <span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">chunk</span>
|
|
68
|
+
600: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">>=</span> <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">MAX_HEADER</span>
|
|
69
|
+
601: <span class="ruby-identifier">raise</span> <span class="ruby-constant">HttpParserError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">"HEADER is longer than allowed, aborting client early."</span>)
|
|
70
|
+
602: <span class="ruby-keyword kw">end</span>
|
|
71
|
+
603: <span class="ruby-keyword kw">end</span>
|
|
72
|
+
604: <span class="ruby-keyword kw">end</span>
|
|
73
|
+
605: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">EOFError</span>,<span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ECONNRESET</span>,<span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EPIPE</span>,<span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EINVAL</span>,<span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EBADF</span>
|
|
74
|
+
606: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Object</span>
|
|
75
|
+
607: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">HttpParserError</span>
|
|
76
|
+
608: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$mongrel_debug_client</span>
|
|
77
|
+
609: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"#{Time.now}: BAD CLIENT (#{params[Const::HTTP_X_FORWARDED_FOR] || client.peeraddr.last}): #$!"</span>
|
|
78
|
+
610: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"#{Time.now}: REQUEST DATA: #{data.inspect}\n---\nPARAMS: #{params.inspect}\n---\n"</span>
|
|
79
|
+
611: <span class="ruby-keyword kw">end</span>
|
|
80
|
+
612: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EMFILE</span>
|
|
81
|
+
613: <span class="ruby-identifier">reap_dead_workers</span>(<span class="ruby-value str">'too many files'</span>)
|
|
82
|
+
614: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Object</span>
|
|
83
|
+
615: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"#{Time.now}: ERROR: #$!"</span>
|
|
84
|
+
616: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">$!</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">"\n"</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$mongrel_debug_client</span>
|
|
85
|
+
617: <span class="ruby-keyword kw">ensure</span>
|
|
86
|
+
618: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Object</span>
|
|
87
|
+
619: <span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">delete</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Tempfile</span>
|
|
88
|
+
620: <span class="ruby-keyword kw">end</span>
|
|
89
|
+
621: <span class="ruby-keyword kw">end</span></pre>
|
|
86
90
|
</body>
|
|
87
91
|
</html>
|