diff options
Diffstat (limited to 'doc/rdoc/classes/Mongrel/HttpServer.src')
5 files changed, 136 insertions, 0 deletions
diff --git a/doc/rdoc/classes/Mongrel/HttpServer.src/M000008.html b/doc/rdoc/classes/Mongrel/HttpServer.src/M000008.html new file mode 100644 index 0000000..d5b5591 --- /dev/null +++ b/doc/rdoc/classes/Mongrel/HttpServer.src/M000008.html @@ -0,0 +1,19 @@ +<?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::HttpServer)</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 114</span> +114: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">host</span>, <span class="ruby-identifier">port</span>) +115: <span class="ruby-ivar">@socket</span> = <span class="ruby-constant">TCPServer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">host</span>, <span class="ruby-identifier">port</span>) +116: <span class="ruby-ivar">@classifier</span> = <span class="ruby-constant">URIClassifier</span>.<span class="ruby-identifier">new</span> +117: <span class="ruby-keyword kw">end</span></pre> +</body> +</html>
\ No newline at end of file diff --git a/doc/rdoc/classes/Mongrel/HttpServer.src/M000009.html b/doc/rdoc/classes/Mongrel/HttpServer.src/M000009.html new file mode 100644 index 0000000..5181e70 --- /dev/null +++ b/doc/rdoc/classes/Mongrel/HttpServer.src/M000009.html @@ -0,0 +1,59 @@ +<?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>process_client (Mongrel::HttpServer)</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 122</span> +122: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_client</span>(<span class="ruby-identifier">client</span>) +123: <span class="ruby-keyword kw">begin</span> +124: <span class="ruby-identifier">parser</span> = <span class="ruby-constant">HttpParser</span>.<span class="ruby-identifier">new</span> +125: <span class="ruby-identifier">params</span> = {} +126: <span class="ruby-identifier">data</span> = <span class="ruby-value str">""</span> +127: +128: <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span> +129: <span class="ruby-identifier">data</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">client</span>.<span class="ruby-identifier">readpartial</span>(<span class="ruby-constant">CHUNK_SIZE</span>) +130: +131: <span class="ruby-identifier">nread</span> = <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">execute</span>(<span class="ruby-identifier">params</span>, <span class="ruby-identifier">data</span>) +132: +133: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">error?</span> +134: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">"parser error:"</span> +135: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">data</span> +136: <span class="ruby-keyword kw">break</span> +137: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">finished?</span> +138: <span class="ruby-identifier">script_name</span>, <span class="ruby-identifier">path_info</span>, <span class="ruby-identifier">handler</span> = <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">resolve</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value str">"PATH_INFO"</span>]) +139: +140: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">handler</span> +141: <span class="ruby-identifier">params</span>[<span class="ruby-value str">'PATH_INFO'</span>] = <span class="ruby-identifier">path_info</span> +142: <span class="ruby-identifier">params</span>[<span class="ruby-value str">'SCRIPT_NAME'</span>] = <span class="ruby-identifier">script_name</span> +143: +144: <span class="ruby-identifier">request</span> = <span class="ruby-constant">HttpRequest</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">params</span>, <span class="ruby-identifier">data</span>[<span class="ruby-identifier">nread</span> <span class="ruby-operator">...</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">length</span>], <span class="ruby-identifier">client</span>) +145: <span class="ruby-identifier">response</span> = <span class="ruby-constant">HttpResponse</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">client</span>) +146: +147: <span class="ruby-identifier">handler</span>.<span class="ruby-identifier">process</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">response</span>) +148: <span class="ruby-keyword kw">else</span> +149: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">write</span>(<span class="ruby-constant">ERROR_404_RESPONSE</span>) +150: <span class="ruby-keyword kw">end</span> +151: +152: <span class="ruby-keyword kw">break</span> +153: <span class="ruby-keyword kw">else</span> +154: <span class="ruby-comment cmt"># gotta stream and read again until we can get the parser to be character safe</span> +155: <span class="ruby-comment cmt"># TODO: make this more efficient since this means we're parsing a lot repeatedly</span> +156: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">reset</span> +157: <span class="ruby-keyword kw">end</span> +158: <span class="ruby-keyword kw">end</span> +159: <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">details</span> +160: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"ERROR: #{details}"</span> +161: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</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>) +162: <span class="ruby-keyword kw">ensure</span> +163: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">close</span> +164: <span class="ruby-keyword kw">end</span> +165: <span class="ruby-keyword kw">end</span></pre> +</body> +</html>
\ No newline at end of file diff --git a/doc/rdoc/classes/Mongrel/HttpServer.src/M000010.html b/doc/rdoc/classes/Mongrel/HttpServer.src/M000010.html new file mode 100644 index 0000000..c79c3e3 --- /dev/null +++ b/doc/rdoc/classes/Mongrel/HttpServer.src/M000010.html @@ -0,0 +1,22 @@ +<?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>run (Mongrel::HttpServer)</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 169</span> +169: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span> +170: <span class="ruby-ivar">@acceptor</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> +171: <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span> +172: <span class="ruby-identifier">process_client</span>(<span class="ruby-ivar">@socket</span>.<span class="ruby-identifier">accept</span>) +173: <span class="ruby-keyword kw">end</span> +174: <span class="ruby-keyword kw">end</span> +175: <span class="ruby-keyword kw">end</span></pre> +</body> +</html>
\ No newline at end of file diff --git a/doc/rdoc/classes/Mongrel/HttpServer.src/M000011.html b/doc/rdoc/classes/Mongrel/HttpServer.src/M000011.html new file mode 100644 index 0000000..7273b5d --- /dev/null +++ b/doc/rdoc/classes/Mongrel/HttpServer.src/M000011.html @@ -0,0 +1,18 @@ +<?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>register (Mongrel::HttpServer)</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 181</span> +181: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">register</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">handler</span>) +182: <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">register</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">handler</span>) +183: <span class="ruby-keyword kw">end</span></pre> +</body> +</html>
\ No newline at end of file diff --git a/doc/rdoc/classes/Mongrel/HttpServer.src/M000012.html b/doc/rdoc/classes/Mongrel/HttpServer.src/M000012.html new file mode 100644 index 0000000..1b8587c --- /dev/null +++ b/doc/rdoc/classes/Mongrel/HttpServer.src/M000012.html @@ -0,0 +1,18 @@ +<?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>unregister (Mongrel::HttpServer)</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 187</span> +187: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unregister</span>(<span class="ruby-identifier">uri</span>) +188: <span class="ruby-ivar">@classifier</span>.<span class="ruby-identifier">unregister</span>(<span class="ruby-identifier">uri</span>) +189: <span class="ruby-keyword kw">end</span></pre> +</body> +</html>
\ No newline at end of file |