doc/rdoc/classes/RFuzz/PushBackIO.src/M000014.html in rfuzz-0.8 vs doc/rdoc/classes/RFuzz/PushBackIO.src/M000014.html in rfuzz-0.9

- old
+ new

@@ -3,42 +3,17 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> - <title>read (RFuzz::PushBackIO)</title> + <title>reset (RFuzz::PushBackIO)</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/rfuzz/pushbackio.rb, line 40</span> -40: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">partial</span>=<span class="ruby-keyword kw">false</span>) -41: <span class="ruby-identifier">r</span> = <span class="ruby-identifier">pop</span>(<span class="ruby-identifier">n</span>) -42: <span class="ruby-identifier">needs</span> = <span class="ruby-identifier">n</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">r</span>.<span class="ruby-identifier">length</span> -43: -44: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">needs</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> -45: <span class="ruby-identifier">sec</span> = <span class="ruby-value str">&quot;&quot;</span> -46: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">partial</span> -47: <span class="ruby-keyword kw">begin</span> -48: <span class="ruby-identifier">protect</span> <span class="ruby-keyword kw">do</span> -49: <span class="ruby-identifier">sec</span> = <span class="ruby-ivar">@secondary</span>.<span class="ruby-identifier">readpartial</span>(<span class="ruby-identifier">needs</span>) -50: <span class="ruby-keyword kw">end</span> -51: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">EOFError</span> -52: <span class="ruby-comment cmt"># TODO: notify closed? error?</span> -53: <span class="ruby-keyword kw">end</span> -54: <span class="ruby-keyword kw">else</span> -55: <span class="ruby-identifier">protect</span> { <span class="ruby-identifier">sec</span> = <span class="ruby-ivar">@secondary</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">needs</span>)} -56: <span class="ruby-keyword kw">end</span> -57: -58: <span class="ruby-identifier">r</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">sec</span> <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;&quot;</span>) -59: -60: <span class="ruby-comment cmt"># finally, if there's nothing at all returned then this is bad</span> -61: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">r</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> -62: <span class="ruby-identifier">raise</span> <span class="ruby-constant">HttpClientError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;Server returned empty response.&quot;</span>) -63: <span class="ruby-keyword kw">end</span> -64: <span class="ruby-keyword kw">end</span> -65: -66: <span class="ruby-identifier">reset</span> -67: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">r</span> -68: <span class="ruby-keyword kw">end</span></pre> + <pre> <span class="ruby-comment cmt"># File lib/rfuzz/pushbackio.rb, line 39</span> +39: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset</span> +40: <span class="ruby-identifier">random_death</span> +41: <span class="ruby-ivar">@buffer</span>.<span class="ruby-identifier">string</span> = <span class="ruby-ivar">@buffer</span>.<span class="ruby-identifier">read</span> <span class="ruby-comment cmt"># reset out internal buffer</span> +42: <span class="ruby-keyword kw">end</span></pre> </body> </html> \ No newline at end of file