mongrel 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +2 -0
- data/CHANGELOG +2 -0
- data/Manifest +68 -0
- data/bin/mongrel_rails +55 -22
- data/examples/camping/README +3 -0
- data/examples/httpd.conf +474 -0
- data/examples/mime.yaml +3 -0
- data/examples/mongrel.conf +9 -0
- data/examples/monitrc +57 -0
- data/ext/http11/http11.c +25 -12
- data/ext/http11/http11_parser.c +456 -331
- data/ext/http11/http11_parser.h +1 -0
- data/ext/http11/http11_parser.java.rl +170 -0
- data/ext/http11/http11_parser.rl +8 -48
- data/ext/http11/http11_parser_common.rl +54 -0
- data/ext/http11/tst.h +2 -2
- data/ext/http11/tst_cleanup.c +0 -1
- data/ext/http11/tst_insert.c +29 -3
- data/ext/http11/tst_search.c +60 -55
- data/lib/mongrel.rb +68 -53
- data/lib/mongrel/cgi.rb +3 -3
- data/lib/mongrel/command.rb +1 -1
- data/lib/mongrel/configurator.rb +41 -31
- data/lib/mongrel/debug.rb +2 -5
- data/lib/mongrel/handlers.rb +23 -9
- data/lib/mongrel/mime_types.yml +2 -1
- data/lib/mongrel/rails.rb +7 -15
- data/mongrel-public_cert.pem +20 -0
- data/mongrel.gemspec +211 -0
- data/test/jruby_socket.rb +39 -0
- data/test/test_cgi_wrapper.rb +26 -0
- data/test/test_command.rb +1 -4
- data/test/test_conditional.rb +6 -18
- data/test/test_configurator.rb +5 -8
- data/test/test_debug.rb +3 -11
- data/test/test_handlers.rb +8 -10
- data/test/test_http11.rb +24 -5
- data/test/test_redirect_handler.rb +2 -6
- data/test/test_request_progress.rb +5 -9
- data/test/test_response.rb +24 -3
- data/test/test_stats.rb +1 -3
- data/test/test_uriclassifier.rb +170 -81
- data/test/test_ws.rb +25 -24
- data/test/testhelp.rb +26 -3
- data/tools/trickletest.rb +2 -2
- metadata +138 -333
- metadata.gz.sig +0 -0
- data/Rakefile +0 -117
- data/doc/rdoc/classes/IO.html +0 -170
- data/doc/rdoc/classes/IO.src/M000003.html +0 -19
- data/doc/rdoc/classes/IO.src/M000004.html +0 -19
- data/doc/rdoc/classes/Kernel.html +0 -159
- data/doc/rdoc/classes/Kernel.src/M000012.html +0 -19
- data/doc/rdoc/classes/Kernel.src/M000013.html +0 -23
- data/doc/rdoc/classes/Mongrel.html +0 -204
- data/doc/rdoc/classes/Mongrel/CGIWrapper.html +0 -404
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000115.html +0 -25
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000116.html +0 -47
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000117.html +0 -34
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000118.html +0 -32
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000119.html +0 -25
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000120.html +0 -18
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000121.html +0 -18
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000122.html +0 -18
- data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000123.html +0 -19
- data/doc/rdoc/classes/Mongrel/Camping.html +0 -177
- data/doc/rdoc/classes/Mongrel/Camping.src/M000041.html +0 -22
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.html +0 -184
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000042.html +0 -20
- data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000043.html +0 -58
- data/doc/rdoc/classes/Mongrel/Command.html +0 -132
- data/doc/rdoc/classes/Mongrel/Command/Base.html +0 -384
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000018.html +0 -24
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000019.html +0 -42
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000020.html +0 -18
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000021.html +0 -18
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000022.html +0 -18
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000023.html +0 -18
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000024.html +0 -22
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000025.html +0 -18
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000026.html +0 -18
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000027.html +0 -18
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000028.html +0 -24
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000029.html +0 -24
- data/doc/rdoc/classes/Mongrel/Command/Base.src/M000030.html +0 -18
- data/doc/rdoc/classes/Mongrel/Command/Registry.html +0 -192
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000031.html +0 -20
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000032.html +0 -29
- data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000033.html +0 -58
- data/doc/rdoc/classes/Mongrel/Configurator.html +0 -716
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000093.html +0 -27
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000094.html +0 -31
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000095.html +0 -18
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000096.html +0 -21
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000097.html +0 -20
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000098.html +0 -23
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000099.html +0 -18
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000100.html +0 -38
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000101.html +0 -19
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000102.html +0 -39
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000103.html +0 -33
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000104.html +0 -18
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000105.html +0 -24
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000106.html +0 -19
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000107.html +0 -18
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000108.html +0 -22
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000109.html +0 -22
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000110.html +0 -18
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000111.html +0 -34
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000112.html +0 -18
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000113.html +0 -36
- data/doc/rdoc/classes/Mongrel/Configurator.src/M000114.html +0 -18
- data/doc/rdoc/classes/Mongrel/Const.html +0 -337
- data/doc/rdoc/classes/Mongrel/DeflateFilter.html +0 -188
- data/doc/rdoc/classes/Mongrel/DeflateFilter.src/M000124.html +0 -19
- data/doc/rdoc/classes/Mongrel/DeflateFilter.src/M000125.html +0 -23
- data/doc/rdoc/classes/Mongrel/DirHandler.html +0 -303
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000051.html +0 -21
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000052.html +0 -42
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000053.html +0 -38
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000054.html +0 -65
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000055.html +0 -39
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000056.html +0 -18
- data/doc/rdoc/classes/Mongrel/Error404Handler.html +0 -171
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/M000126.html +0 -18
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/M000127.html +0 -18
- data/doc/rdoc/classes/Mongrel/HeaderOut.html +0 -190
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000066.html +0 -21
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000067.html +0 -21
- data/doc/rdoc/classes/Mongrel/HttpHandler.html +0 -215
- data/doc/rdoc/classes/Mongrel/HttpHandler.src/M000072.html +0 -17
- data/doc/rdoc/classes/Mongrel/HttpHandler.src/M000073.html +0 -17
- data/doc/rdoc/classes/Mongrel/HttpHandler.src/M000074.html +0 -17
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.html +0 -210
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000014.html +0 -17
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000015.html +0 -17
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000016.html +0 -19
- data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000017.html +0 -17
- data/doc/rdoc/classes/Mongrel/HttpParams.html +0 -131
- data/doc/rdoc/classes/Mongrel/HttpParser.html +0 -278
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000044.html +0 -28
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000045.html +0 -29
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000046.html +0 -29
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000047.html +0 -59
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000048.html +0 -27
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000049.html +0 -27
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000050.html +0 -28
- data/doc/rdoc/classes/Mongrel/HttpParserError.html +0 -111
- data/doc/rdoc/classes/Mongrel/HttpRequest.html +0 -284
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000133.html +0 -50
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000134.html +0 -41
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000135.html +0 -29
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000136.html +0 -20
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000137.html +0 -20
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000138.html +0 -32
- data/doc/rdoc/classes/Mongrel/HttpResponse.html +0 -443
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000075.html +0 -25
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000076.html +0 -20
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000077.html +0 -26
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000078.html +0 -22
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000079.html +0 -22
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000080.html +0 -22
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000081.html +0 -31
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000082.html +0 -21
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000083.html +0 -20
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000084.html +0 -20
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000085.html +0 -20
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000086.html +0 -18
- data/doc/rdoc/classes/Mongrel/HttpServer.html +0 -402
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000057.html +0 -25
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000058.html +0 -100
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000059.html +0 -32
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000060.html +0 -21
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000061.html +0 -29
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000062.html +0 -65
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000063.html +0 -34
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000064.html +0 -18
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000065.html +0 -22
- data/doc/rdoc/classes/Mongrel/Rails.html +0 -112
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.html +0 -225
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000034.html +0 -37
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000035.html +0 -25
- data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000036.html +0 -26
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.html +0 -263
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000037.html +0 -23
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000038.html +0 -56
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000039.html +0 -20
- data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000040.html +0 -25
- data/doc/rdoc/classes/Mongrel/RedirectHandler.html +0 -187
- data/doc/rdoc/classes/Mongrel/RedirectHandler.src/M000131.html +0 -22
- data/doc/rdoc/classes/Mongrel/RedirectHandler.src/M000132.html +0 -27
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.html +0 -211
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/M000128.html +0 -24
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/M000129.html +0 -24
- data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/M000130.html +0 -18
- data/doc/rdoc/classes/Mongrel/Stats.html +0 -309
- data/doc/rdoc/classes/Mongrel/Stats.src/M000139.html +0 -19
- data/doc/rdoc/classes/Mongrel/Stats.src/M000140.html +0 -23
- data/doc/rdoc/classes/Mongrel/Stats.src/M000141.html +0 -26
- data/doc/rdoc/classes/Mongrel/Stats.src/M000142.html +0 -18
- data/doc/rdoc/classes/Mongrel/Stats.src/M000143.html +0 -18
- data/doc/rdoc/classes/Mongrel/Stats.src/M000144.html +0 -18
- data/doc/rdoc/classes/Mongrel/Stats.src/M000145.html +0 -23
- data/doc/rdoc/classes/Mongrel/Stats.src/M000146.html +0 -20
- data/doc/rdoc/classes/Mongrel/StatusHandler.html +0 -194
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000068.html +0 -18
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000069.html +0 -24
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000070.html +0 -42
- data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000071.html +0 -20
- data/doc/rdoc/classes/Mongrel/StopServer.html +0 -117
- data/doc/rdoc/classes/Mongrel/TimeoutError.html +0 -117
- data/doc/rdoc/classes/Mongrel/URIClassifier.html +0 -317
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000087.html +0 -18
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000088.html +0 -18
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000089.html +0 -39
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000090.html +0 -51
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000091.html +0 -36
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000092.html +0 -83
- data/doc/rdoc/classes/MongrelDbg.html +0 -209
- data/doc/rdoc/classes/MongrelDbg.src/M000007.html +0 -24
- data/doc/rdoc/classes/MongrelDbg.src/M000008.html +0 -20
- data/doc/rdoc/classes/MongrelDbg.src/M000009.html +0 -22
- data/doc/rdoc/classes/MongrelDbg.src/M000010.html +0 -21
- data/doc/rdoc/classes/MongrelDbg.src/M000011.html +0 -18
- data/doc/rdoc/classes/Mutex.html +0 -158
- data/doc/rdoc/classes/Mutex.src/M000001.html +0 -24
- data/doc/rdoc/classes/Mutex.src/M000002.html +0 -32
- data/doc/rdoc/classes/RequestLog.html +0 -115
- data/doc/rdoc/classes/RequestLog/Access.html +0 -151
- data/doc/rdoc/classes/RequestLog/Access.src/M000147.html +0 -19
- data/doc/rdoc/classes/RequestLog/Files.html +0 -144
- data/doc/rdoc/classes/RequestLog/Files.src/M000148.html +0 -19
- data/doc/rdoc/classes/RequestLog/Objects.html +0 -150
- data/doc/rdoc/classes/RequestLog/Objects.src/M000150.html +0 -51
- data/doc/rdoc/classes/RequestLog/Params.html +0 -144
- data/doc/rdoc/classes/RequestLog/Params.src/M000151.html +0 -19
- data/doc/rdoc/classes/RequestLog/Threads.html +0 -144
- data/doc/rdoc/classes/RequestLog/Threads.src/M000149.html +0 -34
- data/doc/rdoc/classes/TCPServer.html +0 -173
- data/doc/rdoc/classes/TCPServer.src/M000005.html +0 -19
- data/doc/rdoc/created.rid +0 -1
- data/doc/rdoc/files/COPYING.html +0 -168
- data/doc/rdoc/files/LICENSE.html +0 -168
- data/doc/rdoc/files/README.html +0 -213
- data/doc/rdoc/files/ext/http11/http11_c.html +0 -101
- data/doc/rdoc/files/lib/mongrel/camping_rb.html +0 -120
- data/doc/rdoc/files/lib/mongrel/cgi_rb.html +0 -120
- data/doc/rdoc/files/lib/mongrel/command_rb.html +0 -123
- data/doc/rdoc/files/lib/mongrel/configurator_rb.html +0 -111
- data/doc/rdoc/files/lib/mongrel/debug_rb.html +0 -122
- data/doc/rdoc/files/lib/mongrel/handlers_rb.html +0 -122
- data/doc/rdoc/files/lib/mongrel/init_rb.html +0 -121
- data/doc/rdoc/files/lib/mongrel/rails_rb.html +0 -123
- data/doc/rdoc/files/lib/mongrel/stats_rb.html +0 -113
- data/doc/rdoc/files/lib/mongrel/tcphack_rb.html +0 -113
- data/doc/rdoc/files/lib/mongrel_rb.html +0 -135
- data/doc/rdoc/files/lib/mutex_fix_rb.html +0 -108
- data/doc/rdoc/fr_class_index.html +0 -68
- data/doc/rdoc/fr_file_index.html +0 -42
- data/doc/rdoc/fr_method_index.html +0 -177
- data/doc/rdoc/index.html +0 -24
- data/doc/rdoc/rdoc-style.css +0 -208
- data/tools/rakehelp.rb +0 -117
@@ -1,25 +0,0 @@
|
|
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>new (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 398</span>
|
14
|
-
398: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">socket</span>)
|
15
|
-
399: <span class="ruby-ivar">@socket</span> = <span class="ruby-identifier">socket</span>
|
16
|
-
400: <span class="ruby-ivar">@body</span> = <span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>
|
17
|
-
401: <span class="ruby-ivar">@status</span> = <span class="ruby-value">404</span>
|
18
|
-
402: <span class="ruby-ivar">@header</span> = <span class="ruby-constant">HeaderOut</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>)
|
19
|
-
403: <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
|
-
404: <span class="ruby-ivar">@body_sent</span> = <span class="ruby-keyword kw">false</span>
|
21
|
-
405: <span class="ruby-ivar">@header_sent</span> = <span class="ruby-keyword kw">false</span>
|
22
|
-
406: <span class="ruby-ivar">@status_sent</span> = <span class="ruby-keyword kw">false</span>
|
23
|
-
407: <span class="ruby-keyword kw">end</span></pre>
|
24
|
-
</body>
|
25
|
-
</html>
|
@@ -1,20 +0,0 @@
|
|
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>start (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 417</span>
|
14
|
-
417: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>(<span class="ruby-identifier">status</span>=<span class="ruby-value">200</span>, <span class="ruby-identifier">finalize</span>=<span class="ruby-keyword kw">false</span>)
|
15
|
-
418: <span class="ruby-ivar">@status</span> = <span class="ruby-identifier">status</span>.<span class="ruby-identifier">to_i</span>
|
16
|
-
419: <span class="ruby-keyword kw">yield</span> <span class="ruby-ivar">@header</span>, <span class="ruby-ivar">@body</span>
|
17
|
-
420: <span class="ruby-identifier">finished</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">finalize</span>
|
18
|
-
421: <span class="ruby-keyword kw">end</span></pre>
|
19
|
-
</body>
|
20
|
-
</html>
|
@@ -1,26 +0,0 @@
|
|
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>reset (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 426</span>
|
14
|
-
426: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset</span>
|
15
|
-
427: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@body_sent</span>
|
16
|
-
428: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"You have already sent the request body."</span>
|
17
|
-
429: <span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@header_sent</span>
|
18
|
-
430: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"You have already sent the request headers."</span>
|
19
|
-
431: <span class="ruby-keyword kw">else</span>
|
20
|
-
432: <span class="ruby-ivar">@header</span>.<span class="ruby-identifier">out</span>.<span class="ruby-identifier">truncate</span>(<span class="ruby-value">0</span>)
|
21
|
-
433: <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">close</span>
|
22
|
-
434: <span class="ruby-ivar">@body</span> = <span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>
|
23
|
-
435: <span class="ruby-keyword kw">end</span>
|
24
|
-
436: <span class="ruby-keyword kw">end</span></pre>
|
25
|
-
</body>
|
26
|
-
</html>
|
@@ -1,22 +0,0 @@
|
|
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_status (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 438</span>
|
14
|
-
438: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_status</span>(<span class="ruby-identifier">content_length</span>=<span class="ruby-ivar">@body</span>.<span class="ruby-identifier">length</span>)
|
15
|
-
439: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@status_sent</span>
|
16
|
-
440: <span class="ruby-ivar">@header</span>[<span class="ruby-value str">'Content-Length'</span>] = <span class="ruby-identifier">content_length</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@status</span> <span class="ruby-operator">==</span> <span class="ruby-value">304</span>
|
17
|
-
441: <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-ivar">@status</span>, <span class="ruby-constant">HTTP_STATUS_CODES</span>[<span class="ruby-ivar">@status</span>]])
|
18
|
-
442: <span class="ruby-ivar">@status_sent</span> = <span class="ruby-keyword kw">true</span>
|
19
|
-
443: <span class="ruby-keyword kw">end</span>
|
20
|
-
444: <span class="ruby-keyword kw">end</span></pre>
|
21
|
-
</body>
|
22
|
-
</html>
|
@@ -1,22 +0,0 @@
|
|
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_header (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 446</span>
|
14
|
-
446: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_header</span>
|
15
|
-
447: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@header_sent</span>
|
16
|
-
448: <span class="ruby-ivar">@header</span>.<span class="ruby-identifier">out</span>.<span class="ruby-identifier">rewind</span>
|
17
|
-
449: <span class="ruby-identifier">write</span>(<span class="ruby-ivar">@header</span>.<span class="ruby-identifier">out</span>.<span class="ruby-identifier">read</span> <span class="ruby-operator">+</span> <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">LINE_END</span>)
|
18
|
-
450: <span class="ruby-ivar">@header_sent</span> = <span class="ruby-keyword kw">true</span>
|
19
|
-
451: <span class="ruby-keyword kw">end</span>
|
20
|
-
452: <span class="ruby-keyword kw">end</span></pre>
|
21
|
-
</body>
|
22
|
-
</html>
|
@@ -1,22 +0,0 @@
|
|
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_body (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 454</span>
|
14
|
-
454: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_body</span>
|
15
|
-
455: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@body_sent</span>
|
16
|
-
456: <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">rewind</span>
|
17
|
-
457: <span class="ruby-identifier">write</span>(<span class="ruby-ivar">@body</span>.<span class="ruby-identifier">read</span>)
|
18
|
-
458: <span class="ruby-ivar">@body_sent</span> = <span class="ruby-keyword kw">true</span>
|
19
|
-
459: <span class="ruby-keyword kw">end</span>
|
20
|
-
460: <span class="ruby-keyword kw">end</span></pre>
|
21
|
-
</body>
|
22
|
-
</html>
|
@@ -1,31 +0,0 @@
|
|
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 466</span>
|
14
|
-
466: <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
|
-
467: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">small_file</span>
|
16
|
-
468: <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
|
-
469: <span class="ruby-keyword kw">else</span>
|
18
|
-
470: <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
|
-
471: <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
|
-
472: <span class="ruby-keyword kw">begin</span>
|
21
|
-
473: <span class="ruby-identifier">write</span>(<span class="ruby-identifier">chunk</span>)
|
22
|
-
474: <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
|
-
475: <span class="ruby-keyword kw">break</span>
|
24
|
-
476: <span class="ruby-keyword kw">end</span>
|
25
|
-
477: <span class="ruby-keyword kw">end</span>
|
26
|
-
478: <span class="ruby-keyword kw">end</span>
|
27
|
-
479: <span class="ruby-keyword kw">end</span>
|
28
|
-
480: <span class="ruby-ivar">@body_sent</span> = <span class="ruby-keyword kw">true</span>
|
29
|
-
481: <span class="ruby-keyword kw">end</span></pre>
|
30
|
-
</body>
|
31
|
-
</html>
|
@@ -1,21 +0,0 @@
|
|
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>socket_error (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 483</span>
|
14
|
-
483: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">socket_error</span>(<span class="ruby-identifier">details</span>)
|
15
|
-
484: <span class="ruby-comment cmt"># ignore these since it means the client closed off early</span>
|
16
|
-
485: <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
|
-
486: <span class="ruby-identifier">done</span> = <span class="ruby-keyword kw">true</span>
|
18
|
-
487: <span class="ruby-identifier">raise</span> <span class="ruby-identifier">details</span>
|
19
|
-
488: <span class="ruby-keyword kw">end</span></pre>
|
20
|
-
</body>
|
21
|
-
</html>
|
@@ -1,20 +0,0 @@
|
|
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>write (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 490</span>
|
14
|
-
490: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write</span>(<span class="ruby-identifier">data</span>)
|
15
|
-
491: <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">data</span>)
|
16
|
-
492: <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">details</span>
|
17
|
-
493: <span class="ruby-identifier">socket_error</span>(<span class="ruby-identifier">details</span>)
|
18
|
-
494: <span class="ruby-keyword kw">end</span></pre>
|
19
|
-
</body>
|
20
|
-
</html>
|
@@ -1,20 +0,0 @@
|
|
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>finished (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 498</span>
|
14
|
-
498: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">finished</span>
|
15
|
-
499: <span class="ruby-identifier">send_status</span>
|
16
|
-
500: <span class="ruby-identifier">send_header</span>
|
17
|
-
501: <span class="ruby-identifier">send_body</span>
|
18
|
-
502: <span class="ruby-keyword kw">end</span></pre>
|
19
|
-
</body>
|
20
|
-
</html>
|
@@ -1,20 +0,0 @@
|
|
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>done= (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 506</span>
|
14
|
-
506: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">done=</span>(<span class="ruby-identifier">val</span>)
|
15
|
-
507: <span class="ruby-ivar">@status_sent</span> = <span class="ruby-keyword kw">true</span>
|
16
|
-
508: <span class="ruby-ivar">@header_sent</span> = <span class="ruby-keyword kw">true</span>
|
17
|
-
509: <span class="ruby-ivar">@body_sent</span> = <span class="ruby-keyword kw">true</span>
|
18
|
-
510: <span class="ruby-keyword kw">end</span></pre>
|
19
|
-
</body>
|
20
|
-
</html>
|
@@ -1,18 +0,0 @@
|
|
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>done (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 512</span>
|
14
|
-
512: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">done</span>
|
15
|
-
513: (<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
|
-
514: <span class="ruby-keyword kw">end</span></pre>
|
17
|
-
</body>
|
18
|
-
</html>
|
@@ -1,402 +0,0 @@
|
|
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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Class: Mongrel::HttpServer</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Class</strong></td>
|
53
|
-
<td class="class-name-in-header">Mongrel::HttpServer</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/mongrel_rb.html">
|
59
|
-
lib/mongrel.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
<tr class="top-aligned-row">
|
66
|
-
<td><strong>Parent:</strong></td>
|
67
|
-
<td>
|
68
|
-
Object
|
69
|
-
</td>
|
70
|
-
</tr>
|
71
|
-
</table>
|
72
|
-
</div>
|
73
|
-
<!-- banner header -->
|
74
|
-
|
75
|
-
<div id="bodyContent">
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
<div id="contextContent">
|
80
|
-
|
81
|
-
<div id="description">
|
82
|
-
<p>
|
83
|
-
This is the main driver of <a href="../Mongrel.html">Mongrel</a>, while the
|
84
|
-
<a href="HttpParser.html">Mongrel::HttpParser</a> and <a
|
85
|
-
href="URIClassifier.html">Mongrel::URIClassifier</a> make up the majority
|
86
|
-
of how the server functions. It‘s a very simple class that just has a
|
87
|
-
thread accepting connections and a simple <a
|
88
|
-
href="HttpServer.html#M000058">HttpServer.process_client</a> function to do
|
89
|
-
the heavy lifting with the <a href="../IO.html">IO</a> and Ruby.
|
90
|
-
</p>
|
91
|
-
<p>
|
92
|
-
You use it by doing the following:
|
93
|
-
</p>
|
94
|
-
<pre>
|
95
|
-
server = HttpServer.new("0.0.0.0", 3000)
|
96
|
-
server.register("/stuff", MyNiftyHandler.new)
|
97
|
-
server.run.join
|
98
|
-
</pre>
|
99
|
-
<p>
|
100
|
-
The last line can be just server.run if you don‘t want to join the
|
101
|
-
thread used. If you don‘t though Ruby will mysteriously just exit on
|
102
|
-
you.
|
103
|
-
</p>
|
104
|
-
<p>
|
105
|
-
Ruby‘s thread implementation is "interesting" to say the
|
106
|
-
least. Experiments with <b>many</b> different types of <a
|
107
|
-
href="../IO.html">IO</a> processing simply cannot make a dent in it. Future
|
108
|
-
releases of <a href="../Mongrel.html">Mongrel</a> will find other creative
|
109
|
-
ways to make threads faster, but don‘t hold your breath until Ruby
|
110
|
-
1.9 is actually finally useful.
|
111
|
-
</p>
|
112
|
-
|
113
|
-
</div>
|
114
|
-
|
115
|
-
|
116
|
-
</div>
|
117
|
-
|
118
|
-
<div id="method-list">
|
119
|
-
<h3 class="section-bar">Methods</h3>
|
120
|
-
|
121
|
-
<div class="name-list">
|
122
|
-
<a href="#M000061">configure_socket_options</a>
|
123
|
-
<a href="#M000060">graceful_shutdown</a>
|
124
|
-
<a href="#M000057">new</a>
|
125
|
-
<a href="#M000058">process_client</a>
|
126
|
-
<a href="#M000059">reap_dead_workers</a>
|
127
|
-
<a href="#M000063">register</a>
|
128
|
-
<a href="#M000062">run</a>
|
129
|
-
<a href="#M000065">stop</a>
|
130
|
-
<a href="#M000064">unregister</a>
|
131
|
-
</div>
|
132
|
-
</div>
|
133
|
-
|
134
|
-
</div>
|
135
|
-
|
136
|
-
|
137
|
-
<!-- if includes -->
|
138
|
-
|
139
|
-
<div id="section">
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
<div id="attribute-list">
|
146
|
-
<h3 class="section-bar">Attributes</h3>
|
147
|
-
|
148
|
-
<div class="name-list">
|
149
|
-
<table>
|
150
|
-
<tr class="top-aligned-row context-row">
|
151
|
-
<td class="context-item-name">acceptor</td>
|
152
|
-
<td class="context-item-value"> [R] </td>
|
153
|
-
<td class="context-item-desc"></td>
|
154
|
-
</tr>
|
155
|
-
<tr class="top-aligned-row context-row">
|
156
|
-
<td class="context-item-name">classifier</td>
|
157
|
-
<td class="context-item-value"> [R] </td>
|
158
|
-
<td class="context-item-desc"></td>
|
159
|
-
</tr>
|
160
|
-
<tr class="top-aligned-row context-row">
|
161
|
-
<td class="context-item-name">host</td>
|
162
|
-
<td class="context-item-value"> [R] </td>
|
163
|
-
<td class="context-item-desc"></td>
|
164
|
-
</tr>
|
165
|
-
<tr class="top-aligned-row context-row">
|
166
|
-
<td class="context-item-name">num_processors</td>
|
167
|
-
<td class="context-item-value"> [R] </td>
|
168
|
-
<td class="context-item-desc"></td>
|
169
|
-
</tr>
|
170
|
-
<tr class="top-aligned-row context-row">
|
171
|
-
<td class="context-item-name">port</td>
|
172
|
-
<td class="context-item-value"> [R] </td>
|
173
|
-
<td class="context-item-desc"></td>
|
174
|
-
</tr>
|
175
|
-
<tr class="top-aligned-row context-row">
|
176
|
-
<td class="context-item-name">timeout</td>
|
177
|
-
<td class="context-item-value"> [R] </td>
|
178
|
-
<td class="context-item-desc"></td>
|
179
|
-
</tr>
|
180
|
-
<tr class="top-aligned-row context-row">
|
181
|
-
<td class="context-item-name">workers</td>
|
182
|
-
<td class="context-item-value"> [R] </td>
|
183
|
-
<td class="context-item-desc"></td>
|
184
|
-
</tr>
|
185
|
-
</table>
|
186
|
-
</div>
|
187
|
-
</div>
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
<!-- if method_list -->
|
192
|
-
<div id="methods">
|
193
|
-
<h3 class="section-bar">Public Class methods</h3>
|
194
|
-
|
195
|
-
<div id="method-M000057" class="method-detail">
|
196
|
-
<a name="M000057"></a>
|
197
|
-
|
198
|
-
<div class="method-heading">
|
199
|
-
<a href="HttpServer.src/M000057.html" target="Code" class="method-signature"
|
200
|
-
onclick="popupCode('HttpServer.src/M000057.html');return false;">
|
201
|
-
<span class="method-name">new</span><span class="method-args">(host, port, num_processors=(2**30-1), timeout=0)</span>
|
202
|
-
</a>
|
203
|
-
</div>
|
204
|
-
|
205
|
-
<div class="method-description">
|
206
|
-
<p>
|
207
|
-
Creates a working server on host:port (strange things happen if port
|
208
|
-
isn‘t a Number). Use HttpServer::run to start the server and
|
209
|
-
HttpServer.acceptor.join to join the thread that‘s processing
|
210
|
-
incoming requests on the socket.
|
211
|
-
</p>
|
212
|
-
<p>
|
213
|
-
The num_processors optional argument is the maximum number of concurrent
|
214
|
-
processors to accept, anything over this is closed immediately to maintain
|
215
|
-
server processing performance. This may seem mean but it is the most
|
216
|
-
efficient way to deal with overload. Other schemes involve still parsing
|
217
|
-
the client‘s request which defeats the point of an overload handling
|
218
|
-
system.
|
219
|
-
</p>
|
220
|
-
<p>
|
221
|
-
The timeout parameter is a sleep timeout (in hundredths of a second) that
|
222
|
-
is placed between socket.accept calls in order to give the server a cheap
|
223
|
-
throttle time. It defaults to 0 and actually if it is 0 then the sleep is
|
224
|
-
not done at all.
|
225
|
-
</p>
|
226
|
-
</div>
|
227
|
-
</div>
|
228
|
-
|
229
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
230
|
-
|
231
|
-
<div id="method-M000061" class="method-detail">
|
232
|
-
<a name="M000061"></a>
|
233
|
-
|
234
|
-
<div class="method-heading">
|
235
|
-
<a href="HttpServer.src/M000061.html" target="Code" class="method-signature"
|
236
|
-
onclick="popupCode('HttpServer.src/M000061.html');return false;">
|
237
|
-
<span class="method-name">configure_socket_options</span><span class="method-args">()</span>
|
238
|
-
</a>
|
239
|
-
</div>
|
240
|
-
|
241
|
-
<div class="method-description">
|
242
|
-
</div>
|
243
|
-
</div>
|
244
|
-
|
245
|
-
<div id="method-M000060" class="method-detail">
|
246
|
-
<a name="M000060"></a>
|
247
|
-
|
248
|
-
<div class="method-heading">
|
249
|
-
<a href="HttpServer.src/M000060.html" target="Code" class="method-signature"
|
250
|
-
onclick="popupCode('HttpServer.src/M000060.html');return false;">
|
251
|
-
<span class="method-name">graceful_shutdown</span><span class="method-args">()</span>
|
252
|
-
</a>
|
253
|
-
</div>
|
254
|
-
|
255
|
-
<div class="method-description">
|
256
|
-
<p>
|
257
|
-
Performs a wait on all the currently running threads and kills any that
|
258
|
-
take too long. Right now it just waits 60 seconds, but will expand this to
|
259
|
-
allow setting. The @timeout setting does extend this waiting period by that
|
260
|
-
much longer.
|
261
|
-
</p>
|
262
|
-
</div>
|
263
|
-
</div>
|
264
|
-
|
265
|
-
<div id="method-M000058" class="method-detail">
|
266
|
-
<a name="M000058"></a>
|
267
|
-
|
268
|
-
<div class="method-heading">
|
269
|
-
<a href="HttpServer.src/M000058.html" target="Code" class="method-signature"
|
270
|
-
onclick="popupCode('HttpServer.src/M000058.html');return false;">
|
271
|
-
<span class="method-name">process_client</span><span class="method-args">(client)</span>
|
272
|
-
</a>
|
273
|
-
</div>
|
274
|
-
|
275
|
-
<div class="method-description">
|
276
|
-
<p>
|
277
|
-
Does the majority of the <a href="../IO.html">IO</a> processing. It has
|
278
|
-
been written in Ruby using about 7 different <a href="../IO.html">IO</a>
|
279
|
-
processing strategies and no matter how it‘s done the performance
|
280
|
-
just does not improve. It is currently carefully constructed to make sure
|
281
|
-
that it gets the best possible performance, but anyone who thinks they can
|
282
|
-
make it faster is more than welcome to take a crack at it.
|
283
|
-
</p>
|
284
|
-
</div>
|
285
|
-
</div>
|
286
|
-
|
287
|
-
<div id="method-M000059" class="method-detail">
|
288
|
-
<a name="M000059"></a>
|
289
|
-
|
290
|
-
<div class="method-heading">
|
291
|
-
<a href="HttpServer.src/M000059.html" target="Code" class="method-signature"
|
292
|
-
onclick="popupCode('HttpServer.src/M000059.html');return false;">
|
293
|
-
<span class="method-name">reap_dead_workers</span><span class="method-args">(reason='unknown')</span>
|
294
|
-
</a>
|
295
|
-
</div>
|
296
|
-
|
297
|
-
<div class="method-description">
|
298
|
-
<p>
|
299
|
-
Used internally to kill off any worker threads that have taken too long to
|
300
|
-
complete processing. Only called if there are too many processors currently
|
301
|
-
servicing. It returns the count of workers still active after the reap is
|
302
|
-
done. It only runs if there are workers to reap.
|
303
|
-
</p>
|
304
|
-
</div>
|
305
|
-
</div>
|
306
|
-
|
307
|
-
<div id="method-M000063" class="method-detail">
|
308
|
-
<a name="M000063"></a>
|
309
|
-
|
310
|
-
<div class="method-heading">
|
311
|
-
<a href="HttpServer.src/M000063.html" target="Code" class="method-signature"
|
312
|
-
onclick="popupCode('HttpServer.src/M000063.html');return false;">
|
313
|
-
<span class="method-name">register</span><span class="method-args">(uri, handler, in_front=false)</span>
|
314
|
-
</a>
|
315
|
-
</div>
|
316
|
-
|
317
|
-
<div class="method-description">
|
318
|
-
<p>
|
319
|
-
Simply registers a handler with the internal <a
|
320
|
-
href="URIClassifier.html">URIClassifier</a>. When the URI is found in the
|
321
|
-
prefix of a request then your handler‘s HttpHandler::process method
|
322
|
-
is called. See <a
|
323
|
-
href="URIClassifier.html#M000090">Mongrel::URIClassifier#register</a> for
|
324
|
-
more information.
|
325
|
-
</p>
|
326
|
-
<p>
|
327
|
-
If you set in_front=true then the passed in handler will be put in front in
|
328
|
-
the list. Otherwise it‘s placed at the end of the list.
|
329
|
-
</p>
|
330
|
-
</div>
|
331
|
-
</div>
|
332
|
-
|
333
|
-
<div id="method-M000062" class="method-detail">
|
334
|
-
<a name="M000062"></a>
|
335
|
-
|
336
|
-
<div class="method-heading">
|
337
|
-
<a href="HttpServer.src/M000062.html" target="Code" class="method-signature"
|
338
|
-
onclick="popupCode('HttpServer.src/M000062.html');return false;">
|
339
|
-
<span class="method-name">run</span><span class="method-args">()</span>
|
340
|
-
</a>
|
341
|
-
</div>
|
342
|
-
|
343
|
-
<div class="method-description">
|
344
|
-
<p>
|
345
|
-
Runs the thing. It returns the thread used so you can "join" it.
|
346
|
-
You can also access the HttpServer::acceptor attribute to get the thread
|
347
|
-
later.
|
348
|
-
</p>
|
349
|
-
</div>
|
350
|
-
</div>
|
351
|
-
|
352
|
-
<div id="method-M000065" class="method-detail">
|
353
|
-
<a name="M000065"></a>
|
354
|
-
|
355
|
-
<div class="method-heading">
|
356
|
-
<a href="HttpServer.src/M000065.html" target="Code" class="method-signature"
|
357
|
-
onclick="popupCode('HttpServer.src/M000065.html');return false;">
|
358
|
-
<span class="method-name">stop</span><span class="method-args">()</span>
|
359
|
-
</a>
|
360
|
-
</div>
|
361
|
-
|
362
|
-
<div class="method-description">
|
363
|
-
<p>
|
364
|
-
Stops the acceptor thread and then causes the worker threads to finish off
|
365
|
-
the request queue before finally exiting.
|
366
|
-
</p>
|
367
|
-
</div>
|
368
|
-
</div>
|
369
|
-
|
370
|
-
<div id="method-M000064" class="method-detail">
|
371
|
-
<a name="M000064"></a>
|
372
|
-
|
373
|
-
<div class="method-heading">
|
374
|
-
<a href="HttpServer.src/M000064.html" target="Code" class="method-signature"
|
375
|
-
onclick="popupCode('HttpServer.src/M000064.html');return false;">
|
376
|
-
<span class="method-name">unregister</span><span class="method-args">(uri)</span>
|
377
|
-
</a>
|
378
|
-
</div>
|
379
|
-
|
380
|
-
<div class="method-description">
|
381
|
-
<p>
|
382
|
-
Removes any handlers registered at the given URI. See <a
|
383
|
-
href="URIClassifier.html#M000091">Mongrel::URIClassifier#unregister</a> for
|
384
|
-
more information. Remember this removes them <b>all</b> so the entire
|
385
|
-
processing chain goes away.
|
386
|
-
</p>
|
387
|
-
</div>
|
388
|
-
</div>
|
389
|
-
|
390
|
-
|
391
|
-
</div>
|
392
|
-
|
393
|
-
|
394
|
-
</div>
|
395
|
-
|
396
|
-
|
397
|
-
<div id="validator-badges">
|
398
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
399
|
-
</div>
|
400
|
-
|
401
|
-
</body>
|
402
|
-
</html>
|