mongrel 0.3.10.1 → 0.3.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. data/Rakefile +14 -2
  2. data/bin/mongrel_rails +7 -1
  3. data/bin/mongrel_rails_service +4 -4
  4. data/lib/mongrel.rb +5 -6
  5. data/tools/rakehelp.rb +4 -2
  6. metadata +3 -134
  7. data/doc/rdoc/classes/Mongrel.html +0 -175
  8. data/doc/rdoc/classes/Mongrel/CGIWrapper.html +0 -381
  9. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000057.html +0 -24
  10. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000058.html +0 -47
  11. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000059.html +0 -34
  12. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000060.html +0 -27
  13. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000061.html +0 -25
  14. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000062.html +0 -18
  15. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000063.html +0 -18
  16. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000064.html +0 -18
  17. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000065.html +0 -19
  18. data/doc/rdoc/classes/Mongrel/Camping.html +0 -177
  19. data/doc/rdoc/classes/Mongrel/Camping.src/M000019.html +0 -22
  20. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.html +0 -165
  21. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000020.html +0 -18
  22. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000021.html +0 -27
  23. data/doc/rdoc/classes/Mongrel/Command.html +0 -119
  24. data/doc/rdoc/classes/Mongrel/Command/Base.html +0 -332
  25. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000006.html +0 -24
  26. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000007.html +0 -41
  27. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000008.html +0 -18
  28. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000009.html +0 -18
  29. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000010.html +0 -18
  30. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000011.html +0 -22
  31. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000012.html +0 -18
  32. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000013.html +0 -18
  33. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000014.html +0 -18
  34. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000015.html +0 -18
  35. data/doc/rdoc/classes/Mongrel/Command/Registry.html +0 -192
  36. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000016.html +0 -20
  37. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000017.html +0 -25
  38. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000018.html +0 -46
  39. data/doc/rdoc/classes/Mongrel/Const.html +0 -352
  40. data/doc/rdoc/classes/Mongrel/DirHandler.html +0 -283
  41. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000029.html +0 -20
  42. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000030.html +0 -42
  43. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000031.html +0 -40
  44. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000032.html +0 -31
  45. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000033.html +0 -38
  46. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000034.html +0 -18
  47. data/doc/rdoc/classes/Mongrel/Error404Handler.html +0 -171
  48. data/doc/rdoc/classes/Mongrel/Error404Handler.src/M000066.html +0 -18
  49. data/doc/rdoc/classes/Mongrel/Error404Handler.src/M000067.html +0 -18
  50. data/doc/rdoc/classes/Mongrel/HeaderOut.html +0 -185
  51. data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000041.html +0 -18
  52. data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000042.html +0 -21
  53. data/doc/rdoc/classes/Mongrel/HttpHandler.html +0 -146
  54. data/doc/rdoc/classes/Mongrel/HttpHandler.src/M000043.html +0 -17
  55. data/doc/rdoc/classes/Mongrel/HttpParser.html +0 -271
  56. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000022.html +0 -28
  57. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000023.html +0 -29
  58. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000024.html +0 -29
  59. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000025.html +0 -41
  60. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000026.html +0 -27
  61. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000027.html +0 -27
  62. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000028.html +0 -28
  63. data/doc/rdoc/classes/Mongrel/HttpRequest.html +0 -177
  64. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000068.html +0 -39
  65. data/doc/rdoc/classes/Mongrel/HttpResponse.html +0 -321
  66. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000044.html +0 -21
  67. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000045.html +0 -20
  68. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000046.html +0 -19
  69. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000047.html +0 -19
  70. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000048.html +0 -20
  71. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000049.html +0 -20
  72. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000050.html +0 -20
  73. data/doc/rdoc/classes/Mongrel/HttpServer.html +0 -310
  74. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000035.html +0 -36
  75. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000036.html +0 -57
  76. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000037.html +0 -48
  77. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000038.html +0 -18
  78. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000039.html +0 -18
  79. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000040.html +0 -23
  80. data/doc/rdoc/classes/Mongrel/StopServer.html +0 -117
  81. data/doc/rdoc/classes/Mongrel/TimeoutWorker.html +0 -117
  82. data/doc/rdoc/classes/Mongrel/URIClassifier.html +0 -301
  83. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000051.html +0 -18
  84. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000052.html +0 -18
  85. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000053.html +0 -39
  86. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000054.html +0 -51
  87. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000055.html +0 -36
  88. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000056.html +0 -83
  89. data/doc/rdoc/classes/RailsHandler.html +0 -245
  90. data/doc/rdoc/classes/RailsHandler.src/M000003.html +0 -22
  91. data/doc/rdoc/classes/RailsHandler.src/M000004.html +0 -48
  92. data/doc/rdoc/classes/RailsHandler.src/M000005.html +0 -23
  93. data/doc/rdoc/classes/TCPServer.html +0 -173
  94. data/doc/rdoc/classes/TCPServer.src/M000001.html +0 -19
  95. data/doc/rdoc/created.rid +0 -1
  96. data/doc/rdoc/files/COPYING.html +0 -756
  97. data/doc/rdoc/files/LICENSE.html +0 -756
  98. data/doc/rdoc/files/README.html +0 -302
  99. data/doc/rdoc/files/ext/http11/http11_c.html +0 -101
  100. data/doc/rdoc/files/lib/mongrel/camping_rb.html +0 -108
  101. data/doc/rdoc/files/lib/mongrel/cgi_rb.html +0 -108
  102. data/doc/rdoc/files/lib/mongrel/command_rb.html +0 -111
  103. data/doc/rdoc/files/lib/mongrel/handlers_rb.html +0 -101
  104. data/doc/rdoc/files/lib/mongrel/init_rb.html +0 -109
  105. data/doc/rdoc/files/lib/mongrel/rails_rb.html +0 -109
  106. data/doc/rdoc/files/lib/mongrel/tcphack_rb.html +0 -109
  107. data/doc/rdoc/files/lib/mongrel_rb.html +0 -116
  108. data/doc/rdoc/fr_class_index.html +0 -47
  109. data/doc/rdoc/fr_file_index.html +0 -38
  110. data/doc/rdoc/fr_method_index.html +0 -94
  111. data/doc/rdoc/index.html +0 -24
  112. data/doc/rdoc/rdoc-style.css +0 -208
