rfuzz 0.7 → 0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. data/Rakefile +1 -1
  2. data/doc/rdoc/classes/RFuzz/Browser.html +15 -15
  3. data/doc/rdoc/classes/RFuzz/Browser.src/{M000068.html → M000083.html} +0 -0
  4. data/doc/rdoc/classes/RFuzz/Browser.src/{M000069.html → M000084.html} +0 -0
  5. data/doc/rdoc/classes/RFuzz/Browser.src/{M000070.html → M000085.html} +0 -0
  6. data/doc/rdoc/classes/RFuzz/HttpClient.html +114 -57
  7. data/doc/rdoc/classes/RFuzz/HttpClient.src/M000019.html +12 -13
  8. data/doc/rdoc/classes/RFuzz/HttpClient.src/{M000011.html → M000020.html} +20 -20
  9. data/doc/rdoc/classes/RFuzz/HttpClient.src/M000021.html +28 -0
  10. data/doc/rdoc/classes/RFuzz/HttpClient.src/M000022.html +30 -0
  11. data/doc/rdoc/classes/RFuzz/HttpClient.src/M000023.html +35 -0
  12. data/doc/rdoc/classes/RFuzz/HttpClient.src/M000024.html +22 -0
  13. data/doc/rdoc/classes/RFuzz/HttpClient.src/M000025.html +44 -0
  14. data/doc/rdoc/classes/RFuzz/HttpClient.src/M000026.html +38 -0
  15. data/doc/rdoc/classes/RFuzz/HttpClient.src/{M000016.html → M000027.html} +12 -12
  16. data/doc/rdoc/classes/RFuzz/HttpClient.src/{M000017.html → M000028.html} +20 -20
  17. data/doc/rdoc/classes/RFuzz/HttpClient.src/{M000018.html → M000029.html} +4 -4
  18. data/doc/rdoc/classes/RFuzz/HttpClient.src/M000030.html +26 -0
  19. data/doc/rdoc/classes/RFuzz/HttpClientError.html +118 -0
  20. data/doc/rdoc/classes/RFuzz/HttpEncoding.html +7 -4
  21. data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000001.html +12 -12
  22. data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000002.html +4 -4
  23. data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000003.html +12 -12
  24. data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000004.html +4 -4
  25. data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000005.html +18 -18
  26. data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000006.html +4 -4
  27. data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000007.html +6 -6
  28. data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000008.html +6 -6
  29. data/doc/rdoc/classes/RFuzz/HttpEncoding.src/M000009.html +18 -18
  30. data/doc/rdoc/classes/RFuzz/HttpResponse.html +74 -13
  31. data/doc/rdoc/classes/RFuzz/HttpResponse.src/M000031.html +22 -0
  32. data/doc/rdoc/classes/RFuzz/HttpResponse.src/M000032.html +18 -0
  33. data/doc/rdoc/classes/RFuzz/HttpResponse.src/M000033.html +18 -0
  34. data/doc/rdoc/classes/RFuzz/Notifier.html +49 -31
  35. data/doc/rdoc/classes/RFuzz/Notifier.src/{M000044.html → M000058.html} +3 -3
  36. data/doc/rdoc/classes/RFuzz/Notifier.src/{M000045.html → M000059.html} +3 -3
  37. data/doc/rdoc/classes/RFuzz/Notifier.src/{M000047.html → M000060.html} +2 -2
  38. data/doc/rdoc/classes/RFuzz/Notifier.src/{M000048.html → M000061.html} +2 -2
  39. data/doc/rdoc/classes/RFuzz/Notifier.src/{M000049.html → M000062.html} +2 -2
  40. data/doc/rdoc/classes/RFuzz/Notifier.src/{M000046.html → M000063.html} +4 -4
  41. data/doc/rdoc/classes/RFuzz/Notifier.src/M000064.html +17 -0
  42. data/doc/rdoc/classes/RFuzz/PushBackIO.html +296 -0
  43. data/doc/rdoc/classes/RFuzz/PushBackIO.src/M000010.html +19 -0
  44. data/doc/rdoc/classes/RFuzz/PushBackIO.src/M000011.html +20 -0
  45. data/doc/rdoc/classes/RFuzz/PushBackIO.src/M000012.html +19 -0
  46. data/doc/rdoc/classes/RFuzz/PushBackIO.src/M000013.html +18 -0
  47. data/doc/rdoc/classes/RFuzz/PushBackIO.src/M000014.html +44 -0
  48. data/doc/rdoc/classes/RFuzz/PushBackIO.src/M000015.html +18 -0
  49. data/doc/rdoc/classes/RFuzz/PushBackIO.src/M000016.html +18 -0
  50. data/doc/rdoc/classes/RFuzz/PushBackIO.src/M000017.html +18 -0
  51. data/doc/rdoc/classes/RFuzz/PushBackIO.src/M000018.html +22 -0
  52. data/doc/rdoc/classes/RFuzz/RandomGenerator.html +62 -62
  53. data/doc/rdoc/classes/RFuzz/RandomGenerator.src/{M000032.html → M000046.html} +0 -0
  54. data/doc/rdoc/classes/RFuzz/RandomGenerator.src/{M000033.html → M000047.html} +0 -0
  55. data/doc/rdoc/classes/RFuzz/RandomGenerator.src/{M000036.html → M000050.html} +0 -0
  56. data/doc/rdoc/classes/RFuzz/RandomGenerator.src/{M000037.html → M000051.html} +0 -0
  57. data/doc/rdoc/classes/RFuzz/RandomGenerator.src/{M000038.html → M000052.html} +0 -0
  58. data/doc/rdoc/classes/RFuzz/RandomGenerator.src/{M000039.html → M000053.html} +0 -0
  59. data/doc/rdoc/classes/RFuzz/RandomGenerator.src/{M000040.html → M000054.html} +0 -0
  60. data/doc/rdoc/classes/RFuzz/RandomGenerator.src/{M000041.html → M000055.html} +0 -0
  61. data/doc/rdoc/classes/RFuzz/RandomGenerator.src/{M000042.html → M000056.html} +0 -0
  62. data/doc/rdoc/classes/RFuzz/RandomGenerator.src/{M000043.html → M000057.html} +0 -0
  63. data/doc/rdoc/classes/RFuzz/Sampler.html +60 -60
  64. data/doc/rdoc/classes/RFuzz/Sampler.src/{M000056.html → M000071.html} +0 -0
  65. data/doc/rdoc/classes/RFuzz/Sampler.src/{M000057.html → M000072.html} +0 -0
  66. data/doc/rdoc/classes/RFuzz/Sampler.src/{M000058.html → M000073.html} +0 -0
  67. data/doc/rdoc/classes/RFuzz/Sampler.src/{M000059.html → M000074.html} +0 -0
  68. data/doc/rdoc/classes/RFuzz/Sampler.src/{M000060.html → M000075.html} +0 -0
  69. data/doc/rdoc/classes/RFuzz/Sampler.src/{M000061.html → M000076.html} +0 -0
  70. data/doc/rdoc/classes/RFuzz/Sampler.src/{M000062.html → M000077.html} +0 -0
  71. data/doc/rdoc/classes/RFuzz/Sampler.src/{M000063.html → M000078.html} +0 -0
  72. data/doc/rdoc/classes/RFuzz/Sampler.src/{M000064.html → M000079.html} +0 -0
  73. data/doc/rdoc/classes/RFuzz/Sampler.src/{M000065.html → M000080.html} +0 -0
  74. data/doc/rdoc/classes/RFuzz/Sampler.src/{M000066.html → M000081.html} +0 -0
  75. data/doc/rdoc/classes/RFuzz/Sampler.src/{M000067.html → M000082.html} +0 -0
  76. data/doc/rdoc/classes/RFuzz/Session.html +63 -63
  77. data/doc/rdoc/classes/RFuzz/Session.src/{M000020.html → M000034.html} +0 -0
  78. data/doc/rdoc/classes/RFuzz/Session.src/{M000021.html → M000035.html} +0 -0
  79. data/doc/rdoc/classes/RFuzz/Session.src/{M000022.html → M000036.html} +0 -0
  80. data/doc/rdoc/classes/RFuzz/Session.src/{M000023.html → M000037.html} +0 -0
  81. data/doc/rdoc/classes/RFuzz/Session.src/{M000024.html → M000038.html} +0 -0
  82. data/doc/rdoc/classes/RFuzz/Session.src/{M000025.html → M000039.html} +0 -0
  83. data/doc/rdoc/classes/RFuzz/Session.src/{M000026.html → M000040.html} +0 -0
  84. data/doc/rdoc/classes/RFuzz/Session.src/{M000027.html → M000041.html} +0 -0
  85. data/doc/rdoc/classes/RFuzz/Session.src/{M000028.html → M000042.html} +0 -0
  86. data/doc/rdoc/classes/RFuzz/Session.src/{M000029.html → M000043.html} +0 -0
  87. data/doc/rdoc/classes/RFuzz/Session.src/{M000030.html → M000044.html} +0 -0
  88. data/doc/rdoc/classes/RFuzz/Session.src/{M000031.html → M000045.html} +0 -0
  89. data/doc/rdoc/classes/RFuzz/StatsTracker.html +32 -32
  90. data/doc/rdoc/classes/RFuzz/StatsTracker.src/{M000050.html → M000065.html} +0 -0
  91. data/doc/rdoc/classes/RFuzz/StatsTracker.src/{M000051.html → M000066.html} +0 -0
  92. data/doc/rdoc/classes/RFuzz/StatsTracker.src/{M000052.html → M000067.html} +0 -0
  93. data/doc/rdoc/classes/RFuzz/StatsTracker.src/{M000053.html → M000068.html} +0 -0
  94. data/doc/rdoc/classes/RFuzz/StatsTracker.src/{M000054.html → M000069.html} +0 -0
  95. data/doc/rdoc/classes/RFuzz/StatsTracker.src/{M000055.html → M000070.html} +0 -0
  96. data/doc/rdoc/classes/RFuzz.html +7 -1
  97. data/doc/rdoc/created.rid +1 -1
  98. data/doc/rdoc/files/lib/rfuzz/client_rb.html +2 -2
  99. data/doc/rdoc/files/lib/rfuzz/pushbackio_rb.html +108 -0
  100. data/doc/rdoc/fr_class_index.html +2 -0
  101. data/doc/rdoc/fr_file_index.html +1 -0
  102. data/doc/rdoc/fr_method_index.html +76 -61
  103. data/examples/cl_watcher.rb +12 -9
  104. data/examples/hpricot_pudding.rb +1 -1
  105. data/examples/mongrel_test_suite/test/http/protocol_parameters.rb +0 -3
  106. data/examples/mongrel_test_suite/test/rails/catastrophe.rb +26 -0
  107. data/examples/mongrel_test_suite/test/rails/conditional.rb +81 -0
  108. data/examples/mongrel_test_suite/test/rails/put.rb +25 -0
  109. data/examples/mongrel_test_suite/test/rails/redirect.rb +13 -0
  110. data/examples/mongrel_test_suite/test/rails/static_files.rb +47 -2
  111. data/examples/rails_security_test.rb +61 -0
  112. data/ext/http11_client/http11_client.c +15 -1
  113. data/ext/http11_client/http11_parser.c +627 -203
  114. data/ext/http11_client/http11_parser.h +2 -0
  115. data/ext/http11_client/http11_parser.rl +8 -4
  116. data/lib/rfuzz/client.rb +124 -115
  117. data/lib/rfuzz/pushbackio.rb +90 -0
  118. metadata +86 -60
  119. data/doc/rdoc/classes/RFuzz/HttpClient.src/M000010.html +0 -24
  120. data/doc/rdoc/classes/RFuzz/HttpClient.src/M000012.html +0 -50
  121. data/doc/rdoc/classes/RFuzz/HttpClient.src/M000013.html +0 -49
  122. data/doc/rdoc/classes/RFuzz/HttpClient.src/M000014.html +0 -57
  123. data/doc/rdoc/classes/RFuzz/HttpClient.src/M000015.html +0 -37
