diff options
Diffstat (limited to 'doc/rdoc/classes/Mongrel/HttpRequest.src/M000021.html')
-rw-r--r-- | doc/rdoc/classes/Mongrel/HttpRequest.src/M000021.html | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/doc/rdoc/classes/Mongrel/HttpRequest.src/M000021.html b/doc/rdoc/classes/Mongrel/HttpRequest.src/M000021.html new file mode 100644 index 0000000..39c1d18 --- /dev/null +++ b/doc/rdoc/classes/Mongrel/HttpRequest.src/M000021.html @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html> +<head> + <title>new (Mongrel::HttpRequest)</title> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> + <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> +</head> +<body class="standalone-code"> + <pre> <span class="ruby-comment cmt"># File lib/mongrel.rb, line 27</span> +27: <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>) +28: <span class="ruby-ivar">@body</span> = <span class="ruby-identifier">initial_body</span> <span class="ruby-operator">||</span> <span class="ruby-value str">""</span> +29: <span class="ruby-ivar">@params</span> = <span class="ruby-identifier">params</span> +30: <span class="ruby-ivar">@socket</span> = <span class="ruby-identifier">socket</span> +31: +32: <span class="ruby-comment cmt"># fix up the CGI requirements</span> +33: <span class="ruby-identifier">params</span>[<span class="ruby-value str">'CONTENT_LENGTH'</span>] = <span class="ruby-identifier">params</span>[<span class="ruby-value str">'HTTP_CONTENT_LENGTH'</span>] <span class="ruby-operator">||</span> <span class="ruby-value">0</span> +34: +35: <span class="ruby-comment cmt"># now, if the initial_body isn't long enough for the content length we have to fill it</span> +36: <span class="ruby-comment cmt"># TODO: adapt for big ass stuff by writing to a temp file</span> +37: <span class="ruby-identifier">clen</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value str">'HTTP_CONTENT_LENGTH'</span>].<span class="ruby-identifier">to_i</span> +38: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">clen</span> +39: <span class="ruby-ivar">@body</span> <span class="ruby-operator"><<</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>) +40: <span class="ruby-keyword kw">end</span> +41: <span class="ruby-keyword kw">end</span></pre> +</body> +</html>
\ No newline at end of file |