doc/rdoc/classes/RFuzz/HttpClient.src/M000025.html in rfuzz-0.8 vs doc/rdoc/classes/RFuzz/HttpClient.src/M000025.html in rfuzz-0.9

- old
+ new

@@ -3,42 +3,20 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> - <title>read_response (RFuzz::HttpClient)</title> + <title>store_cookies (RFuzz::HttpClient)</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/client.rb, line 344</span> -344: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read_response</span> -345: <span class="ruby-identifier">resp</span> = <span class="ruby-constant">HttpResponse</span>.<span class="ruby-identifier">new</span> -346: -347: <span class="ruby-identifier">notify</span> <span class="ruby-identifier">:read_header</span> <span class="ruby-keyword kw">do</span> -348: <span class="ruby-identifier">resp</span> = <span class="ruby-identifier">read_parsed_header</span> -349: <span class="ruby-keyword kw">end</span> -350: -351: <span class="ruby-identifier">notify</span> <span class="ruby-identifier">:read_body</span> <span class="ruby-keyword kw">do</span> -352: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">chunked_encoding?</span> -353: <span class="ruby-identifier">read_chunked_body</span>(<span class="ruby-identifier">resp</span>) -354: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">resp</span>[<span class="ruby-constant">CONTENT_LENGTH</span>] -355: <span class="ruby-identifier">needs</span> = <span class="ruby-identifier">resp</span>[<span class="ruby-constant">CONTENT_LENGTH</span>].<span class="ruby-identifier">to_i</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">http_body</span>.<span class="ruby-identifier">length</span> -356: <span class="ruby-comment cmt"># Some requests can actually give a content length, and then not have content</span> -357: <span class="ruby-comment cmt"># so we ignore HttpClientError exceptions and pray that's good enough</span> -358: <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">http_body</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@sock</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">needs</span>) <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> <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">HttpClientError</span> -359: <span class="ruby-keyword kw">else</span> -360: <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span> -361: <span class="ruby-keyword kw">begin</span> -362: <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">http_body</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@sock</span>.<span class="ruby-identifier">read</span>(<span class="ruby-constant">CHUNK_SIZE</span>, <span class="ruby-identifier">partial</span>=<span class="ruby-keyword kw">true</span>) -363: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">HttpClientError</span> -364: <span class="ruby-keyword kw">break</span> <span class="ruby-comment cmt"># this is fine, they closed the socket then</span> -365: <span class="ruby-keyword kw">end</span> -366: <span class="ruby-keyword kw">end</span> -367: <span class="ruby-keyword kw">end</span> -368: <span class="ruby-keyword kw">end</span> -369: -370: <span class="ruby-identifier">store_cookies</span>(<span class="ruby-identifier">resp</span>) -371: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">resp</span> -372: <span class="ruby-keyword kw">end</span></pre> + <pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 329</span> +329: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">store_cookies</span>(<span class="ruby-identifier">resp</span>) +330: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>[<span class="ruby-constant">SET_COOKIE</span>] +331: <span class="ruby-identifier">cookies</span> = <span class="ruby-identifier">query_parse</span>(<span class="ruby-identifier">resp</span>[<span class="ruby-constant">SET_COOKIE</span>], <span class="ruby-value str">';'</span>) +332: <span class="ruby-ivar">@cookies</span>.<span class="ruby-identifier">merge!</span> <span class="ruby-identifier">cookies</span> +333: <span class="ruby-ivar">@cookies</span>.<span class="ruby-identifier">delete</span> <span class="ruby-value str">&quot;path&quot;</span> +334: <span class="ruby-keyword kw">end</span> +335: <span class="ruby-keyword kw">end</span></pre> </body> </html> \ No newline at end of file