@@ -20,18 +20,21 @@
20
20
  <div id="index">
21
21
  <h1 class="section-bar">Methods</h1>
22
22
  <div id="index-entries">
23
- <a href="classes/RFuzz/RandomGenerator.html#M000038">base64 (RFuzz::RandomGenerator)</a><br />
24
- <a href="classes/RFuzz/HttpClient.html#M000011">build_request (RFuzz::HttpClient)</a><br />
25
- <a href="classes/RFuzz/RandomGenerator.html#M000039">byte_array (RFuzz::RandomGenerator)</a><br />
26
- <a href="classes/RFuzz/RandomGenerator.html#M000040">bytes (RFuzz::RandomGenerator)</a><br />
27
- <a href="classes/RFuzz/Notifier.html#M000049">close (RFuzz::Notifier)</a><br />
28
- <a href="classes/RFuzz/Notifier.html#M000044">connect (RFuzz::Notifier)</a><br />
29
- <a href="classes/RFuzz/Session.html#M000025">count (RFuzz::Session)</a><br />
30
- <a href="classes/RFuzz/Session.html#M000031">count_errors (RFuzz::Session)</a><br />
31
- <a href="classes/RFuzz/Session.html#M000027">counts_to_a (RFuzz::Session)</a><br />
32
- <a href="classes/RFuzz/Session.html#M000022">cur_count (RFuzz::Session)</a><br />
33
- <a href="classes/RFuzz/Session.html#M000021">cur_run (RFuzz::Session)</a><br />
34
- <a href="classes/RFuzz/Sampler.html#M000059">dump (RFuzz::Sampler)</a><br />
23
+ <a href="classes/RFuzz/RandomGenerator.html#M000052">base64 (RFuzz::RandomGenerator)</a><br />
24
+ <a href="classes/RFuzz/HttpClient.html#M000020">build_request (RFuzz::HttpClient)</a><br />
25
+ <a href="classes/RFuzz/RandomGenerator.html#M000053">byte_array (RFuzz::RandomGenerator)</a><br />
26
+ <a href="classes/RFuzz/RandomGenerator.html#M000054">bytes (RFuzz::RandomGenerator)</a><br />
27
+ <a href="classes/RFuzz/HttpResponse.html#M000031">chunk_size (RFuzz::HttpResponse)</a><br />
28
+ <a href="classes/RFuzz/HttpResponse.html#M000033">chunked_encoding? (RFuzz::HttpResponse)</a><br />
29
+ <a href="classes/RFuzz/PushBackIO.html#M000017">close (RFuzz::PushBackIO)</a><br />
30
+ <a href="classes/RFuzz/Notifier.html#M000063">close (RFuzz::Notifier)</a><br />
31
+ <a href="classes/RFuzz/Notifier.html#M000058">connect (RFuzz::Notifier)</a><br />
32
+ <a href="classes/RFuzz/Session.html#M000039">count (RFuzz::Session)</a><br />
33
+ <a href="classes/RFuzz/Session.html#M000045">count_errors (RFuzz::Session)</a><br />
34
+ <a href="classes/RFuzz/Session.html#M000041">counts_to_a (RFuzz::Session)</a><br />
35
+ <a href="classes/RFuzz/Session.html#M000036">cur_count (RFuzz::Session)</a><br />
36
+ <a href="classes/RFuzz/Session.html#M000035">cur_run (RFuzz::Session)</a><br />
37
+ <a href="classes/RFuzz/Sampler.html#M000074">dump (RFuzz::Sampler)</a><br />
35
38
  <a href="classes/RFuzz/HttpEncoding.html#M000001">encode_cookies (RFuzz::HttpEncoding)</a><br />