@@ -1,28 +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::HttpParser)</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>/**
14
- * call-seq:
15
- * parser.new -&gt; parser
16
- *
17
- * Creates a new parser.
18
- */
19
- VALUE HttpParser_init(VALUE self)
20
- {
21
- http_parser *http = NULL;
22
- DATA_GET(self, http_parser, http);
23
- http_parser_init(http);
24
-
25
- return self;
26
- }</pre>
27
- </body>
28
- </html>
@@ -1,29 +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::HttpParser)</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>/**
14
- * call-seq:
15
- * parser.reset -&gt; nil
16
- *
17
- * Resets the parser to it's initial state so that you can reuse it
18
- * rather than making new ones.
19
- */
20
- VALUE HttpParser_reset(VALUE self)
21
- {
22
- http_parser *http = NULL;
23
- DATA_GET(self, http_parser, http);
24
- http_parser_init(http);
25
-
26
- return Qnil;
27
- }</pre>
28
- </body>
29
- </html>
@@ -1,29 +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>finish (Mongrel::HttpParser)</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>/**
14
- * call-seq:
15
- * parser.finish -&gt; true/false
16
- *
17
- * Finishes a parser early which could put in a &quot;good&quot; or bad state.
18
- * You should call reset after finish it or bad things will happen.
19
- */
20
- VALUE HttpParser_finish(VALUE self)
21
- {
22
- http_parser *http = NULL;
23
- DATA_GET(self, http_parser, http);
24
- http_parser_finish(http);
25
-
26
- return http_parser_is_finished(http) ? Qtrue : Qfalse;
27
- }</pre>
28
- </body>
29
- </html>
@@ -1,41 +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>execute (Mongrel::HttpParser)</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>/**
14
- * call-seq:
15
- * parser.execute(req_hash, data) -&gt; Integer
16
- *
17
- * Takes a Hash and a String of data, parses the String of data filling in the Hash
18
- * returning an Integer to indicate how much of the data has been read. No matter
19
- * what the return value, you should call HttpParser#finished? and HttpParser#error?
20
- * to figure out if it's done parsing or there was an error.
21
- *
22
- * This function now throws an exception when there is a parsing error. This makes
23
- * the logic for working with the parser much easier. You can still test for an
24
- * error, but now you need to wrap the parser with an exception handling block.
25
- */
26
- VALUE HttpParser_execute(VALUE self, VALUE req_hash, VALUE data)
27
- {
28
- http_parser *http = NULL;
29
- DATA_GET(self, http_parser, http);
30
-
31
- http-&gt;data = (void *)req_hash;
32
- http_parser_execute(http, RSTRING(data)-&gt;ptr, RSTRING(data)-&gt;len);
33
-
34
- if(http_parser_has_error(http)) {
35
- rb_raise(rb_eStandardError, &quot;HTTP Parsing failure&quot;);
36
- } else {
37
- return INT2FIX(http_parser_nread(http));
38
- }
39
- }</pre>
40
- </body>
41
- </html>
@@ -1,27 +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>error? (Mongrel::HttpParser)</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>/**
14
- * call-seq:
15
- * parser.error? -&gt; true/false
16
- *
17
- * Tells you whether the parser is in an error state.
18
- */
19
- VALUE HttpParser_has_error(VALUE self)
20
- {
21
- http_parser *http = NULL;
22
- DATA_GET(self, http_parser, http);
23
-
24
- return http_parser_has_error(http) ? Qtrue : Qfalse;
25
- }</pre>
26
- </body>
27
- </html>
@@ -1,27 +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::HttpParser)</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>/**
14
- * call-seq:
15
- * parser.finished? -&gt; true/false
16
- *
17
- * Tells you whether the parser is finished or not and in a good state.
18
- */
19
- VALUE HttpParser_is_finished(VALUE self)
20
- {
21
- http_parser *http = NULL;
22
- DATA_GET(self, http_parser, http);
23
-
24
- return http_parser_is_finished(http) ? Qtrue : Qfalse;
25
- }</pre>
26
- </body>
27
- </html>
@@ -1,28 +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>nread (Mongrel::HttpParser)</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>/**
14
- * call-seq:
15
- * parser.nread -&gt; Integer
16
- *
17
- * Returns the amount of data processed so far during this processing cycle. It is
18
- * set to 0 on initialize or reset calls and is incremented each time execute is called.
19
- */
20
- VALUE HttpParser_nread(VALUE self)
21
- {
22
- http_parser *http = NULL;
23
- DATA_GET(self, http_parser, http);
24
-
25
- return INT2FIX(http-&gt;nread);
26
- }</pre>
27
- </body>
28
- </html>
@@ -1,177 +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::HttpRequest</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::HttpRequest</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
- When a handler is found for a registered URI then this class is constructed
84
- and passed to your HttpHandler::process method. You should assume that
85
- <b>one</b> handler processes all requests. Included in the HttpReqeust is a
86
- HttpRequest.params Hash that matches common CGI params, and a
87
- HttpRequest.body which is a string containing the request body (raw for
88
- now).
89
- </p>
90
- <p>
91
- <a href="../Mongrel.html">Mongrel</a> really only supports small-ish
92
- request bodies right now since really huge ones have to be completely read
93
- off the wire and put into a string. Later there will be several options for
94
- efficiently handling large file uploads.
95
- </p>
96
-
97
- </div>
98
-
99
-
100
- </div>
101
-
102
- <div id="method-list">
103
- <h3 class="section-bar">Methods</h3>
104
-
105
- <div class="name-list">
106
- <a href="#M000068">new</a>&nbsp;&nbsp;
107
- </div>
108
- </div>
109
-
110
- </div>
111
-
112
-
113
- <!-- if includes -->
114
-
115
- <div id="section">
116
-
117
-
118
-
119
-
120
-
121
- <div id="attribute-list">
122
- <h3 class="section-bar">Attributes</h3>
123
-
124
- <div class="name-list">
125
- <table>
126
- <tr class="top-aligned-row context-row">
127
- <td class="context-item-name">body</td>
128
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
129
- <td class="context-item-desc"></td>
130
- </tr>
131
- <tr class="top-aligned-row context-row">
132
- <td class="context-item-name">params</td>
133
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
134
- <td class="context-item-desc"></td>
135
- </tr>
136
- </table>
137
- </div>
138
- </div>
139
-
140
-
141
-
142
- <!-- if method_list -->
143
- <div id="methods">
144
- <h3 class="section-bar">Public Class methods</h3>
145
-
146
- <div id="method-M000068" class="method-detail">
147
- <a name="M000068"></a>
148
-
149
- <div class="method-heading">
150
- <a href="HttpRequest.src/M000068.html" target="Code" class="method-signature"
151
- onclick="popupCode('HttpRequest.src/M000068.html');return false;">
152
- <span class="method-name">new</span><span class="method-args">(params, initial_body, socket)</span>
153
- </a>
154
- </div>
155
-
156
- <div class="method-description">
157
- <p>
158
- You don&#8217;t really call this. It&#8217;s made for you. Main thing it
159
- does is hook up the params, and store any remaining body data into the
160
- HttpRequest.body attribute.
161
- </p>
162
- </div>
163
- </div>
164
-
165
-
166
- </div>
167
-
168
-
169
- </div>
170
-
171
-
172
- <div id="validator-badges">
173
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
174
- </div>
175
-
176
- </body>
177
- </html>
@@ -1,39 +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::HttpRequest)</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 174</span>
14
- 174: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">params</span>, <span class="ruby-identifier">initial_body</span>, <span class="ruby-identifier">socket</span>)
15
- 175: <span class="ruby-ivar">@body</span> = <span class="ruby-identifier">initial_body</span> <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;&quot;</span>
16
- 176: <span class="ruby-ivar">@params</span> = <span class="ruby-identifier">params</span>
17
- 177: <span class="ruby-ivar">@socket</span> = <span class="ruby-identifier">socket</span>
18
- 178:
19
- 179: <span class="ruby-comment cmt"># fix up the CGI requirements</span>
20
- 180: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">CONTENT_LENGTH</span>] = <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP_CONTENT_LENGTH</span>] <span class="ruby-operator">||</span> <span class="ruby-value">0</span>
21
- 181: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">CONTENT_TYPE</span>] = <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP_CONTENT_TYPE</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP_CONTENT_TYPE</span>]
22
- 182: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">GATEWAY_INTERFACE</span>]=<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">GATEWAY_INTERFACE_VALUE</span>
23
- 183: <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">socket</span>.<span class="ruby-identifier">peeraddr</span>[<span class="ruby-value">3</span>]
24
- 184: <span class="ruby-identifier">host</span>,<span class="ruby-identifier">port</span> = <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP_HOST</span>].<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;:&quot;</span>)
25
- 185: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SERVER_NAME</span>]=<span class="ruby-identifier">host</span>
26
- 186: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SERVER_PORT</span>]=<span class="ruby-identifier">port</span> <span class="ruby-operator">||</span> <span class="ruby-value">80</span>
27
- 187: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SERVER_PROTOCOL</span>]=<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SERVER_PROTOCOL_VALUE</span>
28
- 188: <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">SERVER_SOFTWARE</span>]=<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">MONGREL_VERSION</span>
29
- 189:
30
- 190:
31
- 191: <span class="ruby-comment cmt"># now, if the initial_body isn't long enough for the content length we have to fill it</span>
32
- 192: <span class="ruby-comment cmt"># TODO: adapt for big ass stuff by writing to a temp file</span>
33
- 193: <span class="ruby-identifier">clen</span> = <span class="ruby-identifier">params</span>[<span class="ruby-constant">Const</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP_CONTENT_LENGTH</span>].<span class="ruby-identifier">to_i</span>
34
- 194: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">clen</span>
35
- 195: <span class="ruby-ivar">@body</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">clen</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">length</span>)
36
- 196: <span class="ruby-keyword kw">end</span>
37
- 197: <span class="ruby-keyword kw">end</span></pre>
38
- </body>
39
- </html>
@@ -1,321 +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::HttpResponse</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::HttpResponse</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
- Writes and controls your response to the client using the HTTP/1.1
84
- specification. You use it by simply doing:
85
- </p>
86
- <pre>
87
- response.start(200) do |head,out|
88
- head['Content-Type'] = 'text/plain'
89
- out.write(&quot;hello\n&quot;)
90
- end
91
- </pre>
92
- <p>
93
- The parameter to start is the response code&#8212;which <a
94
- href="../Mongrel.html">Mongrel</a> will translate for you based on
95
- HTTP_STATUS_CODES. The head parameter is how you write custom headers. The
96
- out parameter is where you write your body. The default status code for <a
97
- href="HttpResponse.html#M000045">HttpResponse.start</a> is 200 so the above
98
- example is redundant.
99
- </p>
100
- <p>
101
- As you can see, it&#8217;s just like using a Hash and as you do this it
102
- writes the proper header to the output on the fly. You can even intermix
103
- specifying headers and writing content. The <a
104
- href="HttpResponse.html">HttpResponse</a> class with write the things in
105
- the proper order once the HttpResponse.block is ended.
106
- </p>
107
- <p>
108
- You may also work the <a href="HttpResponse.html">HttpResponse</a> object
109
- directly using the various attributes available for the raw socket, body,
110
- header, and status codes. If you do this you&#8217;re on your own. A design
111
- decision was made to force the client to not pipeline requests. HTTP/1.1
112
- pipelining really kills the performance due to how it has to be handled and
113
- how unclear the standard is. To fix this the <a
114
- href="HttpResponse.html">HttpResponse</a> gives a &quot;Connection:
115
- close&quot; header which forces the client to close right away. The bonus
116
- for this is that it gives a pretty nice speed boost to most clients since
117
- they can close their connection immediately.
118
- </p>
119
- <p>
120
- One additional caveat is that you don&#8217;t have to specify the
121
- Content-length header as the <a href="HttpResponse.html">HttpResponse</a>
122
- will write this for you based on the out length.
123
- </p>
124
-
125
- </div>
126
-
127
-
128
- </div>
129
-
130
- <div id="method-list">
131
- <h3 class="section-bar">Methods</h3>
132
-
133
- <div class="name-list">
134
- <a href="#M000050">finished</a>&nbsp;&nbsp;
135
- <a href="#M000044">new</a>&nbsp;&nbsp;
136
- <a href="#M000046">reset</a>&nbsp;&nbsp;
137
- <a href="#M000049">send_body</a>&nbsp;&nbsp;
138
- <a href="#M000048">send_header</a>&nbsp;&nbsp;
139
- <a href="#M000047">send_status</a>&nbsp;&nbsp;
140
- <a href="#M000045">start</a>&nbsp;&nbsp;
141
- </div>
142
- </div>
143
-
144
- </div>
145
-
146
-
147
- <!-- if includes -->
148
-
149
- <div id="section">
150
-
151
-
152
-
153
-
154
-
155
- <div id="attribute-list">
156
- <h3 class="section-bar">Attributes</h3>
157
-
158
- <div class="name-list">
159
- <table>
160
- <tr class="top-aligned-row context-row">
161
- <td class="context-item-name">body</td>
162
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
163
- <td class="context-item-desc"></td>
164
- </tr>
165
- <tr class="top-aligned-row context-row">
166
- <td class="context-item-name">header</td>
167
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
168
- <td class="context-item-desc"></td>
169
- </tr>
170
- <tr class="top-aligned-row context-row">
171
- <td class="context-item-name">socket</td>
172
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
173
- <td class="context-item-desc"></td>
174
- </tr>
175
- <tr class="top-aligned-row context-row">
176
- <td class="context-item-name">status</td>
177
- <td class="context-item-value">&nbsp;[R]&nbsp;</td>
178
- <td class="context-item-desc"></td>
179
- </tr>
180
- <tr class="top-aligned-row context-row">
181
- <td class="context-item-name">status</td>
182
- <td class="context-item-value">&nbsp;[W]&nbsp;</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-M000044" class="method-detail">
196
- <a name="M000044"></a>
197
-
198
- <div class="method-heading">
199
- <a href="HttpResponse.src/M000044.html" target="Code" class="method-signature"
200
- onclick="popupCode('HttpResponse.src/M000044.html');return false;">
201
- <span class="method-name">new</span><span class="method-args">(socket)</span>
202
- </a>
203
- </div>
204
-
205
- <div class="method-description">
206
- </div>
207
- </div>
208
-
209
- <h3 class="section-bar">Public Instance methods</h3>
210
-
211
- <div id="method-M000050" class="method-detail">
212
- <a name="M000050"></a>
213
-
214
- <div class="method-heading">
215
- <a href="HttpResponse.src/M000050.html" target="Code" class="method-signature"
216
- onclick="popupCode('HttpResponse.src/M000050.html');return false;">
217
- <span class="method-name">finished</span><span class="method-args">()</span>
218
- </a>
219
- </div>
220
-
221
- <div class="method-description">
222
- <p>
223
- This takes whatever has been done to header and body and then writes it in
224
- the proper format to make an HTTP/1.1 response.
225
- </p>
226
- </div>
227
- </div>
228
-
229
- <div id="method-M000046" class="method-detail">
230
- <a name="M000046"></a>
231
-
232
- <div class="method-heading">
233
- <a href="HttpResponse.src/M000046.html" target="Code" class="method-signature"
234
- onclick="popupCode('HttpResponse.src/M000046.html');return false;">
235
- <span class="method-name">reset</span><span class="method-args">()</span>
236
- </a>
237
- </div>
238
-
239
- <div class="method-description">
240
- <p>
241
- Primarily used in exception handling to reset the response output in order
242
- to write an alternative response.
243
- </p>
244
- </div>
245
- </div>
246
-
247
- <div id="method-M000049" class="method-detail">
248
- <a name="M000049"></a>
249
-
250
- <div class="method-heading">
251
- <a href="HttpResponse.src/M000049.html" target="Code" class="method-signature"
252
- onclick="popupCode('HttpResponse.src/M000049.html');return false;">
253
- <span class="method-name">send_body</span><span class="method-args">()</span>
254
- </a>
255
- </div>
256
-
257
- <div class="method-description">
258
- </div>
259
- </div>
260
-
261
- <div id="method-M000048" class="method-detail">
262
- <a name="M000048"></a>
263
-
264
- <div class="method-heading">
265
- <a href="HttpResponse.src/M000048.html" target="Code" class="method-signature"
266
- onclick="popupCode('HttpResponse.src/M000048.html');return false;">
267
- <span class="method-name">send_header</span><span class="method-args">()</span>
268
- </a>
269
- </div>
270
-
271
- <div class="method-description">
272
- </div>
273
- </div>
274
-
275
- <div id="method-M000047" class="method-detail">
276
- <a name="M000047"></a>
277
-
278
- <div class="method-heading">
279
- <a href="HttpResponse.src/M000047.html" target="Code" class="method-signature"
280
- onclick="popupCode('HttpResponse.src/M000047.html');return false;">
281
- <span class="method-name">send_status</span><span class="method-args">()</span>
282
- </a>
283
- </div>
284
-
285
- <div class="method-description">
286
- </div>
287
- </div>
288
-
289
- <div id="method-M000045" class="method-detail">
290
- <a name="M000045"></a>
291
-
292
- <div class="method-heading">
293
- <a href="HttpResponse.src/M000045.html" target="Code" class="method-signature"
294
- onclick="popupCode('HttpResponse.src/M000045.html');return false;">
295
- <span class="method-name">start</span><span class="method-args">(status=200) {|@header, @body| ...}</span>
296
- </a>
297
- </div>
298
-
299
- <div class="method-description">
300
- <p>
301
- Receives a block passing it the header and body for you to work with. When
302
- the block is finished it writes everything you&#8217;ve done to the socket
303
- in the proper order. This lets you intermix header and body content as
304
- needed.
305
- </p>
306
- </div>
307
- </div>
308
-
309
-
310
- </div>
311
-
312
-
313
- </div>
314
-
315
-
316
- <div id="validator-badges">
317
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
318
- </div>
319
-
320
- </body>
321
- </html>