mongrel 0.2.2 → 0.3
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 +27 -25
- data/Rakefile +2 -3
- data/bin/mongrel_rails +114 -0
- data/doc/rdoc/classes/Mongrel.html +30 -0
- data/doc/rdoc/classes/Mongrel.src/M000001.html +18 -0
- data/doc/rdoc/classes/Mongrel/Const.html +2 -2
- data/doc/rdoc/classes/Mongrel/DirHandler.html +84 -21
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000009.html +7 -18
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000010.html +26 -9
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000011.html +27 -26
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000012.html +31 -0
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000013.html +38 -0
- data/doc/rdoc/classes/Mongrel/Error404Handler.html +10 -10
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000028.html → M000033.html} +4 -4
- data/doc/rdoc/classes/Mongrel/Error404Handler.src/{M000029.html → M000034.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HeaderOut.html +10 -10
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000017.html → M000019.html} +4 -4
- data/doc/rdoc/classes/Mongrel/HeaderOut.src/{M000018.html → M000020.html} +7 -7
- data/doc/rdoc/classes/Mongrel/HttpHandler.html +5 -5
- data/doc/rdoc/classes/Mongrel/HttpHandler.src/{M000023.html → M000025.html} +3 -3
- data/doc/rdoc/classes/Mongrel/HttpParser.html +35 -35
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000002.html +5 -6
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000003.html +7 -7
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000004.html +8 -20
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000005.html +20 -6
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000006.html +5 -5
- data/doc/rdoc/classes/Mongrel/HttpParser.src/M000007.html +5 -6
- data/doc/rdoc/classes/Mongrel/HttpParser.src/{M000001.html → M000008.html} +6 -6
- data/doc/rdoc/classes/Mongrel/HttpRequest.html +5 -5
- data/doc/rdoc/classes/Mongrel/HttpRequest.src/{M000030.html → M000035.html} +17 -17
- data/doc/rdoc/classes/Mongrel/HttpResponse.html +66 -21
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000026.html +8 -6
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000027.html +7 -12
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000028.html +19 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000029.html +18 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000030.html +20 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000031.html +21 -0
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000032.html +20 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.html +28 -28
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000014.html +18 -10
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000015.html +51 -5
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000016.html +9 -4
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000017.html +18 -0
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000018.html +18 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.html +31 -21
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000021.html +18 -15
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000022.html +25 -42
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000023.html +36 -0
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000024.html +84 -0
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/README.html +32 -42
- data/doc/rdoc/files/ext/http11/http11_c.html +1 -1
- data/doc/rdoc/files/lib/mongrel_rb.html +1 -1
- data/doc/rdoc/fr_method_index.html +35 -30
- data/examples/simpletest.rb +16 -6
- data/ext/http11/http11.c +19 -3
- data/ext/http11/tst_search.c +2 -3
- data/lib/mongrel.rb +108 -20
- data/test/test_uriclassifier.rb +22 -1
- metadata +25 -19
- data/doc/rdoc/classes/Mongrel/DirHandler.src/M000008.html +0 -20
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000024.html +0 -21
- data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000025.html +0 -20
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000012.html +0 -31
- data/doc/rdoc/classes/Mongrel/HttpServer.src/M000013.html +0 -64
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000019.html +0 -39
- data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000020.html +0 -51
- data/lib/#mongrel.rb# +0 -493
|
@@ -5,27 +5,16 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>new (Mongrel::DirHandler)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
444: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">entries</span>(<span class="ruby-identifier">dir</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">child</span><span class="ruby-operator">|</span>
|
|
20
|
-
445: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"<a href=\"#{base}/#{child}\">#{child}</a><br/>"</span>
|
|
21
|
-
446: <span class="ruby-keyword kw">end</span>
|
|
22
|
-
447: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"</body></html>"</span>
|
|
23
|
-
448: <span class="ruby-keyword kw">end</span>
|
|
24
|
-
449: <span class="ruby-keyword kw">else</span>
|
|
25
|
-
450: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">403</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
|
|
26
|
-
451: <span class="ruby-identifier">out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">"Directory listings not allowed"</span>)
|
|
27
|
-
452: <span class="ruby-keyword kw">end</span>
|
|
28
|
-
453: <span class="ruby-keyword kw">end</span>
|
|
29
|
-
454: <span class="ruby-keyword kw">end</span></pre>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 463</span>
|
|
14
|
+
463: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">listing_allowed</span>=<span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">index_html</span>=<span class="ruby-value str">"index.html"</span>)
|
|
15
|
+
464: <span class="ruby-ivar">@path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">path</span>)
|
|
16
|
+
465: <span class="ruby-ivar">@listing_allowed</span>=<span class="ruby-identifier">listing_allowed</span>
|
|
17
|
+
466: <span class="ruby-ivar">@index_html</span> = <span class="ruby-identifier">index_html</span>
|
|
18
|
+
467: <span class="ruby-keyword kw">end</span></pre>
|
|
30
19
|
</body>
|
|
31
20
|
</html>
|
|
@@ -5,18 +5,35 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>can_serve (Mongrel::DirHandler)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 470</span>
|
|
14
|
+
470: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">can_serve</span>(<span class="ruby-identifier">path_info</span>)
|
|
15
|
+
471: <span class="ruby-identifier">req</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@path</span>,<span class="ruby-identifier">path_info</span>), <span class="ruby-ivar">@path</span>)
|
|
16
|
+
472:
|
|
17
|
+
473: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">req</span>.<span class="ruby-identifier">index</span>(<span class="ruby-ivar">@path</span>) <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">and</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span> <span class="ruby-identifier">req</span>
|
|
18
|
+
474: <span class="ruby-comment cmt"># it exists and it's in the right location</span>
|
|
19
|
+
475: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span> <span class="ruby-identifier">req</span>
|
|
20
|
+
476: <span class="ruby-comment cmt"># the request is for a directory</span>
|
|
21
|
+
477: <span class="ruby-identifier">index</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">req</span>, <span class="ruby-ivar">@index_html</span>)
|
|
22
|
+
478: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span> <span class="ruby-identifier">index</span>
|
|
23
|
+
479: <span class="ruby-comment cmt"># serve the index</span>
|
|
24
|
+
480: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">index</span>
|
|
25
|
+
481: <span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@listing_allows</span>
|
|
26
|
+
482: <span class="ruby-comment cmt"># serve the directory</span>
|
|
27
|
+
483: <span class="ruby-identifier">req</span>
|
|
28
|
+
484: <span class="ruby-keyword kw">else</span>
|
|
29
|
+
485: <span class="ruby-comment cmt"># do not serve anything</span>
|
|
30
|
+
486: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
|
31
|
+
487: <span class="ruby-keyword kw">end</span>
|
|
32
|
+
488: <span class="ruby-keyword kw">else</span>
|
|
33
|
+
489: <span class="ruby-comment cmt"># it's a file and it's there</span>
|
|
34
|
+
490: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">req</span>
|
|
35
|
+
491: <span class="ruby-keyword kw">end</span>
|
|
36
|
+
492: <span class="ruby-keyword kw">end</span>
|
|
37
|
+
493: <span class="ruby-keyword kw">end</span></pre>
|
|
21
38
|
</body>
|
|
22
39
|
</html>
|
|
@@ -5,35 +5,36 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>send_dir_listing (Mongrel::DirHandler)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 500</span>
|
|
14
|
+
500: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_dir_listing</span>(<span class="ruby-identifier">base</span>, <span class="ruby-identifier">dir</span>, <span class="ruby-identifier">response</span>)
|
|
15
|
+
501: <span class="ruby-comment cmt"># take off any trailing / so the links come out right</span>
|
|
16
|
+
502: <span class="ruby-identifier">base</span>.<span class="ruby-identifier">chop!</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">base</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">"/"</span>[<span class="ruby-value">-1</span>]
|
|
17
|
+
503:
|
|
18
|
+
504: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@listing_allowed</span>
|
|
19
|
+
505: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">200</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
|
|
20
|
+
506: <span class="ruby-identifier">head</span>[<span class="ruby-value str">'Content-Type'</span>] = <span class="ruby-value str">"text/html"</span>
|
|
21
|
+
507: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"<html><head><title>Directory Listing</title></head><body>"</span>
|
|
22
|
+
508: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">entries</span>(<span class="ruby-identifier">dir</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">child</span><span class="ruby-operator">|</span>
|
|
23
|
+
509: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">child</span> <span class="ruby-operator">==</span> <span class="ruby-value str">"."</span>
|
|
24
|
+
510:
|
|
25
|
+
511: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">child</span> <span class="ruby-operator">==</span> <span class="ruby-value str">".."</span>
|
|
26
|
+
512: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"<a href=\"#{base}/#{child}\">Up to parent..</a><br/>"</span>
|
|
27
|
+
513: <span class="ruby-keyword kw">else</span>
|
|
28
|
+
514: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"<a href=\"#{base}/#{child}\">#{child}</a><br/>"</span>
|
|
29
|
+
515: <span class="ruby-keyword kw">end</span>
|
|
30
|
+
516: <span class="ruby-keyword kw">end</span>
|
|
31
|
+
517: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"</body></html>"</span>
|
|
32
|
+
518: <span class="ruby-keyword kw">end</span>
|
|
33
|
+
519: <span class="ruby-keyword kw">else</span>
|
|
34
|
+
520: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">403</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
|
|
35
|
+
521: <span class="ruby-identifier">out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">"Directory listings not allowed"</span>)
|
|
36
|
+
522: <span class="ruby-keyword kw">end</span>
|
|
37
|
+
523: <span class="ruby-keyword kw">end</span>
|
|
38
|
+
524: <span class="ruby-keyword kw">end</span></pre>
|
|
38
39
|
</body>
|
|
39
40
|
</html>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html>
|
|
7
|
+
<head>
|
|
8
|
+
<title>send_file (Mongrel::DirHandler)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 529</span>
|
|
14
|
+
529: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_file</span>(<span class="ruby-identifier">req</span>, <span class="ruby-identifier">response</span>)
|
|
15
|
+
530: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">200</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
|
|
16
|
+
531: <span class="ruby-comment cmt"># set the mime type from our map based on the ending</span>
|
|
17
|
+
532: <span class="ruby-identifier">dot_at</span> = <span class="ruby-identifier">req</span>.<span class="ruby-identifier">rindex</span>(<span class="ruby-value str">"."</span>)
|
|
18
|
+
533: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">dot_at</span>
|
|
19
|
+
534: <span class="ruby-identifier">ext</span> = <span class="ruby-identifier">req</span>[<span class="ruby-identifier">dot_at</span> <span class="ruby-operator">..</span> <span class="ruby-value">-1</span>]
|
|
20
|
+
535: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">MIME_TYPES</span>[<span class="ruby-identifier">ext</span>]
|
|
21
|
+
536: <span class="ruby-identifier">head</span>[<span class="ruby-value str">'Content-Type'</span>] = <span class="ruby-constant">MIME_TYPES</span>[<span class="ruby-identifier">ext</span>]
|
|
22
|
+
537: <span class="ruby-keyword kw">end</span>
|
|
23
|
+
538: <span class="ruby-keyword kw">end</span>
|
|
24
|
+
539:
|
|
25
|
+
540: <span class="ruby-identifier">open</span>(<span class="ruby-identifier">req</span>, <span class="ruby-value str">"r"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
|
|
26
|
+
541: <span class="ruby-identifier">out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">f</span>.<span class="ruby-identifier">read</span>)
|
|
27
|
+
542: <span class="ruby-keyword kw">end</span>
|
|
28
|
+
543: <span class="ruby-keyword kw">end</span>
|
|
29
|
+
544: <span class="ruby-keyword kw">end</span></pre>
|
|
30
|
+
</body>
|
|
31
|
+
</html>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html>
|
|
7
|
+
<head>
|
|
8
|
+
<title>process (Mongrel::DirHandler)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 549</span>
|
|
14
|
+
549: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>)
|
|
15
|
+
550: <span class="ruby-identifier">req</span> = <span class="ruby-identifier">can_serve</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">params</span>[<span class="ruby-value str">'PATH_INFO'</span>]
|
|
16
|
+
551: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">req</span>
|
|
17
|
+
552: <span class="ruby-comment cmt"># not found, return a 404</span>
|
|
18
|
+
553: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">404</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
|
|
19
|
+
554: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"File not found"</span>
|
|
20
|
+
555: <span class="ruby-keyword kw">end</span>
|
|
21
|
+
556: <span class="ruby-keyword kw">else</span>
|
|
22
|
+
557: <span class="ruby-keyword kw">begin</span>
|
|
23
|
+
558: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span> <span class="ruby-identifier">req</span>
|
|
24
|
+
559: <span class="ruby-identifier">send_dir_listing</span>(<span class="ruby-identifier">request</span>.<span class="ruby-identifier">params</span>[<span class="ruby-value str">"REQUEST_URI"</span>],<span class="ruby-identifier">req</span>, <span class="ruby-identifier">response</span>)
|
|
25
|
+
560: <span class="ruby-keyword kw">else</span>
|
|
26
|
+
561: <span class="ruby-identifier">send_file</span>(<span class="ruby-identifier">req</span>, <span class="ruby-identifier">response</span>)
|
|
27
|
+
562: <span class="ruby-keyword kw">end</span>
|
|
28
|
+
563: <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">details</span>
|
|
29
|
+
564: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">reset</span>
|
|
30
|
+
565: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">start</span>(<span class="ruby-value">403</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>,<span class="ruby-identifier">out</span><span class="ruby-operator">|</span>
|
|
31
|
+
566: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"Error accessing file: #{details}"</span>
|
|
32
|
+
567: <span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">details</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">"\n"</span>)
|
|
33
|
+
568: <span class="ruby-keyword kw">end</span>
|
|
34
|
+
569: <span class="ruby-keyword kw">end</span>
|
|
35
|
+
570: <span class="ruby-keyword kw">end</span>
|
|
36
|
+
571: <span class="ruby-keyword kw">end</span></pre>
|
|
37
|
+
</body>
|
|
38
|
+
</html>
|
|
@@ -96,8 +96,8 @@ custom message for special URIs.
|
|
|
96
96
|
<h3 class="section-bar">Methods</h3>
|
|
97
97
|
|
|
98
98
|
<div class="name-list">
|
|
99
|
-
<a href="#
|
|
100
|
-
<a href="#
|
|
99
|
+
<a href="#M000033">new</a>
|
|
100
|
+
<a href="#M000034">process</a>
|
|
101
101
|
</div>
|
|
102
102
|
</div>
|
|
103
103
|
|
|
@@ -119,12 +119,12 @@ custom message for special URIs.
|
|
|
119
119
|
<div id="methods">
|
|
120
120
|
<h3 class="section-bar">Public Class methods</h3>
|
|
121
121
|
|
|
122
|
-
<div id="method-
|
|
123
|
-
<a name="
|
|
122
|
+
<div id="method-M000033" class="method-detail">
|
|
123
|
+
<a name="M000033"></a>
|
|
124
124
|
|
|
125
125
|
<div class="method-heading">
|
|
126
|
-
<a href="Error404Handler.src/
|
|
127
|
-
onclick="popupCode('Error404Handler.src/
|
|
126
|
+
<a href="Error404Handler.src/M000033.html" target="Code" class="method-signature"
|
|
127
|
+
onclick="popupCode('Error404Handler.src/M000033.html');return false;">
|
|
128
128
|
<span class="method-name">new</span><span class="method-args">(msg)</span>
|
|
129
129
|
</a>
|
|
130
130
|
</div>
|
|
@@ -139,12 +139,12 @@ it’s pretty efficient.
|
|
|
139
139
|
|
|
140
140
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
141
141
|
|
|
142
|
-
<div id="method-
|
|
143
|
-
<a name="
|
|
142
|
+
<div id="method-M000034" class="method-detail">
|
|
143
|
+
<a name="M000034"></a>
|
|
144
144
|
|
|
145
145
|
<div class="method-heading">
|
|
146
|
-
<a href="Error404Handler.src/
|
|
147
|
-
onclick="popupCode('Error404Handler.src/
|
|
146
|
+
<a href="Error404Handler.src/M000034.html" target="Code" class="method-signature"
|
|
147
|
+
onclick="popupCode('Error404Handler.src/M000034.html');return false;">
|
|
148
148
|
<span class="method-name">process</span><span class="method-args">(request, response)</span>
|
|
149
149
|
</a>
|
|
150
150
|
</div>
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 424</span>
|
|
14
|
+
424: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">msg</span>)
|
|
15
|
+
425: <span class="ruby-ivar">@response</span> = <span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">ERROR_404_RESPONSE</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">msg</span>
|
|
16
|
+
426: <span class="ruby-keyword kw">end</span></pre>
|
|
17
17
|
</body>
|
|
18
18
|
</html>
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 429</span>
|
|
14
|
+
429: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>)
|
|
15
|
+
430: <span class="ruby-identifier">response</span>.<span class="ruby-identifier">socket</span>.<span class="ruby-identifier">write</span>(<span class="ruby-ivar">@response</span>)
|
|
16
|
+
431: <span class="ruby-keyword kw">end</span></pre>
|
|
17
17
|
</body>
|
|
18
18
|
</html>
|
|
@@ -101,8 +101,8 @@ there.
|
|
|
101
101
|
<h3 class="section-bar">Methods</h3>
|
|
102
102
|
|
|
103
103
|
<div class="name-list">
|
|
104
|
-
<a href="#
|
|
105
|
-
<a href="#
|
|
104
|
+
<a href="#M000020">[]=</a>
|
|
105
|
+
<a href="#M000019">new</a>
|
|
106
106
|
</div>
|
|
107
107
|
</div>
|
|
108
108
|
|
|
@@ -137,12 +137,12 @@ there.
|
|
|
137
137
|
<div id="methods">
|
|
138
138
|
<h3 class="section-bar">Public Class methods</h3>
|
|
139
139
|
|
|
140
|
-
<div id="method-
|
|
141
|
-
<a name="
|
|
140
|
+
<div id="method-M000019" class="method-detail">
|
|
141
|
+
<a name="M000019"></a>
|
|
142
142
|
|
|
143
143
|
<div class="method-heading">
|
|
144
|
-
<a href="HeaderOut.src/
|
|
145
|
-
onclick="popupCode('HeaderOut.src/
|
|
144
|
+
<a href="HeaderOut.src/M000019.html" target="Code" class="method-signature"
|
|
145
|
+
onclick="popupCode('HeaderOut.src/M000019.html');return false;">
|
|
146
146
|
<span class="method-name">new</span><span class="method-args">(out)</span>
|
|
147
147
|
</a>
|
|
148
148
|
</div>
|
|
@@ -153,12 +153,12 @@ there.
|
|
|
153
153
|
|
|
154
154
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
155
155
|
|
|
156
|
-
<div id="method-
|
|
157
|
-
<a name="
|
|
156
|
+
<div id="method-M000020" class="method-detail">
|
|
157
|
+
<a name="M000020"></a>
|
|
158
158
|
|
|
159
159
|
<div class="method-heading">
|
|
160
|
-
<a href="HeaderOut.src/
|
|
161
|
-
onclick="popupCode('HeaderOut.src/
|
|
160
|
+
<a href="HeaderOut.src/M000020.html" target="Code" class="method-signature"
|
|
161
|
+
onclick="popupCode('HeaderOut.src/M000020.html');return false;">
|
|
162
162
|
<span class="method-name">[]=</span><span class="method-args">(key,value)</span>
|
|
163
163
|
</a>
|
|
164
164
|
</div>
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 171</span>
|
|
14
|
+
171: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">out</span>)
|
|
15
|
+
172: <span class="ruby-ivar">@out</span> = <span class="ruby-identifier">out</span>
|
|
16
|
+
173: <span class="ruby-keyword kw">end</span></pre>
|
|
17
17
|
</body>
|
|
18
18
|
</html>
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 176</span>
|
|
14
|
+
176: <span class="ruby-keyword kw">def</span><span class="ruby-operator">[]=</span>(<span class="ruby-identifier">key</span>,<span class="ruby-identifier">value</span>)
|
|
15
|
+
177: <span class="ruby-ivar">@out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">key</span>)
|
|
16
|
+
178: <span class="ruby-ivar">@out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">": "</span>)
|
|
17
|
+
179: <span class="ruby-ivar">@out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">value</span>)
|
|
18
|
+
180: <span class="ruby-ivar">@out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">"\r\n"</span>)
|
|
19
|
+
181: <span class="ruby-keyword kw">end</span></pre>
|
|
20
20
|
</body>
|
|
21
21
|
</html>
|
|
@@ -95,7 +95,7 @@ back a response. Look at the <a href="HttpRequest.html">HttpRequest</a> and
|
|
|
95
95
|
<h3 class="section-bar">Methods</h3>
|
|
96
96
|
|
|
97
97
|
<div class="name-list">
|
|
98
|
-
<a href="#
|
|
98
|
+
<a href="#M000025">process</a>
|
|
99
99
|
</div>
|
|
100
100
|
</div>
|
|
101
101
|
|
|
@@ -117,12 +117,12 @@ back a response. Look at the <a href="HttpRequest.html">HttpRequest</a> and
|
|
|
117
117
|
<div id="methods">
|
|
118
118
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
119
119
|
|
|
120
|
-
<div id="method-
|
|
121
|
-
<a name="
|
|
120
|
+
<div id="method-M000025" class="method-detail">
|
|
121
|
+
<a name="M000025"></a>
|
|
122
122
|
|
|
123
123
|
<div class="method-heading">
|
|
124
|
-
<a href="HttpHandler.src/
|
|
125
|
-
onclick="popupCode('HttpHandler.src/
|
|
124
|
+
<a href="HttpHandler.src/M000025.html" target="Code" class="method-signature"
|
|
125
|
+
onclick="popupCode('HttpHandler.src/M000025.html');return false;">
|
|
126
126
|
<span class="method-name">process</span><span class="method-args">(request, response)</span>
|
|
127
127
|
</a>
|
|
128
128
|
</div>
|
|
@@ -10,8 +10,8 @@
|
|
|
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
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 276</span>
|
|
14
|
+
276: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>)
|
|
15
|
+
277: <span class="ruby-keyword kw">end</span></pre>
|
|
16
16
|
</body>
|
|
17
17
|
</html>
|
|
@@ -86,13 +86,13 @@
|
|
|
86
86
|
<h3 class="section-bar">Methods</h3>
|
|
87
87
|
|
|
88
88
|
<div class="name-list">
|
|
89
|
-
<a href="#
|
|
90
|
-
<a href="#
|
|
91
|
-
<a href="#
|
|
92
|
-
<a href="#
|
|
93
|
-
<a href="#
|
|
94
|
-
<a href="#
|
|
95
|
-
<a href="#
|
|
89
|
+
<a href="#M000006">error?</a>
|
|
90
|
+
<a href="#M000005">execute</a>
|
|
91
|
+
<a href="#M000004">finish</a>
|
|
92
|
+
<a href="#M000007">finished?</a>
|
|
93
|
+
<a href="#M000002">new</a>
|
|
94
|
+
<a href="#M000008">nread</a>
|
|
95
|
+
<a href="#M000003">reset</a>
|
|
96
96
|
</div>
|
|
97
97
|
</div>
|
|
98
98
|
|
|
@@ -114,12 +114,12 @@
|
|
|
114
114
|
<div id="methods">
|
|
115
115
|
<h3 class="section-bar">Public Class methods</h3>
|
|
116
116
|
|
|
117
|
-
<div id="method-
|
|
118
|
-
<a name="
|
|
117
|
+
<div id="method-M000002" class="method-detail">
|
|
118
|
+
<a name="M000002"></a>
|
|
119
119
|
|
|
120
120
|
<div class="method-heading">
|
|
121
|
-
<a href="HttpParser.src/
|
|
122
|
-
onclick="popupCode('HttpParser.src/
|
|
121
|
+
<a href="HttpParser.src/M000002.html" target="Code" class="method-signature"
|
|
122
|
+
onclick="popupCode('HttpParser.src/M000002.html');return false;">
|
|
123
123
|
<span class="method-name">parser.new → parser<br />
|
|
124
124
|
</span>
|
|
125
125
|
</a>
|
|
@@ -134,12 +134,12 @@ Creates a new parser.
|
|
|
134
134
|
|
|
135
135
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
136
136
|
|
|
137
|
-
<div id="method-
|
|
138
|
-
<a name="
|
|
137
|
+
<div id="method-M000006" class="method-detail">
|
|
138
|
+
<a name="M000006"></a>
|
|
139
139
|
|
|
140
140
|
<div class="method-heading">
|
|
141
|
-
<a href="HttpParser.src/
|
|
142
|
-
onclick="popupCode('HttpParser.src/
|
|
141
|
+
<a href="HttpParser.src/M000006.html" target="Code" class="method-signature"
|
|
142
|
+
onclick="popupCode('HttpParser.src/M000006.html');return false;">
|
|
143
143
|
<span class="method-name">parser.error? → true/false<br />
|
|
144
144
|
</span>
|
|
145
145
|
</a>
|
|
@@ -152,12 +152,12 @@ Tells you whether the parser is in an error state.
|
|
|
152
152
|
</div>
|
|
153
153
|
</div>
|
|
154
154
|
|
|
155
|
-
<div id="method-
|
|
156
|
-
<a name="
|
|
155
|
+
<div id="method-M000005" class="method-detail">
|
|
156
|
+
<a name="M000005"></a>
|
|
157
157
|
|
|
158
158
|
<div class="method-heading">
|
|
159
|
-
<a href="HttpParser.src/
|
|
160
|
-
onclick="popupCode('HttpParser.src/
|
|
159
|
+
<a href="HttpParser.src/M000005.html" target="Code" class="method-signature"
|
|
160
|
+
onclick="popupCode('HttpParser.src/M000005.html');return false;">
|
|
161
161
|
<span class="method-name">parser.execute(req_hash, data) → Integer<br />
|
|
162
162
|
</span>
|
|
163
163
|
</a>
|
|
@@ -180,12 +180,12 @@ handling block.
|
|
|
180
180
|
</div>
|
|
181
181
|
</div>
|
|
182
182
|
|
|
183
|
-
<div id="method-
|
|
184
|
-
<a name="
|
|
183
|
+
<div id="method-M000004" class="method-detail">
|
|
184
|
+
<a name="M000004"></a>
|
|
185
185
|
|
|
186
186
|
<div class="method-heading">
|
|
187
|
-
<a href="HttpParser.src/
|
|
188
|
-
onclick="popupCode('HttpParser.src/
|
|
187
|
+
<a href="HttpParser.src/M000004.html" target="Code" class="method-signature"
|
|
188
|
+
onclick="popupCode('HttpParser.src/M000004.html');return false;">
|
|
189
189
|
<span class="method-name">parser.finish → true/false<br />
|
|
190
190
|
</span>
|
|
191
191
|
</a>
|
|
@@ -199,12 +199,12 @@ You should call reset after finish it or bad things will happen.
|
|
|
199
199
|
</div>
|
|
200
200
|
</div>
|
|
201
201
|
|
|
202
|
-
<div id="method-
|
|
203
|
-
<a name="
|
|
202
|
+
<div id="method-M000007" class="method-detail">
|
|
203
|
+
<a name="M000007"></a>
|
|
204
204
|
|
|
205
205
|
<div class="method-heading">
|
|
206
|
-
<a href="HttpParser.src/
|
|
207
|
-
onclick="popupCode('HttpParser.src/
|
|
206
|
+
<a href="HttpParser.src/M000007.html" target="Code" class="method-signature"
|
|
207
|
+
onclick="popupCode('HttpParser.src/M000007.html');return false;">
|
|
208
208
|
<span class="method-name">parser.finished? → true/false<br />
|
|
209
209
|
</span>
|
|
210
210
|
</a>
|
|
@@ -217,12 +217,12 @@ Tells you whether the parser is finished or not and in a good state.
|
|
|
217
217
|
</div>
|
|
218
218
|
</div>
|
|
219
219
|
|
|
220
|
-
<div id="method-
|
|
221
|
-
<a name="
|
|
220
|
+
<div id="method-M000008" class="method-detail">
|
|
221
|
+
<a name="M000008"></a>
|
|
222
222
|
|
|
223
223
|
<div class="method-heading">
|
|
224
|
-
<a href="HttpParser.src/
|
|
225
|
-
onclick="popupCode('HttpParser.src/
|
|
224
|
+
<a href="HttpParser.src/M000008.html" target="Code" class="method-signature"
|
|
225
|
+
onclick="popupCode('HttpParser.src/M000008.html');return false;">
|
|
226
226
|
<span class="method-name">parser.nread → Integer<br />
|
|
227
227
|
</span>
|
|
228
228
|
</a>
|
|
@@ -237,12 +237,12 @@ execute is called.
|
|
|
237
237
|
</div>
|
|
238
238
|
</div>
|
|
239
239
|
|
|
240
|
-
<div id="method-
|
|
241
|
-
<a name="
|
|
240
|
+
<div id="method-M000003" class="method-detail">
|
|
241
|
+
<a name="M000003"></a>
|
|
242
242
|
|
|
243
243
|
<div class="method-heading">
|
|
244
|
-
<a href="HttpParser.src/
|
|
245
|
-
onclick="popupCode('HttpParser.src/
|
|
244
|
+
<a href="HttpParser.src/M000003.html" target="Code" class="method-signature"
|
|
245
|
+
onclick="popupCode('HttpParser.src/M000003.html');return false;">
|
|
246
246
|
<span class="method-name">parser.reset → nil<br />
|
|
247
247
|
</span>
|
|
248
248
|
</a>
|