36
39
  <a href="classes/RFuzz/HttpEncoding.html#M000002">encode_field (RFuzz::HttpEncoding)</a><br />
37
40
  <a href="classes/RFuzz/HttpEncoding.html#M000003">encode_headers (RFuzz::HttpEncoding)</a><br />
@@ -39,57 +42,69 @@
39
42
  <a href="classes/RFuzz/HttpEncoding.html#M000004">encode_param (RFuzz::HttpEncoding)</a><br />
40
43
  <a href="classes/RFuzz/HttpEncoding.html#M000005">encode_query (RFuzz::HttpEncoding)</a><br />
41
44
  <a href="classes/RFuzz/HttpEncoding.html#M000007">escape (RFuzz::HttpEncoding)</a><br />
42
- <a href="classes/RFuzz/RandomGenerator.html#M000043">floats (RFuzz::RandomGenerator)</a><br />
43
- <a href="classes/RFuzz/RandomGenerator.html#M000033">hash_of (RFuzz::RandomGenerator)</a><br />
44
- <a href="classes/RFuzz/RandomGenerator.html#M000035">headers (RFuzz::RandomGenerator)</a><br />
45
- <a href="classes/RFuzz/RandomGenerator.html#M000042">ints (RFuzz::RandomGenerator)</a><br />
46
- <a href="classes/RFuzz/Sampler.html#M000062">keys (RFuzz::Sampler)</a><br />
47
- <a href="classes/RFuzz/Browser.html#M000070">links (RFuzz::Browser)</a><br />
48
- <a href="classes/RFuzz/StatsTracker.html#M000051">mark (RFuzz::StatsTracker)</a><br />
49
- <a href="classes/RFuzz/Sampler.html#M000066">mark (RFuzz::Sampler)</a><br />
50
- <a href="classes/RFuzz/Sampler.html#M000064">mean (RFuzz::Sampler)</a><br />
51
- <a href="classes/RFuzz/HttpClient.html#M000016">method_missing (RFuzz::HttpClient)</a><br />
52
- <a href="classes/RFuzz/StatsTracker.html#M000054">method_missing (RFuzz::StatsTracker)</a><br />
53
- <a href="classes/RFuzz/Session.html#M000020">new (RFuzz::Session)</a><br />
54
- <a href="classes/RFuzz/RandomGenerator.html#M000032">new (RFuzz::RandomGenerator)</a><br />
55
- <a href="classes/RFuzz/StatsTracker.html#M000050">new (RFuzz::StatsTracker)</a><br />
56
- <a href="classes/RFuzz/HttpClient.html#M000010">new (RFuzz::HttpClient)</a><br />
57
- <a href="classes/RFuzz/Browser.html#M000068">new (RFuzz::Browser)</a><br />
58
- <a href="classes/RFuzz/Sampler.html#M000056">new (RFuzz::Sampler)</a><br />
59
- <a href="classes/RFuzz/HttpClient.html#M000019">notify (RFuzz::HttpClient)</a><br />
60
- <a href="classes/RFuzz/RandomGenerator.html#M000041">num (RFuzz::RandomGenerator)</a><br />
61
- <a href="classes/RFuzz/RandomGenerator.html#M000034">queries (RFuzz::RandomGenerator)</a><br />
45
+ <a href="classes/RFuzz/RandomGenerator.html#M000057">floats (RFuzz::RandomGenerator)</a><br />
46
+ <a href="classes/RFuzz/PushBackIO.html#M000015">flush (RFuzz::PushBackIO)</a><br />
47
+ <a href="classes/RFuzz/RandomGenerator.html#M000047">hash_of (RFuzz::RandomGenerator)</a><br />
48
+ <a href="classes/RFuzz/RandomGenerator.html#M000049">headers (RFuzz::RandomGenerator)</a><br />
49
+ <a href="classes/RFuzz/RandomGenerator.html#M000056">ints (RFuzz::RandomGenerator)</a><br />
50
+ <a href="classes/RFuzz/Sampler.html#M000077">keys (RFuzz::Sampler)</a><br />
51
+ <a href="classes/RFuzz/HttpResponse.html#M000032">last_chunk? (RFuzz::HttpResponse)</a><br />
52
+ <a href="classes/RFuzz/Browser.html#M000085">links (RFuzz::Browser)</a><br />
53
+ <a href="classes/RFuzz/StatsTracker.html#M000066">mark (RFuzz::StatsTracker)</a><br />
54
+ <a href="classes/RFuzz/Sampler.html#M000081">mark (RFuzz::Sampler)</a><br />
55
+ <a href="classes/RFuzz/Sampler.html#M000079">mean (RFuzz::Sampler)</a><br />
56
+ <a href="classes/RFuzz/StatsTracker.html#M000069">method_missing (RFuzz::StatsTracker)</a><br />
57
+ <a href="classes/RFuzz/HttpClient.html#M000027">method_missing (RFuzz::HttpClient)</a><br />
58
+ <a href="classes/RFuzz/Session.html#M000034">new (RFuzz::Session)</a><br />
59
+ <a href="classes/RFuzz/Sampler.html#M000071">new (RFuzz::Sampler)</a><br />
60
+ <a href="classes/RFuzz/Browser.html#M000083">new (RFuzz::Browser)</a><br />
61
+ <a href="classes/RFuzz/HttpClient.html#M000019">new (RFuzz::HttpClient)</a><br />
62
+ <a href="classes/RFuzz/StatsTracker.html#M000065">new (RFuzz::StatsTracker)</a><br />
63
+ <a href="classes/RFuzz/PushBackIO.html#M000010">new (RFuzz::PushBackIO)</a><br />
64
+ <a href="classes/RFuzz/RandomGenerator.html#M000046">new (RFuzz::RandomGenerator)</a><br />
65
+ <a href="classes/RFuzz/HttpClient.html#M000030">notify (RFuzz::HttpClient)</a><br />
66
+ <a href="classes/RFuzz/RandomGenerator.html#M000055">num (RFuzz::RandomGenerator)</a><br />
67
+ <a href="classes/RFuzz/PushBackIO.html#M000012">pop (RFuzz::PushBackIO)</a><br />
68
+ <a href="classes/RFuzz/PushBackIO.html#M000018">protect (RFuzz::PushBackIO)</a><br />
69
+ <a href="classes/RFuzz/PushBackIO.html#M000011">push (RFuzz::PushBackIO)</a><br />
70
+ <a href="classes/RFuzz/RandomGenerator.html#M000048">queries (RFuzz::RandomGenerator)</a><br />
62
71
  <a href="classes/RFuzz/HttpEncoding.html#M000009">query_parse (RFuzz::HttpEncoding)</a><br />
