rfuzz 0.6 → 0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +18 -17
- data/Rakefile +8 -3
- data/doc/rdoc/classes/RFuzz/Browser.html +229 -0
- data/doc/rdoc/classes/RFuzz/Browser.src/M000068.html +25 -0
- data/doc/rdoc/classes/RFuzz/Browser.src/M000069.html +23 -0
- data/doc/rdoc/classes/RFuzz/Browser.src/M000070.html +24 -0
- data/doc/rdoc/classes/RFuzz/HttpClient.html +10 -0
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000010.html +10 -10
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000011.html +18 -18
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000012.html +36 -35
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000013.html +35 -35
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000014.html +43 -43
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000015.html +22 -22
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000016.html +12 -12
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000017.html +18 -18
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000018.html +4 -4
- data/doc/rdoc/classes/RFuzz/HttpClient.src/M000019.html +12 -12
- data/doc/rdoc/classes/RFuzz/HttpEncoding.html +13 -0
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000001.html +12 -12
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000002.html +4 -4
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000003.html +12 -12
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000004.html +4 -4
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000005.html +18 -18
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000006.html +4 -4
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000007.html +6 -6
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000008.html +6 -6
- data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000009.html +18 -18
- data/doc/rdoc/classes/RFuzz/Notifier.src/M000044.html +3 -3
- data/doc/rdoc/classes/RFuzz/Notifier.src/M000045.html +3 -3
- data/doc/rdoc/classes/RFuzz/Notifier.src/M000046.html +3 -3
- data/doc/rdoc/classes/RFuzz/Notifier.src/M000047.html +3 -3
- data/doc/rdoc/classes/RFuzz/Notifier.src/M000048.html +3 -3
- data/doc/rdoc/classes/RFuzz/Notifier.src/M000049.html +3 -3
- data/doc/rdoc/classes/RFuzz/Session.html +11 -1
- data/doc/rdoc/classes/RFuzz/Session.src/M000020.html +16 -16
- data/doc/rdoc/classes/RFuzz/Session.src/M000021.html +4 -4
- data/doc/rdoc/classes/RFuzz/Session.src/M000022.html +4 -4
- data/doc/rdoc/classes/RFuzz/Session.src/M000023.html +20 -20
- data/doc/rdoc/classes/RFuzz/Session.src/M000024.html +5 -5
- data/doc/rdoc/classes/RFuzz/Session.src/M000025.html +5 -5
- data/doc/rdoc/classes/RFuzz/Session.src/M000026.html +12 -12
- data/doc/rdoc/classes/RFuzz/Session.src/M000027.html +15 -15
- data/doc/rdoc/classes/RFuzz/Session.src/M000028.html +5 -5
- data/doc/rdoc/classes/RFuzz/Session.src/M000029.html +4 -4
- data/doc/rdoc/classes/RFuzz/Session.src/M000030.html +4 -4
- data/doc/rdoc/classes/RFuzz/Session.src/M000031.html +9 -9
- data/doc/rdoc/classes/RFuzz.html +5 -0
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/COPYING.html +1 -1
- data/doc/rdoc/files/LICENSE.html +1 -1
- data/doc/rdoc/files/README.html +23 -24
- data/doc/rdoc/files/lib/rfuzz/browser_rb.html +109 -0
- data/doc/rdoc/files/lib/rfuzz/client_rb.html +2 -1
- data/doc/rdoc/files/lib/rfuzz/random_rb.html +1 -1
- data/doc/rdoc/files/lib/rfuzz/rfuzz_rb.html +1 -1
- data/doc/rdoc/files/lib/rfuzz/session_rb.html +1 -1
- data/doc/rdoc/files/lib/rfuzz/stats_rb.html +1 -1
- data/doc/rdoc/fr_class_index.html +1 -0
- data/doc/rdoc/fr_file_index.html +1 -0
- data/doc/rdoc/fr_method_index.html +9 -6
- data/examples/cl_watcher.rb +36 -0
- data/examples/mongrel_test_suite/test/http/access_authentication.rb +8 -0
- data/examples/mongrel_test_suite/test/http/appendix.rb +76 -0
- data/examples/mongrel_test_suite/test/http/base_protocol.rb +4 -7
- data/examples/mongrel_test_suite/test/http/caching_in_http.rb +140 -0
- data/examples/mongrel_test_suite/test/http/connections.rb +48 -0
- data/examples/mongrel_test_suite/test/http/content_negotiation.rb +20 -0
- data/examples/mongrel_test_suite/test/http/entity.rb +24 -0
- data/examples/mongrel_test_suite/test/http/header_field_definitions.rb +231 -0
- data/examples/mongrel_test_suite/test/http/http_message.rb +122 -0
- data/examples/mongrel_test_suite/test/http/method_definitions.rb +52 -0
- data/examples/mongrel_test_suite/test/http/protocol_parameters.rb +286 -0
- data/examples/mongrel_test_suite/test/http/request.rb +28 -0
- data/examples/mongrel_test_suite/test/http/response.rb +20 -0
- data/examples/mongrel_test_suite/test/http/security_considerations.rb +54 -0
- data/examples/mongrel_test_suite/test/http/status_code_definitions.rb +192 -0
- data/ext/fuzzrnd/fuzzrnd.c +1 -2
- data/lib/rfuzz/browser.rb +53 -0
- data/lib/rfuzz/client.rb +11 -6
- data/lib/rfuzz/session.rb +3 -1
- data/tools/rakehelp.rb +4 -2
- metadata +24 -15
- data/test/coverage/index.html +0 -388
- data/test/coverage/lib-rfuzz-client_rb.html +0 -1127
- data/test/coverage/lib-rfuzz-random_rb.html +0 -739
- data/test/coverage/lib-rfuzz-session_rb.html +0 -783
- data/test/coverage/lib-rfuzz-stats_rb.html +0 -788
- data/test/server.rb +0 -101
- data/test/test_client.rb +0 -164
- data/test/test_fuzzrnd.rb +0 -31
- data/test/test_httpparser.rb +0 -48
- data/test/test_random.rb +0 -75
- data/test/test_session.rb +0 -33
- data/test/test_stats.rb +0 -45
|
@@ -10,40 +10,40 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 286</span>
|
|
14
|
+
286: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read_chunked_encoding</span>(<span class="ruby-identifier">resp</span>, <span class="ruby-identifier">sock</span>, <span class="ruby-identifier">parser</span>)
|
|
15
|
+
287: <span class="ruby-identifier">out</span> = <span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>
|
|
16
|
+
288: <span class="ruby-identifier">input</span> = <span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">resp</span>.<span class="ruby-identifier">http_body</span>)
|
|
17
|
+
289:
|
|
18
|
+
290: <span class="ruby-comment cmt"># read from the http body first, then continue at the socket</span>
|
|
19
|
+
291: <span class="ruby-identifier">status</span>, <span class="ruby-identifier">result</span> = <span class="ruby-identifier">read_chunks</span>(<span class="ruby-identifier">input</span>, <span class="ruby-identifier">out</span>, <span class="ruby-identifier">parser</span>)
|
|
20
|
+
292:
|
|
21
|
+
293: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">status</span>
|
|
22
|
+
294: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:incomplete_trailer</span>
|
|
23
|
+
295: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">nil?</span>
|
|
24
|
+
296: <span class="ruby-identifier">sock</span>.<span class="ruby-identifier">read</span>(<span class="ruby-value">2</span>)
|
|
25
|
+
297: <span class="ruby-keyword kw">else</span>
|
|
26
|
+
298: <span class="ruby-identifier">sock</span>.<span class="ruby-identifier">read</span>((<span class="ruby-identifier">result</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">-</span> <span class="ruby-value">2</span>).<span class="ruby-identifier">abs</span>)
|
|
27
|
+
299: <span class="ruby-keyword kw">end</span>
|
|
28
|
+
300: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:incomplete_body</span>
|
|
29
|
+
301: <span class="ruby-identifier">out</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">sock</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">result</span>)) <span class="ruby-comment cmt"># read the remaining</span>
|
|
30
|
+
302: <span class="ruby-identifier">sock</span>.<span class="ruby-identifier">read</span>(<span class="ruby-value">2</span>)
|
|
31
|
+
303: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:incomplete_header</span>
|
|
32
|
+
304: <span class="ruby-comment cmt"># push what we read back onto the socket, but backwards</span>
|
|
33
|
+
305: <span class="ruby-identifier">result</span>.<span class="ruby-identifier">reverse!</span>
|
|
34
|
+
306: <span class="ruby-identifier">result</span>.<span class="ruby-identifier">each_byte</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">sock</span>.<span class="ruby-identifier">ungetc</span>(<span class="ruby-identifier">b</span>) }
|
|
35
|
+
307: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:finished</span>
|
|
36
|
+
308: <span class="ruby-comment cmt"># all done, get out</span>
|
|
37
|
+
309: <span class="ruby-identifier">out</span>.<span class="ruby-identifier">rewind</span>; <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">out</span>.<span class="ruby-identifier">read</span>
|
|
38
|
+
310: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:eof_error</span>
|
|
39
|
+
311: <span class="ruby-comment cmt"># read everything we could, ignore</span>
|
|
40
|
+
312: <span class="ruby-keyword kw">end</span>
|
|
41
|
+
313:
|
|
42
|
+
314: <span class="ruby-comment cmt"># then continue reading them from the socket</span>
|
|
43
|
+
315: <span class="ruby-identifier">status</span>, <span class="ruby-identifier">result</span> = <span class="ruby-identifier">read_chunks</span>(<span class="ruby-identifier">sock</span>, <span class="ruby-identifier">out</span>, <span class="ruby-identifier">parser</span>)
|
|
44
|
+
316:
|
|
45
|
+
317: <span class="ruby-comment cmt"># and now the http_body is the chunk</span>
|
|
46
|
+
318: <span class="ruby-identifier">out</span>.<span class="ruby-identifier">rewind</span>; <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">out</span>.<span class="ruby-identifier">read</span>
|
|
47
|
+
319: <span class="ruby-keyword kw">end</span></pre>
|
|
48
48
|
</body>
|
|
49
49
|
</html>
|
|
@@ -10,48 +10,48 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 328</span>
|
|
14
|
+
328: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read_response</span>(<span class="ruby-identifier">sock</span>)
|
|
15
|
+
329: <span class="ruby-identifier">data</span>, <span class="ruby-identifier">resp</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">nil</span>
|
|
16
|
+
330: <span class="ruby-identifier">parser</span> = <span class="ruby-constant">HttpClientParser</span>.<span class="ruby-identifier">new</span>
|
|
17
|
+
331: <span class="ruby-identifier">resp</span> = <span class="ruby-constant">HttpResponse</span>.<span class="ruby-identifier">new</span>
|
|
18
|
+
332:
|
|
19
|
+
333: <span class="ruby-identifier">notify</span> <span class="ruby-identifier">:read_header</span> <span class="ruby-keyword kw">do</span>
|
|
20
|
+
334: <span class="ruby-identifier">data</span> = <span class="ruby-identifier">sock</span>.<span class="ruby-identifier">readpartial</span>(<span class="ruby-value">1024</span>)
|
|
21
|
+
335: <span class="ruby-identifier">nread</span> = <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">execute</span>(<span class="ruby-identifier">resp</span>, <span class="ruby-identifier">data</span>, <span class="ruby-value">0</span>)
|
|
22
|
+
336:
|
|
23
|
+
337: <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">finished?</span>
|
|
24
|
+
338: <span class="ruby-identifier">data</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">sock</span>.<span class="ruby-identifier">readpartial</span>(<span class="ruby-value">1024</span>)
|
|
25
|
+
339: <span class="ruby-identifier">nread</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">execute</span>(<span class="ruby-identifier">resp</span>, <span class="ruby-identifier">data</span>, <span class="ruby-identifier">nread</span>)
|
|
26
|
+
340: <span class="ruby-keyword kw">end</span>
|
|
27
|
+
341: <span class="ruby-keyword kw">end</span>
|
|
28
|
+
342:
|
|
29
|
+
343: <span class="ruby-identifier">notify</span> <span class="ruby-identifier">:read_body</span> <span class="ruby-keyword kw">do</span>
|
|
30
|
+
344: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>[<span class="ruby-constant">TRANSFER_ENCODING</span>] <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">resp</span>[<span class="ruby-constant">TRANSFER_ENCODING</span>].<span class="ruby-identifier">index</span>(<span class="ruby-value str">"chunked"</span>)
|
|
31
|
+
345: <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">http_body</span> = <span class="ruby-identifier">read_chunked_encoding</span>(<span class="ruby-identifier">resp</span>, <span class="ruby-identifier">sock</span>, <span class="ruby-identifier">parser</span>)
|
|
32
|
+
346: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">resp</span>[<span class="ruby-constant">CONTENT_LENGTH</span>]
|
|
33
|
+
347: <span class="ruby-identifier">cl</span> = <span class="ruby-identifier">resp</span>[<span class="ruby-constant">CONTENT_LENGTH</span>].<span class="ruby-identifier">to_i</span>
|
|
34
|
+
348: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cl</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> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
|
35
|
+
349: <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">http_body</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">sock</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">cl</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>)
|
|
36
|
+
350: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">cl</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>
|
|
37
|
+
351: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"Web site sucks, they said Content-Length: #{cl}, but sent a longer body length: #{resp.http_body.length}"</span>
|
|
38
|
+
352: <span class="ruby-keyword kw">end</span>
|
|
39
|
+
353: <span class="ruby-keyword kw">else</span>
|
|
40
|
+
354: <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">http_body</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">sock</span>.<span class="ruby-identifier">read</span>
|
|
41
|
+
355: <span class="ruby-keyword kw">end</span>
|
|
42
|
+
356: <span class="ruby-keyword kw">end</span>
|
|
43
|
+
357:
|
|
44
|
+
358: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>[<span class="ruby-constant">SET_COOKIE</span>]
|
|
45
|
+
359: <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>)
|
|
46
|
+
360: <span class="ruby-ivar">@cookies</span>.<span class="ruby-identifier">merge!</span> <span class="ruby-identifier">cookies</span>
|
|
47
|
+
361: <span class="ruby-ivar">@cookies</span>.<span class="ruby-identifier">delete</span> <span class="ruby-value str">"path"</span>
|
|
48
|
+
362: <span class="ruby-keyword kw">end</span>
|
|
49
|
+
363:
|
|
50
|
+
364: <span class="ruby-identifier">notify</span> <span class="ruby-identifier">:close</span> <span class="ruby-keyword kw">do</span>
|
|
51
|
+
365: <span class="ruby-identifier">sock</span>.<span class="ruby-identifier">close</span>
|
|
52
|
+
366: <span class="ruby-keyword kw">end</span>
|
|
53
|
+
367:
|
|
54
|
+
368: <span class="ruby-identifier">resp</span>
|
|
55
|
+
369: <span class="ruby-keyword kw">end</span></pre>
|
|
56
56
|
</body>
|
|
57
57
|
</html>
|
|
@@ -10,28 +10,28 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
377:
|
|
24
|
-
378: <span class="ruby-identifier">notify</span> <span class="ruby-identifier">:send_request</span> <span class="ruby-keyword kw">do</span>
|
|
25
|
-
379: <span class="ruby-identifier">sock</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">out</span>.<span class="ruby-identifier">string</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">body</span>)
|
|
26
|
-
380: <span class="ruby-identifier">sock</span>.<span class="ruby-identifier">flush</span>
|
|
27
|
-
381: <span class="ruby-keyword kw">end</span>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 373</span>
|
|
14
|
+
373: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_request</span>(<span class="ruby-identifier">method</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">req</span>)
|
|
15
|
+
374: <span class="ruby-keyword kw">begin</span>
|
|
16
|
+
375: <span class="ruby-identifier">sock</span> = <span class="ruby-keyword kw">nil</span>
|
|
17
|
+
376: <span class="ruby-identifier">notify</span> <span class="ruby-identifier">:connect</span> <span class="ruby-keyword kw">do</span>
|
|
18
|
+
377: <span class="ruby-identifier">sock</span> = <span class="ruby-constant">TCPSocket</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@host</span>, <span class="ruby-ivar">@port</span>)
|
|
19
|
+
378: <span class="ruby-keyword kw">end</span>
|
|
20
|
+
379:
|
|
21
|
+
380: <span class="ruby-identifier">out</span> = <span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>
|
|
22
|
+
381: <span class="ruby-identifier">body</span> = <span class="ruby-identifier">build_request</span>(<span class="ruby-identifier">out</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">req</span>)
|
|
28
23
|
382:
|
|
29
|
-
383: <span class="ruby-
|
|
30
|
-
384:
|
|
31
|
-
385:
|
|
32
|
-
386:
|
|
33
|
-
387:
|
|
34
|
-
388:
|
|
35
|
-
389:
|
|
24
|
+
383: <span class="ruby-identifier">notify</span> <span class="ruby-identifier">:send_request</span> <span class="ruby-keyword kw">do</span>
|
|
25
|
+
384: <span class="ruby-identifier">sock</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">out</span>.<span class="ruby-identifier">string</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">body</span>)
|
|
26
|
+
385: <span class="ruby-identifier">sock</span>.<span class="ruby-identifier">flush</span>
|
|
27
|
+
386: <span class="ruby-keyword kw">end</span>
|
|
28
|
+
387:
|
|
29
|
+
388: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">read_response</span>(<span class="ruby-identifier">sock</span>)
|
|
30
|
+
389: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Object</span>
|
|
31
|
+
390: <span class="ruby-identifier">raise</span> <span class="ruby-identifier">$!</span>
|
|
32
|
+
391: <span class="ruby-keyword kw">ensure</span>
|
|
33
|
+
392: <span class="ruby-identifier">sock</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">unless</span> (<span class="ruby-operator">!</span><span class="ruby-identifier">sock</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">sock</span>.<span class="ruby-identifier">closed?</span>)
|
|
34
|
+
393: <span class="ruby-keyword kw">end</span>
|
|
35
|
+
394: <span class="ruby-keyword kw">end</span></pre>
|
|
36
36
|
</body>
|
|
37
37
|
</html>
|
|
@@ -10,17 +10,17 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 401</span>
|
|
14
|
+
401: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">symbol</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
|
15
|
+
402: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@allowed_methods</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">symbol</span>
|
|
16
|
+
403: <span class="ruby-identifier">method</span> = <span class="ruby-identifier">symbol</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">upcase</span>
|
|
17
|
+
404: <span class="ruby-identifier">resp</span> = <span class="ruby-identifier">send_request</span>(<span class="ruby-identifier">method</span>, <span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>], <span class="ruby-identifier">args</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">||</span> {})
|
|
18
|
+
405: <span class="ruby-identifier">resp</span> = <span class="ruby-identifier">redirect</span>(<span class="ruby-identifier">symbol</span>, <span class="ruby-identifier">resp</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@redirect</span>
|
|
19
|
+
406:
|
|
20
|
+
407: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">resp</span>
|
|
21
|
+
408: <span class="ruby-keyword kw">else</span>
|
|
22
|
+
409: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Invalid method: #{symbol}"</span>
|
|
23
|
+
410: <span class="ruby-keyword kw">end</span>
|
|
24
|
+
411: <span class="ruby-keyword kw">end</span></pre>
|
|
25
25
|
</body>
|
|
26
26
|
</html>
|
|
@@ -10,25 +10,25 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
415:
|
|
21
|
-
416: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">location</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">host</span>) <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
|
22
|
-
417: <span class="ruby-comment cmt"># begins with the host so strip that off</span>
|
|
23
|
-
418: <span class="ruby-identifier">location</span> = <span class="ruby-identifier">location</span>[<span class="ruby-identifier">host</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">..</span> <span class="ruby-value">-1</span>]
|
|
24
|
-
419: <span class="ruby-keyword kw">end</span>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 414</span>
|
|
14
|
+
414: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">redirect</span>(<span class="ruby-identifier">method</span>, <span class="ruby-identifier">resp</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
|
15
|
+
415: <span class="ruby-ivar">@redirect</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span>
|
|
16
|
+
416: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">http_status</span>.<span class="ruby-identifier">index</span>(<span class="ruby-value str">"3"</span>) <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>
|
|
17
|
+
417:
|
|
18
|
+
418: <span class="ruby-identifier">host</span> = <span class="ruby-identifier">encode_host</span>(<span class="ruby-ivar">@host</span>,<span class="ruby-ivar">@port</span>)
|
|
19
|
+
419: <span class="ruby-identifier">location</span> = <span class="ruby-identifier">resp</span>[<span class="ruby-constant">LOCATION</span>]
|
|
25
20
|
420:
|
|
26
|
-
421: <span class="ruby-
|
|
27
|
-
422:
|
|
28
|
-
423:
|
|
29
|
-
424:
|
|
21
|
+
421: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">location</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">host</span>) <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
|
22
|
+
422: <span class="ruby-comment cmt"># begins with the host so strip that off</span>
|
|
23
|
+
423: <span class="ruby-identifier">location</span> = <span class="ruby-identifier">location</span>[<span class="ruby-identifier">host</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">..</span> <span class="ruby-value">-1</span>]
|
|
24
|
+
424: <span class="ruby-keyword kw">end</span>
|
|
30
25
|
425:
|
|
31
|
-
426:
|
|
32
|
-
427:
|
|
26
|
+
426: <span class="ruby-ivar">@notifier</span>.<span class="ruby-identifier">redirect</span>(<span class="ruby-identifier">:begins</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@notifier</span>
|
|
27
|
+
427: <span class="ruby-identifier">resp</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">method</span>, <span class="ruby-identifier">location</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
|
28
|
+
428: <span class="ruby-ivar">@notifier</span>.<span class="ruby-identifier">redirect</span>(<span class="ruby-identifier">:ends</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@notifier</span>
|
|
29
|
+
429: <span class="ruby-keyword kw">end</span>
|
|
30
|
+
430:
|
|
31
|
+
431: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">resp</span>
|
|
32
|
+
432: <span class="ruby-keyword kw">end</span></pre>
|
|
33
33
|
</body>
|
|
34
34
|
</html>
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 436</span>
|
|
14
|
+
436: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset</span>
|
|
15
|
+
437: <span class="ruby-ivar">@cookies</span>.<span class="ruby-identifier">clear</span>
|
|
16
|
+
438: <span class="ruby-keyword kw">end</span></pre>
|
|
17
17
|
</body>
|
|
18
18
|
</html>
|
|
@@ -10,17 +10,17 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 447</span>
|
|
14
|
+
447: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">notify</span>(<span class="ruby-identifier">event</span>)
|
|
15
|
+
448: <span class="ruby-ivar">@notifier</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">event</span>, <span class="ruby-identifier">:begins</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@notifier</span>
|
|
16
|
+
449:
|
|
17
|
+
450: <span class="ruby-keyword kw">begin</span>
|
|
18
|
+
451: <span class="ruby-keyword kw">yield</span>
|
|
19
|
+
452: <span class="ruby-ivar">@notifier</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">event</span>, <span class="ruby-identifier">:ends</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@notifier</span>
|
|
20
|
+
453: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Object</span>
|
|
21
|
+
454: <span class="ruby-ivar">@notifier</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">event</span>, <span class="ruby-identifier">:error</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@notifier</span>
|
|
22
|
+
455: <span class="ruby-identifier">raise</span> <span class="ruby-identifier">$!</span>
|
|
23
|
+
456: <span class="ruby-keyword kw">end</span>
|
|
24
|
+
457: <span class="ruby-keyword kw">end</span></pre>
|
|
25
25
|
</body>
|
|
26
26
|
</html>
|
|
@@ -108,6 +108,19 @@ but you can use it as well.
|
|
|
108
108
|
<div id="section">
|
|
109
109
|
|
|
110
110
|
|
|
111
|
+
<div id="constants-list">
|
|
112
|
+
<h3 class="section-bar">Constants</h3>
|
|
113
|
+
|
|
114
|
+
<div class="name-list">
|
|
115
|
+
<table summary="Constants">
|
|
116
|
+
<tr class="top-aligned-row context-row">
|
|
117
|
+
<td class="context-item-name">COOKIE</td>
|
|
118
|
+
<td>=</td>
|
|
119
|
+
<td class="context-item-value">"Cookie"</td>
|
|
120
|
+
</tr>
|
|
121
|
+
</table>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
111
124
|
|
|
112
125
|
|
|
113
126
|
|
|
@@ -10,17 +10,17 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 47</span>
|
|
14
|
+
47: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">encode_cookies</span>(<span class="ruby-identifier">cookies</span>)
|
|
15
|
+
48: <span class="ruby-identifier">result</span> = <span class="ruby-value str">""</span>
|
|
16
|
+
49: <span class="ruby-identifier">cookies</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
|
17
|
+
50: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Array</span>
|
|
18
|
+
51: <span class="ruby-identifier">v</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">result</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">encode_field</span>(<span class="ruby-constant">COOKIE</span>, <span class="ruby-identifier">encode_param</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">x</span>)) }
|
|
19
|
+
52: <span class="ruby-keyword kw">else</span>
|
|
20
|
+
53: <span class="ruby-identifier">result</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">encode_field</span>(<span class="ruby-constant">COOKIE</span>, <span class="ruby-identifier">encode_param</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>))
|
|
21
|
+
54: <span class="ruby-keyword kw">end</span>
|
|
22
|
+
55: <span class="ruby-keyword kw">end</span>
|
|
23
|
+
56: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">result</span>
|
|
24
|
+
57: <span class="ruby-keyword kw">end</span></pre>
|
|
25
25
|
</body>
|
|
26
26
|
</html>
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 60</span>
|
|
14
|
+
60: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">encode_field</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>)
|
|
15
|
+
61: <span class="ruby-node">"#{k}: #{v}\r\n"</span>
|
|
16
|
+
62: <span class="ruby-keyword kw">end</span></pre>
|
|
17
17
|
</body>
|
|
18
18
|
</html>
|
|
@@ -10,17 +10,17 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 66</span>
|
|
14
|
+
66: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">encode_headers</span>(<span class="ruby-identifier">head</span>)
|
|
15
|
+
67: <span class="ruby-identifier">result</span> = <span class="ruby-value str">""</span>
|
|
16
|
+
68: <span class="ruby-identifier">head</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
|
17
|
+
69: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">kind_of?</span> <span class="ruby-constant">Array</span>
|
|
18
|
+
70: <span class="ruby-identifier">v</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">result</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">encode_field</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">x</span>) }
|
|
19
|
+
71: <span class="ruby-keyword kw">else</span>
|
|
20
|
+
72: <span class="ruby-identifier">result</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">encode_field</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>)
|
|
21
|
+
73: <span class="ruby-keyword kw">end</span>
|
|
22
|
+
74: <span class="ruby-keyword kw">end</span>
|
|
23
|
+
75: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">result</span>
|
|
24
|
+
76: <span class="ruby-keyword kw">end</span></pre>
|
|
25
25
|
</body>
|
|
26
26
|
</html>
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/rfuzz/client.rb, line 79</span>
|
|
14
|
+
79: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">encode_param</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>)
|
|
15
|
+
80: <span class="ruby-identifier">escape</span>(<span class="ruby-identifier">k</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">"="</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">escape</span>(<span class="ruby-identifier">v</span>)
|
|
16
|
+
81: <span class="ruby-keyword kw">end</span></pre>
|
|
17
17
|
</body>
|
|
18
18
|
</html>
|