mongrel 0.3.13.4 → 1.0
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/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,28 +5,21 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>new (Mongrel::HttpServer)</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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
637: <span class="ruby-identifier">w</span>.<span class="ruby-identifier">raise</span>(<span class="ruby-constant">TimeoutError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">error_msg</span>))
|
|
25
|
-
638: <span class="ruby-keyword kw">end</span>
|
|
26
|
-
639: <span class="ruby-keyword kw">end</span>
|
|
27
|
-
640: <span class="ruby-keyword kw">end</span>
|
|
28
|
-
641:
|
|
29
|
-
642: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">length</span>
|
|
30
|
-
643: <span class="ruby-keyword kw">end</span></pre>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 559</span>
|
|
14
|
+
559: <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
|
+
560: <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
|
+
561: <span class="ruby-ivar">@classifier</span> = <span class="ruby-constant">URIClassifier</span>.<span class="ruby-identifier">new</span>
|
|
17
|
+
562: <span class="ruby-ivar">@host</span> = <span class="ruby-identifier">host</span>
|
|
18
|
+
563: <span class="ruby-ivar">@port</span> = <span class="ruby-identifier">port</span>
|
|
19
|
+
564: <span class="ruby-ivar">@workers</span> = <span class="ruby-constant">ThreadGroup</span>.<span class="ruby-identifier">new</span>
|
|
20
|
+
565: <span class="ruby-ivar">@timeout</span> = <span class="ruby-identifier">timeout</span>
|
|
21
|
+
566: <span class="ruby-ivar">@num_processors</span> = <span class="ruby-identifier">num_processors</span>
|
|
22
|
+
567: <span class="ruby-ivar">@death_time</span> = <span class="ruby-value">60</span>
|
|
23
|
+
568: <span class="ruby-keyword kw">end</span></pre>
|
|
31
24
|
</body>
|
|
32
25
|
</html>
|
|
@@ -5,17 +5,96 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>process_client (Mongrel::HttpServer)</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
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 575</span>
|
|
14
|
+
575: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_client</span>(<span class="ruby-identifier">client</span>)
|
|
15
|
+
576: <span class="ruby-keyword kw">begin</span>
|
|
16
|
+
577: <span class="ruby-identifier">parser</span> = <span class="ruby-constant">HttpParser</span>.<span class="ruby-identifier">new</span>
|
|
17
|
+
578: <span class="ruby-identifier">params</span> = <span class="ruby-constant">HttpParams</span>.<span class="ruby-identifier">new</span>
|
|
18
|
+
579: <span class="ruby-identifier">request</span> = <span class="ruby-keyword kw">nil</span>
|
|
19
|
+
580: <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
|
+
581: <span class="ruby-identifier">nparsed</span> = <span class="ruby-value">0</span>
|
|
21
|
+
582:
|
|
22
|
+
583: <span class="ruby-comment cmt"># Assumption: nparsed will always be less since data will get filled with more</span>
|
|
23
|
+
584: <span class="ruby-comment cmt"># after each parsing. If it doesn't get more then there was a problem</span>
|
|
24
|
+
585: <span class="ruby-comment cmt"># with the read operation on the client socket. Effect is to stop processing when the</span>
|
|
25
|
+
586: <span class="ruby-comment cmt"># socket can't fill the buffer for further parsing.</span>
|
|
26
|
+
587: <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
|
+
588: <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
|
+
589:
|
|
29
|
+
590: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">finished?</span>
|
|
30
|
+
591: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</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>]
|
|
31
|
+
592: <span class="ruby-comment cmt"># it might be a dumbass full host request header</span>
|
|
32
|
+
593: <span class="ruby-identifier">uri</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</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>])
|
|
33
|
+
594: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">REQUEST_PATH</span>] = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">request_uri</span>
|
|
34
|
+
595: <span class="ruby-keyword kw">end</span>
|
|
35
|
+
596:
|
|
36
|
+
597: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"No REQUEST PATH"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</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>]
|
|
37
|
+
598:
|
|
38
|
+
599: <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>])
|
|
39
|
+
600:
|
|
40
|
+
601: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">handlers</span>
|
|
41
|
+
602: <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>
|
|
42
|
+
603: <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>
|
|
43
|
+
604: <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>
|
|
44
|
+
605:
|
|
45
|
+
606: <span class="ruby-comment cmt"># select handlers that want more detailed request notification</span>
|
|
46
|
+
607: <span class="ruby-identifier">notifiers</span> = <span class="ruby-identifier">handlers</span>.<span class="ruby-identifier">select</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">h</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>.<span class="ruby-identifier">request_notify</span> }
|
|
47
|
+
608: <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">notifiers</span>)
|
|
48
|
+
609:
|
|
49
|
+
610: <span class="ruby-comment cmt"># in the case of large file uploads the user could close the socket, so skip those requests</span>
|
|
50
|
+
611: <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>
|
|
51
|
+
612:
|
|
52
|
+
613: <span class="ruby-comment cmt"># request is good so far, continue processing the response</span>
|
|
53
|
+
614: <span class="ruby-identifier">response</span> = <span class="ruby-constant">HttpResponse</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">client</span>)
|
|
54
|
+
615:
|
|
55
|
+
616: <span class="ruby-comment cmt"># Process each handler in registered order until we run out or one finalizes the response.</span>
|
|
56
|
+
617: <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>
|
|
57
|
+
618: <span class="ruby-identifier">handler</span>.<span class="ruby-identifier">process</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>)
|
|
58
|
+
619: <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>
|
|
59
|
+
620: <span class="ruby-keyword kw">end</span>
|
|
60
|
+
621:
|
|
61
|
+
622: <span class="ruby-comment cmt"># And finally, if nobody closed the response off, we finalize it.</span>
|
|
62
|
+
623: <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>
|
|
63
|
+
624: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">finished</span>
|
|
64
|
+
625: <span class="ruby-keyword kw">end</span>
|
|
65
|
+
626: <span class="ruby-keyword kw">else</span>
|
|
66
|
+
627: <span class="ruby-comment cmt"># Didn't find it, return a stock 404 response.</span>
|
|
67
|
+
628: <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>)
|
|
68
|
+
629: <span class="ruby-keyword kw">end</span>
|
|
69
|
+
630:
|
|
70
|
+
631: <span class="ruby-keyword kw">break</span> <span class="ruby-comment cmt">#done</span>
|
|
71
|
+
632: <span class="ruby-keyword kw">else</span>
|
|
72
|
+
633: <span class="ruby-comment cmt"># Parser is not done, queue up more data to read and continue parsing</span>
|
|
73
|
+
634: <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>)
|
|
74
|
+
635: <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>
|
|
75
|
+
636:
|
|
76
|
+
637: <span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">chunk</span>
|
|
77
|
+
638: <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>
|
|
78
|
+
639: <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>)
|
|
79
|
+
640: <span class="ruby-keyword kw">end</span>
|
|
80
|
+
641: <span class="ruby-keyword kw">end</span>
|
|
81
|
+
642: <span class="ruby-keyword kw">end</span>
|
|
82
|
+
643: <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>
|
|
83
|
+
644: <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>
|
|
84
|
+
645: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">HttpParserError</span>
|
|
85
|
+
646: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$mongrel_debug_client</span>
|
|
86
|
+
647: <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>
|
|
87
|
+
648: <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>
|
|
88
|
+
649: <span class="ruby-keyword kw">end</span>
|
|
89
|
+
650: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EMFILE</span>
|
|
90
|
+
651: <span class="ruby-identifier">reap_dead_workers</span>(<span class="ruby-value str">'too many files'</span>)
|
|
91
|
+
652: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Object</span>
|
|
92
|
+
653: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"#{Time.now}: ERROR: #$!"</span>
|
|
93
|
+
654: <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>
|
|
94
|
+
655: <span class="ruby-keyword kw">ensure</span>
|
|
95
|
+
656: <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>
|
|
96
|
+
657: <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>
|
|
97
|
+
658: <span class="ruby-keyword kw">end</span>
|
|
98
|
+
659: <span class="ruby-keyword kw">end</span></pre>
|
|
20
99
|
</body>
|
|
21
100
|
</html>
|
|
@@ -5,18 +5,28 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>reap_dead_workers (Mongrel::HttpServer)</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
|
-
|
|
20
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 665</span>
|
|
14
|
+
665: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reap_dead_workers</span>(<span class="ruby-identifier">reason</span>=<span class="ruby-value str">'unknown'</span>)
|
|
15
|
+
666: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
|
16
|
+
667: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"#{Time.now}: Reaping #{@workers.list.length} threads for slow workers because of '#{reason}'"</span>
|
|
17
|
+
668: <span class="ruby-identifier">error_msg</span> = <span class="ruby-node">"Mongrel timed out this thread: #{reason}"</span>
|
|
18
|
+
669: <span class="ruby-identifier">mark</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
|
|
19
|
+
670: <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">w</span><span class="ruby-operator">|</span>
|
|
20
|
+
671: <span class="ruby-identifier">w</span>[<span class="ruby-identifier">:started_on</span>] = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">w</span>[<span class="ruby-identifier">:started_on</span>]
|
|
21
|
+
672:
|
|
22
|
+
673: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">mark</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">w</span>[<span class="ruby-identifier">:started_on</span>] <span class="ruby-operator">></span> <span class="ruby-ivar">@death_time</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@timeout</span>
|
|
23
|
+
674: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"Thread #{w.inspect} is too old, killing."</span>
|
|
24
|
+
675: <span class="ruby-identifier">w</span>.<span class="ruby-identifier">raise</span>(<span class="ruby-constant">TimeoutError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">error_msg</span>))
|
|
25
|
+
676: <span class="ruby-keyword kw">end</span>
|
|
26
|
+
677: <span class="ruby-keyword kw">end</span>
|
|
27
|
+
678: <span class="ruby-keyword kw">end</span>
|
|
28
|
+
679:
|
|
29
|
+
680: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">length</span>
|
|
30
|
+
681: <span class="ruby-keyword kw">end</span></pre>
|
|
21
31
|
</body>
|
|
22
32
|
</html>
|
|
@@ -5,58 +5,17 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>graceful_shutdown (Mongrel::HttpServer)</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
|
-
|
|
20
|
-
672:
|
|
21
|
-
673: <span class="ruby-ivar">@acceptor</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
|
|
22
|
-
674: <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
|
|
23
|
-
675: <span class="ruby-keyword kw">begin</span>
|
|
24
|
-
676: <span class="ruby-identifier">client</span> = <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">accept</span>
|
|
25
|
-
677: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">setsockopt</span>(<span class="ruby-constant">Socket</span><span class="ruby-operator">::</span><span class="ruby-constant">SOL_TCP</span>, <span class="ruby-identifier">$tcp_cork_opts</span>[<span class="ruby-value">0</span>], <span class="ruby-identifier">$tcp_cork_opts</span>[<span class="ruby-value">1</span>]) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$tcp_cork_opts</span>
|
|
26
|
-
678:
|
|
27
|
-
679: <span class="ruby-identifier">worker_list</span> = <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">list</span>
|
|
28
|
-
680:
|
|
29
|
-
681: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">worker_list</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">>=</span> <span class="ruby-ivar">@num_processors</span>
|
|
30
|
-
682: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"Server overloaded with #{worker_list.length} processors (#@num_processors max). Dropping connection."</span>
|
|
31
|
-
683: <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>
|
|
32
|
-
684: <span class="ruby-identifier">reap_dead_workers</span>(<span class="ruby-value str">"max processors"</span>)
|
|
33
|
-
685: <span class="ruby-keyword kw">else</span>
|
|
34
|
-
686: <span class="ruby-identifier">thread</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> { <span class="ruby-identifier">process_client</span>(<span class="ruby-identifier">client</span>) }
|
|
35
|
-
687: <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">abort_on_exception</span> = <span class="ruby-keyword kw">true</span>
|
|
36
|
-
688: <span class="ruby-identifier">thread</span>[<span class="ruby-identifier">:started_on</span>] = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
|
|
37
|
-
689: <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">thread</span>)
|
|
38
|
-
690:
|
|
39
|
-
691: <span class="ruby-identifier">sleep</span> <span class="ruby-ivar">@timeout</span><span class="ruby-operator">/</span><span class="ruby-value">100</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@timeout</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
|
40
|
-
692: <span class="ruby-keyword kw">end</span>
|
|
41
|
-
693: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">StopServer</span>
|
|
42
|
-
694: <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>
|
|
43
|
-
695: <span class="ruby-keyword kw">break</span>
|
|
44
|
-
696: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EMFILE</span>
|
|
45
|
-
697: <span class="ruby-identifier">reap_dead_workers</span>(<span class="ruby-value str">"too many open files"</span>)
|
|
46
|
-
698: <span class="ruby-identifier">sleep</span> <span class="ruby-value">0</span><span class="ruby-value">.5</span>
|
|
47
|
-
699: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ECONNABORTED</span>
|
|
48
|
-
700: <span class="ruby-comment cmt"># client closed the socket even before accept</span>
|
|
49
|
-
701: <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>
|
|
50
|
-
702: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Object</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">exc</span>
|
|
51
|
-
703: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"!!!!!! UNHANDLED EXCEPTION! #{exc}. TELL ZED HE'S A MORON."</span>
|
|
52
|
-
704: <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>
|
|
53
|
-
705: <span class="ruby-keyword kw">end</span>
|
|
54
|
-
706: <span class="ruby-keyword kw">end</span>
|
|
55
|
-
707:
|
|
56
|
-
708: <span class="ruby-identifier">graceful_shutdown</span>
|
|
57
|
-
709: <span class="ruby-keyword kw">end</span>
|
|
58
|
-
710:
|
|
59
|
-
711: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@acceptor</span>
|
|
60
|
-
712: <span class="ruby-keyword kw">end</span></pre>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 687</span>
|
|
14
|
+
687: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">graceful_shutdown</span>
|
|
15
|
+
688: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">reap_dead_workers</span>(<span class="ruby-value str">"shutdown"</span>) <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
|
16
|
+
689: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">print</span> <span class="ruby-node">"Waiting for #{@workers.list.length} requests to finish, could take #{@death_time + @timeout} seconds."</span>
|
|
17
|
+
690: <span class="ruby-identifier">sleep</span> <span class="ruby-ivar">@death_time</span> <span class="ruby-operator">/</span> <span class="ruby-value">10</span>
|
|
18
|
+
691: <span class="ruby-keyword kw">end</span>
|
|
19
|
+
692: <span class="ruby-keyword kw">end</span></pre>
|
|
61
20
|
</body>
|
|
62
21
|
</html>
|
|
@@ -5,30 +5,25 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>configure_socket_options (Mongrel::HttpServer)</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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
735: <span class="ruby-keyword kw">end</span>
|
|
29
|
-
736: <span class="ruby-keyword kw">end</span>
|
|
30
|
-
737:
|
|
31
|
-
738: <span class="ruby-identifier">handler</span>.<span class="ruby-identifier">listener</span> = <span class="ruby-keyword kw">self</span>
|
|
32
|
-
739: <span class="ruby-keyword kw">end</span></pre>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 694</span>
|
|
14
|
+
694: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configure_socket_options</span>
|
|
15
|
+
695: <span class="ruby-keyword kw">case</span> <span class="ruby-constant">RUBY_PLATFORM</span>
|
|
16
|
+
696: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/linux/</span>
|
|
17
|
+
697: <span class="ruby-comment cmt"># 9 is currently TCP_DEFER_ACCEPT</span>
|
|
18
|
+
698: <span class="ruby-identifier">$tcp_defer_accept_opts</span> = [<span class="ruby-constant">Socket</span><span class="ruby-operator">::</span><span class="ruby-constant">SOL_TCP</span>, <span class="ruby-value">9</span>, <span class="ruby-value">1</span>]
|
|
19
|
+
699: <span class="ruby-identifier">$tcp_cork_opts</span> = [<span class="ruby-constant">Socket</span><span class="ruby-operator">::</span><span class="ruby-constant">SOL_TCP</span>, <span class="ruby-value">3</span>, <span class="ruby-value">1</span>]
|
|
20
|
+
700: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/freebsd/</span>
|
|
21
|
+
701: <span class="ruby-comment cmt"># Use the HTTP accept filter if available.</span>
|
|
22
|
+
702: <span class="ruby-comment cmt"># The struct made by pack() is defined in /usr/include/sys/socket.h as accept_filter_arg</span>
|
|
23
|
+
703: <span class="ruby-keyword kw">unless</span> <span class="ruby-value">`/sbin/sysctl -nq net.inet.accf.http`</span>.<span class="ruby-identifier">empty?</span>
|
|
24
|
+
704: <span class="ruby-identifier">$tcp_defer_accept_opts</span> = [<span class="ruby-constant">Socket</span><span class="ruby-operator">::</span><span class="ruby-constant">SOL_SOCKET</span>, <span class="ruby-constant">Socket</span><span class="ruby-operator">::</span><span class="ruby-constant">SO_ACCEPTFILTER</span>, [<span class="ruby-value str">'httpready'</span>, <span class="ruby-keyword kw">nil</span>].<span class="ruby-identifier">pack</span>(<span class="ruby-value str">'a16a240'</span>)]
|
|
25
|
+
705: <span class="ruby-keyword kw">end</span>
|
|
26
|
+
706: <span class="ruby-keyword kw">end</span>
|
|
27
|
+
707: <span class="ruby-keyword kw">end</span></pre>
|
|
33
28
|
</body>
|
|
34
29
|
</html>
|
|
@@ -5,14 +5,61 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>run (Mongrel::HttpServer)</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
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 711</span>
|
|
14
|
+
711: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>
|
|
15
|
+
712: <span class="ruby-constant">BasicSocket</span>.<span class="ruby-identifier">do_not_reverse_lookup</span>=<span class="ruby-keyword kw">true</span>
|
|
16
|
+
713:
|
|
17
|
+
714: <span class="ruby-identifier">configure_socket_options</span>
|
|
18
|
+
715:
|
|
19
|
+
716: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$tcp_defer_accept_opts</span>
|
|
20
|
+
717: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">setsockopt</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">$tcp_defer_accept_opts</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
|
|
21
|
+
718: <span class="ruby-keyword kw">end</span>
|
|
22
|
+
719:
|
|
23
|
+
720: <span class="ruby-ivar">@acceptor</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
|
|
24
|
+
721: <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
|
|
25
|
+
722: <span class="ruby-keyword kw">begin</span>
|
|
26
|
+
723: <span class="ruby-identifier">client</span> = <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">accept</span>
|
|
27
|
+
724:
|
|
28
|
+
725: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$tcp_cork_opts</span>
|
|
29
|
+
726: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">setsockopt</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">$tcp_cork_opts</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
|
|
30
|
+
727: <span class="ruby-keyword kw">end</span>
|
|
31
|
+
728:
|
|
32
|
+
729: <span class="ruby-identifier">worker_list</span> = <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">list</span>
|
|
33
|
+
730:
|
|
34
|
+
731: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">worker_list</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">>=</span> <span class="ruby-ivar">@num_processors</span>
|
|
35
|
+
732: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"Server overloaded with #{worker_list.length} processors (#@num_processors max). Dropping connection."</span>
|
|
36
|
+
733: <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>
|
|
37
|
+
734: <span class="ruby-identifier">reap_dead_workers</span>(<span class="ruby-value str">"max processors"</span>)
|
|
38
|
+
735: <span class="ruby-keyword kw">else</span>
|
|
39
|
+
736: <span class="ruby-identifier">thread</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">client</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">process_client</span>(<span class="ruby-identifier">c</span>) }
|
|
40
|
+
737: <span class="ruby-identifier">thread</span>[<span class="ruby-identifier">:started_on</span>] = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
|
|
41
|
+
738: <span class="ruby-ivar">@workers</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">thread</span>)
|
|
42
|
+
739:
|
|
43
|
+
740: <span class="ruby-identifier">sleep</span> <span class="ruby-ivar">@timeout</span><span class="ruby-operator">/</span><span class="ruby-value">100</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@timeout</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
|
44
|
+
741: <span class="ruby-keyword kw">end</span>
|
|
45
|
+
742: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">StopServer</span>
|
|
46
|
+
743: <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>
|
|
47
|
+
744: <span class="ruby-keyword kw">break</span>
|
|
48
|
+
745: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EMFILE</span>
|
|
49
|
+
746: <span class="ruby-identifier">reap_dead_workers</span>(<span class="ruby-value str">"too many open files"</span>)
|
|
50
|
+
747: <span class="ruby-identifier">sleep</span> <span class="ruby-value">0</span><span class="ruby-value">.5</span>
|
|
51
|
+
748: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ECONNABORTED</span>
|
|
52
|
+
749: <span class="ruby-comment cmt"># client closed the socket even before accept</span>
|
|
53
|
+
750: <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>
|
|
54
|
+
751: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Object</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">exc</span>
|
|
55
|
+
752: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"!!!!!! UNHANDLED EXCEPTION! #{exc}. TELL ZED HE'S A MORON."</span>
|
|
56
|
+
753: <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>
|
|
57
|
+
754: <span class="ruby-keyword kw">end</span>
|
|
58
|
+
755: <span class="ruby-keyword kw">end</span>
|
|
59
|
+
756: <span class="ruby-identifier">graceful_shutdown</span>
|
|
60
|
+
757: <span class="ruby-keyword kw">end</span>
|
|
61
|
+
758:
|
|
62
|
+
759: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@acceptor</span>
|
|
63
|
+
760: <span class="ruby-keyword kw">end</span></pre>
|
|
17
64
|
</body>
|
|
18
65
|
</html>
|
|
@@ -5,18 +5,30 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>register (Mongrel::HttpServer)</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
|
-
|
|
20
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 768</span>
|
|
14
|
+
768: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">register</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">handler</span>, <span class="ruby-identifier">in_front</span>=<span class="ruby-keyword kw">false</span>)
|
|
15
|
+
769: <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">uri</span>)
|
|
16
|
+
770:
|
|
17
|
+
771: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">handlers</span>
|
|
18
|
+
772: <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">register</span>(<span class="ruby-identifier">uri</span>, [<span class="ruby-identifier">handler</span>])
|
|
19
|
+
773: <span class="ruby-keyword kw">else</span>
|
|
20
|
+
774: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">path_info</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">or</span> (<span class="ruby-identifier">script_name</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SLASH</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">path_info</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SLASH</span>)
|
|
21
|
+
775: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">in_front</span>
|
|
22
|
+
776: <span class="ruby-identifier">handlers</span>.<span class="ruby-identifier">unshift</span>(<span class="ruby-identifier">handler</span>)
|
|
23
|
+
777: <span class="ruby-keyword kw">else</span>
|
|
24
|
+
778: <span class="ruby-identifier">handlers</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">handler</span>
|
|
25
|
+
779: <span class="ruby-keyword kw">end</span>
|
|
26
|
+
780: <span class="ruby-keyword kw">else</span>
|
|
27
|
+
781: <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">register</span>(<span class="ruby-identifier">uri</span>, [<span class="ruby-identifier">handler</span>])
|
|
28
|
+
782: <span class="ruby-keyword kw">end</span>
|
|
29
|
+
783: <span class="ruby-keyword kw">end</span>
|
|
30
|
+
784:
|
|
31
|
+
785: <span class="ruby-identifier">handler</span>.<span class="ruby-identifier">listener</span> = <span class="ruby-keyword kw">self</span>
|
|
32
|
+
786: <span class="ruby-keyword kw">end</span></pre>
|
|
21
33
|
</body>
|
|
22
34
|
</html>
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>unregister (Mongrel::HttpServer)</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
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 791</span>
|
|
14
|
+
791: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unregister</span>(<span class="ruby-identifier">uri</span>)
|
|
15
|
+
792: <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">unregister</span>(<span class="ruby-identifier">uri</span>)
|
|
16
|
+
793: <span class="ruby-keyword kw">end</span></pre>
|
|
17
17
|
</body>
|
|
18
18
|
</html>
|
|
@@ -0,0 +1,22 @@
|
|
|
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>stop (Mongrel::HttpServer)</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 797</span>
|
|
14
|
+
797: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stop</span>
|
|
15
|
+
798: <span class="ruby-identifier">stopper</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
|
|
16
|
+
799: <span class="ruby-identifier">exc</span> = <span class="ruby-constant">StopServer</span>.<span class="ruby-identifier">new</span>
|
|
17
|
+
800: <span class="ruby-ivar">@acceptor</span>.<span class="ruby-identifier">raise</span>(<span class="ruby-identifier">exc</span>)
|
|
18
|
+
801: <span class="ruby-keyword kw">end</span>
|
|
19
|
+
802: <span class="ruby-identifier">stopper</span>.<span class="ruby-identifier">priority</span> = <span class="ruby-value">10</span>
|
|
20
|
+
803: <span class="ruby-keyword kw">end</span></pre>
|
|
21
|
+
</body>
|
|
22
|
+
</html>
|