63
- <a href="classes/RFuzz/Notifier.html#M000048">read_body (RFuzz::Notifier)</a><br />
64
- <a href="classes/RFuzz/HttpClient.html#M000013">read_chunked_encoding (RFuzz::HttpClient)</a><br />
65
- <a href="classes/RFuzz/HttpClient.html#M000012">read_chunks (RFuzz::HttpClient)</a><br />
66
- <a href="classes/RFuzz/Notifier.html#M000047">read_header (RFuzz::Notifier)</a><br />
67
- <a href="classes/RFuzz/HttpClient.html#M000014">read_response (RFuzz::HttpClient)</a><br />
68
- <a href="classes/RFuzz/Notifier.html#M000046">redirect (RFuzz::Notifier)</a><br />
69
- <a href="classes/RFuzz/HttpClient.html#M000017">redirect (RFuzz::HttpClient)</a><br />
70
- <a href="classes/RFuzz/Sampler.html#M000057">reset (RFuzz::Sampler)</a><br />
71
- <a href="classes/RFuzz/StatsTracker.html#M000053">reset (RFuzz::StatsTracker)</a><br />
72
- <a href="classes/RFuzz/HttpClient.html#M000018">reset (RFuzz::HttpClient)</a><br />
73
- <a href="classes/RFuzz/Session.html#M000023">run (RFuzz::Session)</a><br />
74
- <a href="classes/RFuzz/Session.html#M000026">runs_to_a (RFuzz::Session)</a><br />
75
- <a href="classes/RFuzz/Session.html#M000024">sample (RFuzz::Session)</a><br />
76
- <a href="classes/RFuzz/StatsTracker.html#M000052">sample (RFuzz::StatsTracker)</a><br />
77
- <a href="classes/RFuzz/Sampler.html#M000058">sample (RFuzz::Sampler)</a><br />
78
- <a href="classes/RFuzz/Sampler.html#M000065">sd (RFuzz::Sampler)</a><br />
79
- <a href="classes/RFuzz/HttpClient.html#M000015">send_request (RFuzz::HttpClient)</a><br />
80
- <a href="classes/RFuzz/Notifier.html#M000045">send_request (RFuzz::Notifier)</a><br />
81
- <a href="classes/RFuzz/Browser.html#M000069">start (RFuzz::Browser)</a><br />
82
- <a href="classes/RFuzz/Sampler.html#M000067">tick (RFuzz::Sampler)</a><br />
83
- <a href="classes/RFuzz/Sampler.html#M000063">to_hash (RFuzz::Sampler)</a><br />
84
- <a href="classes/RFuzz/StatsTracker.html#M000055">to_s (RFuzz::StatsTracker)</a><br />
85
- <a href="classes/RFuzz/Sampler.html#M000060">to_s (RFuzz::Sampler)</a><br />
86
- <a href="classes/RFuzz/Session.html#M000028">track (RFuzz::Session)</a><br />
72
+ <a href="classes/RFuzz/PushBackIO.html#M000014">read (RFuzz::PushBackIO)</a><br />
73
+ <a href="classes/RFuzz/Notifier.html#M000062">read_body (RFuzz::Notifier)</a><br />
74
+ <a href="classes/RFuzz/Notifier.html#M000064">read_chunk (RFuzz::Notifier)</a><br />
75
+ <a href="classes/RFuzz/HttpClient.html#M000023">read_chunked_body (RFuzz::HttpClient)</a><br />
76
+ <a href="classes/RFuzz/HttpClient.html#M000022">read_chunked_header (RFuzz::HttpClient)</a><br />
77
+ <a href="classes/RFuzz/Notifier.html#M000061">read_header (RFuzz::Notifier)</a><br />
78
+ <a href="classes/RFuzz/HttpClient.html#M000021">read_parsed_header (RFuzz::HttpClient)</a><br />
79
+ <a href="classes/RFuzz/HttpClient.html#M000025">read_response (RFuzz::HttpClient)</a><br />
80
+ <a href="classes/RFuzz/HttpClient.html#M000028">redirect (RFuzz::HttpClient)</a><br />
81
+ <a href="classes/RFuzz/Notifier.html#M000060">redirect (RFuzz::Notifier)</a><br />
82
+ <a href="classes/RFuzz/Sampler.html#M000072">reset (RFuzz::Sampler)</a><br />
83
+ <a href="classes/RFuzz/HttpClient.html#M000029">reset (RFuzz::HttpClient)</a><br />
84
+ <a href="classes/RFuzz/PushBackIO.html#M000013">reset (RFuzz::PushBackIO)</a><br />
85
+ <a href="classes/RFuzz/StatsTracker.html#M000068">reset (RFuzz::StatsTracker)</a><br />
86
+ <a href="classes/RFuzz/Session.html#M000037">run (RFuzz::Session)</a><br />
87
+ <a href="classes/RFuzz/Session.html#M000040">runs_to_a (RFuzz::Session)</a><br />
88
+ <a href="classes/RFuzz/StatsTracker.html#M000067">sample (RFuzz::StatsTracker)</a><br />
89
+ <a href="classes/RFuzz/Session.html#M000038">sample (RFuzz::Session)</a><br />
90
+ <a href="classes/RFuzz/Sampler.html#M000073">sample (RFuzz::Sampler)</a><br />
91
+ <a href="classes/RFuzz/Sampler.html#M000080">sd (RFuzz::Sampler)</a><br />
92
+ <a href="classes/RFuzz/Notifier.html#M000059">send_request (RFuzz::Notifier)</a><br />
93
+ <a href="classes/RFuzz/HttpClient.html#M000026">send_request (RFuzz::HttpClient)</a><br />
94
+ <a href="classes/RFuzz/Browser.html#M000084">start (RFuzz::Browser)</a><br />
95
+ <a href="classes/RFuzz/HttpClient.html#M000024">store_cookies (RFuzz::HttpClient)</a><br />
96
+ <a href="classes/RFuzz/Sampler.html#M000082">tick (RFuzz::Sampler)</a><br />
97
+ <a href="classes/RFuzz/Sampler.html#M000078">to_hash (RFuzz::Sampler)</a><br />
98
+ <a href="classes/RFuzz/Sampler.html#M000075">to_s (RFuzz::Sampler)</a><br />
99
+ <a href="classes/RFuzz/StatsTracker.html#M000070">to_s (RFuzz::StatsTracker)</a><br />
100
+ <a href="classes/RFuzz/Session.html#M000042">track (RFuzz::Session)</a><br />
87
101
  <a href="classes/RFuzz/HttpEncoding.html#M000008">unescape (RFuzz::HttpEncoding)</a><br />
88
- <a href="classes/RFuzz/RandomGenerator.html#M000036">uris (RFuzz::RandomGenerator)</a><br />
89
- <a href="classes/RFuzz/Sampler.html#M000061">values (RFuzz::Sampler)</a><br />
90
- <a href="classes/RFuzz/RandomGenerator.html#M000037">words (RFuzz::RandomGenerator)</a><br />
91
- <a href="classes/RFuzz/Session.html#M000030">write_counts (RFuzz::Session)</a><br />
92
- <a href="classes/RFuzz/Session.html#M000029">write_runs (RFuzz::Session)</a><br />
102
+ <a href="classes/RFuzz/RandomGenerator.html#M000050">uris (RFuzz::RandomGenerator)</a><br />
103
+ <a href="classes/RFuzz/Sampler.html#M000076">values (RFuzz::Sampler)</a><br />
104
+ <a href="classes/RFuzz/RandomGenerator.html#M000051">words (RFuzz::RandomGenerator)</a><br />
105
+ <a href="classes/RFuzz/PushBackIO.html#M000016">write (RFuzz::PushBackIO)</a><br />
106
+ <a href="classes/RFuzz/Session.html#M000044">write_counts (RFuzz::Session)</a><br />
107
+ <a href="classes/RFuzz/Session.html#M000043">write_runs (RFuzz::Session)</a><br />
93
108
  </div>
94
109
  </div>
95
110
  </body>
@@ -3,12 +3,12 @@ require 'rfuzz/browser'
3
3
  include RFuzz
4
4
  require 'pstore'
5
5
 
6
- if ARGV.length != 4
6
+ if ARGV.length < 4
7
7
  puts "usage: ruby cl_watcher.rb city cat areaID \"search\""
8
8
  exit 1
9
9
  end
10
10
 
11
- city, cat, areaID, search = ARGV[0], ARGV[1], ARGV[2], ARGV[3]
11
+ city, cat, areaID, search = ARGV.shift, ARGV.shift, ARGV.shift, ARGV
12
12
  href_seen = PStore.new("watcher_seen_links.pstore")
13
13
  web = Browser.new("#{city}.craigslist.org")
14
14
 
@@ -16,16 +16,19 @@ loop do
16
16
 
17
17
  puts "Checking..."
18
18
 
19
- web.start("/cgi-bin/search", :query => {"areaID" => areaID, "subAreaID" => "0","query" => search, "catAbbreviation" => cat, "minAsk" => "min", "maxAsk" => "max"})
19
+ search.each do |query|
20
+ puts "SEARCH: #{query}"
21
+ web.start("/cgi-bin/search", :query => {"areaID" => areaID, "subAreaID" => "0","query" => query, "catAbbreviation" => cat, "minAsk" => "min", "maxAsk" => "max"})
20
22
 
21
- href_seen.transaction do
22
- web.links(/#{city}.craigslist.org\/#{cat}/).each do |link|
23
- href = link.attributes["href"]
24
- if !href_seen[href]
25
- puts href
26
- puts " -- " + link.children.join
23
+ href_seen.transaction do
24
+ web.links(/[0-9]*.html/).each do |link|
25
+ href = link.attributes["href"]
26
+ if !href_seen[href]
27
+ puts href
28
+ puts " -- " + link.children.join
27
29
  `firefox '#{href}'`
28
30
  href_seen[href] = link
31
+ end
29
32
  end
30
33
  end
31
34
  end
@@ -5,7 +5,7 @@ include RFuzz
5
5
 
6
6
  agent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.4) Gecko/20060608 Ubuntu/dapper-security Firefox/1.5.0.4"
7
7
 
8
- google = HttpClient.new("www.google.com", 80)
8
+ google = HttpClient.new("www.google.com", 80, :redirect => 10)
9
9
  r = google.get("/search", :head => {"User-Agent" => agent}, :query => {
10
10
  "q" => ARGV[0], "hl" => "en", "btnG" => "Google Search"})
11
11
 
@@ -7,9 +7,6 @@ context "3: Protocol Parameters" do
7
7
 
8
8
  specify "3.1: HTTP Version" do
9
9
  # "HTTP" "/" 1*DIGIT "." 1*DIGIT
10
- @sess.run {|c,r|
11
- c.get("/").http_version.should_match /HTTP\/[0-9]+\.[0-9]+/
12
- }
13
10
  end
14
11
 
15
12
 
@@ -0,0 +1,26 @@
1
+ require 'rfuzz/session'
2
+ include RFuzz
3
+
4
+ context "Recovering From Catastrohpe" do
5
+ setup do
6
+ @client = HttpClient.new("localhost", 3000)
7
+ end
8
+
9
+ teardown do
10
+ `chmod oug+rwx ~/projects/testapp/tmp/sessions`
11
+ end
12
+
13
+ specify "Should display proper 500 headers" do
14
+ # first make sure it works properly
15
+ r = @client.get("/test")
16
+ r.http_body.should_equal "test"
17
+ r.http_status.should_equal "200"
18
+
19
+ # then gank the sessions to produce a 500
20
+ `chmod oug-rwx ~/projects/testapp/tmp/sessions`
21
+ r = @client.get("/test")
22
+ #r.http_body.should_not_match /Status: 500/
23
+ #r.http_status.should_equal "200" # yes, 200 since status is changed
24
+ #r['STATUS'].should_match /500/
25
+ end
26
+ end
@@ -0,0 +1,81 @@
1
+ require 'rfuzz/session'
2
+ include RFuzz
3
+
4
+
5
+ context "Conditional Responses Should Be" do
6
+
7
+ setup do
8
+ @client = HttpClient.new("localhost", 3000)
9
+ @path = "/index.html"
10
+ @r = @client.get(@path)
11
+ (@etag = @r['ETAG']).should_not_be_nil
12
+ (@last_modified = @r['LAST_MODIFIED']).should_not_be_nil
13
+ (@content_length = @r['CONTENT_LENGTH']).should_not_be_nil
14
+ end
15
+
16
+ specify "304 Not Modified when If-None-Match is the matching ETag" do
17
+ get_head_status_should_be "304", 'If-None-Match' => @etag
18
+ end
19
+
20
+ specify "304 Not Modified when If-Modified-Since is the matching Last-Modified date" do
21
+ get_head_status_should_be "304", 'If-Modified-Since' => @last_modified
22
+ end
23
+
24
+ specify "304 Not Modified when If-None-Match is the matching ETag and If-Modified-Since is the matching Last-Modified date" do
25
+ get_head_status_should_be "304", 'If-None-Match' => @etag, 'If-Modified-Since' => @last_modified
26
+ end
27
+
28
+ specify "200 OK when If-None-Match is invalid" do
29
+ get_head_status_should_be "200", 'If-None-Match' => 'invalid'
30
+ get_head_status_should_be "200", 'If-None-Match' => 'invalid', 'If-Modified-Since' => @last_modified
31
+ end
32
+
33
+ specify "200 OK when If-Modified-Since is invalid" do
34
+ get_head_status_should_be "200", 'If-Modified-Since' => 'invalid'
35
+ get_head_status_should_be "200", 'If-None-Match' => @etag, 'If-Modified-Since' => 'invalid'
36
+ end
37
+
38
+ specify "304 Not Modified when If-Modified-Since is greater than the Last-Modified header, but less than the system time" do
39
+ sleep 2
40
+ last_modified_plus_1 = (Time.httpdate(@last_modified) + 1).httpdate
41
+ get_head_status_should_be "304", 'If-Modified-Since' => last_modified_plus_1
42
+ get_head_status_should_be "304", 'If-None-Match' => @etag, 'If-Modified-Since' => last_modified_plus_1
43
+ end
44
+
45
+ specify "200 OK when If-Modified-Since is less than the Last-Modified header" do
46
+ last_modified_minus_1 = (Time.httpdate(@last_modified) - 1).httpdate
47
+ get_head_status_should_be "200", 'If-Modified-Since' => last_modified_minus_1
48
+ get_head_status_should_be "200", 'If-None-Match' => @etag, 'If-Modified-Since' => last_modified_minus_1
49
+ end
50
+
51
+ specify "200 OK when If-Modified-Since is a date in the future" do
52
+ the_future = Time.at(2**31-1).httpdate
53
+ get_head_status_should_be "200", 'If-Modified-Since' => the_future
54
+ get_head_status_should_be "200", 'If-None-Match' => @etag, 'If-Modified-Since' => the_future
55
+ end
56
+
57
+ specify "200 OK when If-None-Match is a wildcard" do
58
+ get_head_status_should_be "200", 'If-None-Match' => '*'
59
+ get_head_status_should_be "200", 'If-None-Match' => '*', 'If-Modified-Since' => @last_modified
60
+ end
61
+
62
+ def get_head_status_should_be(http_status, headers = {})
63
+ %w{ get head }.each do |method|
64
+ res = @client.send(method, @path, :head => headers)
65
+ res.http_status.should_equal http_status
66
+ res['ETAG'].should_equal @etag
67
+ case res.http_status
68
+ when '304' then
69
+ res['LAST_MODIFIED'].should_be_nil
70
+ res['CONTENT_LENGTH'].should_be_nil
71
+ when '200' then
72
+ @last_modified.should_equal res['LAST_MODIFIED']
73
+ @content_length.should_equal res['CONTENT_LENGTH']
74
+ else
75
+ fail "Incorrect HTTP status code: #{res.http_status}"
76
+ end
77
+ end
78
+ end
79
+ end
80
+
81
+
@@ -0,0 +1,25 @@
1
+ require 'rfuzz/session'
2
+ include RFuzz
3
+
4
+ context "PUT Requests" do
5
+ setup do
6
+ @sess = Session.new :host => "localhost", :port => 3000
7
+ end
8
+
9
+ specify "Should be fast" do
10
+ data = @sess.rand.bytes(600)
11
+ body = @sess.client.escape(data)
12
+
13
+ @sess.run(10) do |c,r|
14
+ 100.times do
15
+ get = c.get("/test?data=#{body}")
16
+ end
17
+ end
18
+
19
+ @sess.run(10, :save_as => ["put_runs.csv", "put_counts.csv"]) do |c,r|
20
+ 100.times do
21
+ put = c.put("/test", :body => data)
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,13 @@
1
+ require 'rfuzz/session'
2
+ include RFuzz
3
+
4
+ context "Rails Should Redirect" do
5
+ setup do
6
+ @client = HttpClient.new("localhost","3000")
7
+ end
8
+
9
+ specify "with 302" do
10
+ res = @client.get("/test/redirect")
11
+ res.http_status.should_equal "302"
12
+ end
13
+ end
@@ -1,9 +1,54 @@
1
1
  require 'rfuzz/session'
2
+ include RFuzz
2
3
 
3
- context "static_files" do
4
+ context "Serving static files" do
4
5
  setup do
6
+ @client = HttpClient.new("localhost", 3000)
5
7
  end
6
8
 
7
- specify "static_files spec" do
9
+ specify "Services index.html by default" do
10
+ default = @client.get("/")
11
+ default.http_status.should_equal "200"
12
+
13
+ index = @client.get("/index.html")
14
+ index.http_status.should_equal "200"
15
+
16
+ index.http_body.should_equal default.http_body
17
+ end
18
+
19
+ specify "Serves static files" do
20
+ railspng = @client.get("/images/rails.png")
21
+ railspng.http_status.should_equal "200"
22
+ railspng.http_body.length.should_equal 1787
23
+ end
24
+
25
+
26
+ specify "Proper MIME types" do
27
+ railspng = @client.get("/images/rails.png")
28
+ railspng['CONTENT_TYPE'].should_equal "image/png"
29
+
30
+ index = @client.get("/index.html")
31
+ default = @client.get("/")
32
+ default['CONTENT_TYPE'].should_equal index['CONTENT_TYPE']
33
+ default['CONTENT_TYPE'].should_equal "text/html"
34
+
35
+ robots = @client.get("/robots.txt")
36
+ robots['CONTENT_TYPE'].should_equal "text/plain"
37
+ end
38
+
39
+ specify "404 Missing files" do
40
+ missing = @client.get("/imnothereturdy")
41
+ missing.http_status.should_equal "404"
42
+ end
43
+
44
+ specify "Missing Slash then Redirects" do
45
+ # TODO: implement this feature, seems to trip people up
46
+ redir = @client.get("/images")
47
+
48
+ redir = @client.get("/javascripts")
49
+
50
+ redir = @client.get("/stylesheets")
8
51
  end
9
52
  end
53
+
54
+
@@ -0,0 +1,61 @@
1
+ require 'rubygems'
2
+ require 'rfuzz/session'
3
+ require 'find'
4
+ include RFuzz
5
+
6
+ if ARGV.length != 3
7
+ puts "usage: ruby rails_security_test.rb <host> <port> <railsdir>"
8
+ exit 1
9
+ end
10
+
11
+ host, port, railsdir = ARGV
12
+
13
+ if railsdir[-1].chr != "/"
14
+ railsdir += "/"
15
+ end
16
+
17
+ test = HttpClient.new(host, port)
18
+ paths = []
19
+
20
+ Find.find(railsdir) do |path|
21
+ if FileTest.directory?(path)
22
+ if File.basename(path)[0] == ?.
23
+ Find.prune # Don't look any further into this directory.
24
+ else
25
+ next
26
+ end
27
+ else
28
+ path = path[railsdir.length - 1 .. -1]
29
+ paths << path
30
+ paths << "/" + File.basename(path)
31
+ if path.index(".rb") == path.length - 3
32
+ stripped = path[0 .. -4]
33
+ paths << stripped
34
+ paths << "/" + File.basename(stripped)
35
+ end
36
+ end
37
+ end
38
+
39
+ methods = [:get, :post, :put, :delete, :head]
40
+
41
+ methods.each do |method|
42
+ paths.each do |path|
43
+ begin
44
+ res = test.send(method,path)
45
+
46
+ app_error = case res.http_body
47
+ when /500/
48
+ "500"
49
+ when /[aA]pplication error/
50
+ "app_error"
51
+ else
52
+ "unknown"
53
+ end
54
+
55
+ puts "#{method} #{path} #{res.http_status} #{app_error}"
56
+ rescue
57
+ puts "#{method} #{path}: ERROR! #{$!}"
58
+ end
59
+ end
60
+ end
61
+
@@ -19,6 +19,7 @@ static VALUE eHttpClientParserError;
19
19
  #define id_version rb_intern("@http_version")
20
20
  #define id_body rb_intern("@http_body")
21
21
  #define id_chunk_size rb_intern("@http_chunk_size")
22
+ #define id_last_chunk rb_intern("@last_chunk")
22
23
 
23
24
  void client_http_field(void *data, const char *field, size_t flen, const char *value, size_t vlen)
24
25
  {
@@ -75,7 +76,6 @@ void client_http_version(void *data, const char *at, size_t length)
75
76
 
76
77
  /** Finalizes the request header to have a bunch of stuff that's
77
78
  needed. */
78
-
79
79
  void client_header_done(void *data, const char *at, size_t length)
80
80
  {
81
81
  VALUE req = (VALUE)data;
@@ -90,11 +90,20 @@ void client_chunk_size(void *data, const char *at, size_t length)
90
90
  VALUE req = (VALUE)data;
91
91
  VALUE v = Qnil;
92
92
 
93
+ if(length <= 0) {
94
+ rb_raise(eHttpClientParserError, "Chunked Encoding gave <= 0 chunk size.");
95
+ }
96
+
93
97
  v = rb_str_new(at, length);
94
98
 
95
99
  rb_ivar_set(req, id_chunk_size, v);
96
100
  }
97
101
 
102
+ void client_last_chunk(void *data, const char *at, size_t length) {
103
+ VALUE req = (VALUE)data;
104
+ rb_ivar_set(req, id_last_chunk,Qtrue);
105
+ }
106
+
98
107
 
99
108
  void HttpClientParser_free(void *data) {
100
109
  TRACE();
@@ -116,6 +125,7 @@ VALUE HttpClientParser_alloc(VALUE klass)
116
125
  hp->http_version = client_http_version;
117
126
  hp->header_done = client_header_done;
118
127
  hp->chunk_size = client_chunk_size;
128
+ hp->last_chunk = client_last_chunk;
119
129
  httpclient_parser_init(hp);
120
130
 
121
131
  obj = Data_Wrap_Struct(klass, NULL, HttpClientParser_free, hp);
@@ -198,6 +208,10 @@ VALUE HttpClientParser_execute(VALUE self, VALUE req_hash, VALUE data, VALUE sta
198
208
  char *dptr = NULL;
199
209
  long dlen = 0;
200
210
 
211
+ REQUIRE_TYPE(req_hash, T_HASH);
212
+ REQUIRE_TYPE(data, T_STRING);
213
+ REQUIRE_TYPE(start, T_FIXNUM);
214
+
201
215
  DATA_GET(self, httpclient_parser, http);
202
216
 
203
217
  from = FIX2INT(start);