mongrel_esi 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. data/README +10 -9
  2. data/doc/rdoc/classes/ESI/Cache.html +10 -10
  3. data/doc/rdoc/classes/ESI/Cache.src/{M000085.html → M000087.html} +0 -0
  4. data/doc/rdoc/classes/ESI/Cache.src/{M000086.html → M000088.html} +0 -0
  5. data/doc/rdoc/classes/ESI/Config.html +43 -62
  6. data/doc/rdoc/classes/ESI/Config.src/M000049.html +18 -0
  7. data/doc/rdoc/classes/ESI/Config.src/{M000059.html → M000050.html} +5 -5
  8. data/doc/rdoc/classes/ESI/Config.src/M000051.html +35 -0
  9. data/doc/rdoc/classes/ESI/Config.src/M000052.html +27 -5
  10. data/doc/rdoc/classes/ESI/Config.src/M000053.html +10 -5
  11. data/doc/rdoc/classes/ESI/Config.src/M000054.html +5 -22
  12. data/doc/rdoc/classes/ESI/Config.src/M000055.html +7 -25
  13. data/doc/rdoc/classes/ESI/Config.src/M000056.html +11 -10
  14. data/doc/rdoc/classes/ESI/Config/CacheConfig.html +25 -25
  15. data/doc/rdoc/classes/ESI/Config/CacheConfig.src/{M000068.html → M000060.html} +6 -5
  16. data/doc/rdoc/classes/ESI/Config/CacheConfig.src/{M000065.html → M000061.html} +5 -5
  17. data/doc/rdoc/classes/ESI/Config/CacheConfig.src/{M000066.html → M000062.html} +4 -4
  18. data/doc/rdoc/classes/ESI/Config/CacheConfig.src/{M000067.html → M000063.html} +4 -4
  19. data/doc/rdoc/classes/ESI/Config/CacheConfig.src/M000064.html +5 -6
  20. data/doc/rdoc/classes/ESI/Config/ConfigRouter.html +15 -15
  21. data/doc/rdoc/classes/ESI/Config/ConfigRouter.src/{M000061.html → M000057.html} +5 -5
  22. data/doc/rdoc/classes/ESI/Config/ConfigRouter.src/{M000062.html → M000058.html} +7 -7
  23. data/doc/rdoc/classes/ESI/Config/ConfigRouter.src/{M000063.html → M000059.html} +7 -7
  24. data/doc/rdoc/classes/ESI/Dispatcher.html +17 -15
  25. data/doc/rdoc/classes/ESI/Dispatcher.src/{M000087.html → M000092.html} +4 -7
  26. data/doc/rdoc/classes/ESI/Dispatcher.src/M000093.html +27 -0
  27. data/doc/rdoc/classes/ESI/Fragment.html +15 -15
  28. data/doc/rdoc/classes/ESI/Fragment.src/{M000100.html → M000111.html} +0 -0
  29. data/doc/rdoc/classes/ESI/Fragment.src/{M000101.html → M000112.html} +0 -0
  30. data/doc/rdoc/classes/ESI/Fragment.src/{M000102.html → M000113.html} +0 -0
  31. data/doc/rdoc/classes/ESI/MemcachedCache.html +46 -46
  32. data/doc/rdoc/classes/ESI/MemcachedCache.src/M000037.html +24 -0
  33. data/doc/rdoc/classes/ESI/MemcachedCache.src/M000038.html +22 -0
  34. data/doc/rdoc/classes/ESI/MemcachedCache.src/M000039.html +19 -0
  35. data/doc/rdoc/classes/ESI/MemcachedCache.src/M000040.html +10 -11
  36. data/doc/rdoc/classes/ESI/MemcachedCache.src/M000041.html +5 -9
  37. data/doc/rdoc/classes/ESI/MemcachedCache.src/M000042.html +6 -6
  38. data/doc/rdoc/classes/ESI/MemcachedCache.src/M000043.html +5 -10
  39. data/doc/rdoc/classes/ESI/MemcachedCache.src/M000044.html +5 -5
  40. data/doc/rdoc/classes/ESI/MemcachedCache.src/M000045.html +4 -6
  41. data/doc/rdoc/classes/ESI/OutputAdapter.html +204 -0
  42. data/doc/rdoc/classes/ESI/OutputAdapter.src/M000094.html +37 -0
  43. data/doc/rdoc/classes/ESI/OutputAdapter.src/M000095.html +18 -0
  44. data/doc/rdoc/classes/ESI/OutputAdapter.src/M000096.html +18 -0
  45. data/doc/rdoc/classes/ESI/OutputAdapter.src/M000097.html +18 -0
  46. data/doc/rdoc/classes/ESI/Parser.html +15 -15
  47. data/doc/rdoc/classes/ESI/Parser.src/{M000049.html → M000065.html} +0 -0
  48. data/doc/rdoc/classes/ESI/Parser.src/{M000050.html → M000066.html} +0 -0
  49. data/doc/rdoc/classes/ESI/Parser.src/{M000051.html → M000067.html} +0 -0
  50. data/doc/rdoc/classes/ESI/Processor.html +15 -15
  51. data/doc/rdoc/classes/ESI/Processor.src/{M000037.html → M000046.html} +0 -0
  52. data/doc/rdoc/classes/ESI/Processor.src/{M000038.html → M000047.html} +1 -1
  53. data/doc/rdoc/classes/ESI/Processor.src/{M000039.html → M000048.html} +0 -0
  54. data/doc/rdoc/classes/ESI/Proxy.html +48 -48
  55. data/doc/rdoc/classes/ESI/Proxy.src/M000071.html +7 -40
  56. data/doc/rdoc/classes/ESI/Proxy.src/M000072.html +50 -12
  57. data/doc/rdoc/classes/ESI/Proxy.src/M000073.html +49 -6
  58. data/doc/rdoc/classes/ESI/Proxy.src/M000074.html +11 -14
  59. data/doc/rdoc/classes/ESI/Proxy.src/M000075.html +6 -5
  60. data/doc/rdoc/classes/ESI/Proxy.src/M000076.html +9 -15
  61. data/doc/rdoc/classes/ESI/Proxy.src/M000077.html +5 -16
  62. data/doc/rdoc/classes/ESI/Proxy.src/M000078.html +28 -0
  63. data/doc/rdoc/classes/ESI/Proxy.src/M000079.html +29 -0
  64. data/doc/rdoc/classes/ESI/RackAdapter.html +214 -0
  65. data/doc/rdoc/classes/ESI/RackAdapter.src/M000068.html +18 -0
  66. data/doc/rdoc/classes/ESI/RackAdapter.src/M000069.html +34 -0
  67. data/doc/rdoc/classes/ESI/{MemcachedCache.src/M000048.html → RackAdapter.src/M000070.html} +4 -4
  68. data/doc/rdoc/classes/ESI/RackConfig.html +173 -0
  69. data/doc/rdoc/classes/ESI/RackConfig.src/M000089.html +28 -0
  70. data/doc/rdoc/classes/ESI/RackConfig.src/M000090.html +18 -0
  71. data/doc/rdoc/classes/ESI/RackConfig.src/M000091.html +20 -0
  72. data/doc/rdoc/classes/ESI/Request.html +158 -0
  73. data/doc/rdoc/classes/ESI/{MemcachedCache.src/M000046.html → Request.src/M000098.html} +5 -5
  74. data/doc/rdoc/classes/ESI/Request.src/M000099.html +18 -0
  75. data/doc/rdoc/classes/ESI/Response.html +36 -36
  76. data/doc/rdoc/classes/ESI/Response.src/M000080.html +10 -8
  77. data/doc/rdoc/classes/ESI/Response.src/M000081.html +5 -7
  78. data/doc/rdoc/classes/ESI/Response.src/M000082.html +8 -12
  79. data/doc/rdoc/classes/ESI/Response.src/M000083.html +7 -5
  80. data/doc/rdoc/classes/ESI/Response.src/M000084.html +12 -20
  81. data/doc/rdoc/classes/ESI/Response.src/{M000079.html → M000085.html} +5 -5
  82. data/doc/rdoc/classes/ESI/Response.src/M000086.html +33 -0
  83. data/doc/rdoc/classes/ESI/Router.html +10 -10
  84. data/doc/rdoc/classes/ESI/Router.src/{M000098.html → M000109.html} +0 -0
  85. data/doc/rdoc/classes/ESI/Router.src/{M000099.html → M000110.html} +0 -0
  86. data/doc/rdoc/classes/ESI/RubyCache.html +45 -45
  87. data/doc/rdoc/classes/ESI/RubyCache.src/{M000089.html → M000100.html} +6 -6
  88. data/doc/rdoc/classes/ESI/RubyCache.src/{M000090.html → M000101.html} +6 -6
  89. data/doc/rdoc/classes/ESI/RubyCache.src/{M000091.html → M000102.html} +6 -6
  90. data/doc/rdoc/classes/ESI/RubyCache.src/{M000092.html → M000103.html} +8 -8
  91. data/doc/rdoc/classes/ESI/RubyCache.src/{M000093.html → M000104.html} +4 -4
  92. data/doc/rdoc/classes/ESI/RubyCache.src/{M000094.html → M000105.html} +8 -8
  93. data/doc/rdoc/classes/ESI/RubyCache.src/{M000095.html → M000106.html} +4 -4
  94. data/doc/rdoc/classes/ESI/RubyCache.src/{M000096.html → M000107.html} +4 -4
  95. data/doc/rdoc/classes/ESI/RubyCache.src/{M000097.html → M000108.html} +4 -4
  96. data/doc/rdoc/classes/ESI/Tag.html +8 -8
  97. data/doc/rdoc/created.rid +1 -1
  98. data/doc/rdoc/files/COPYING.html +1 -1
  99. data/doc/rdoc/files/LICENSE.html +1 -1
  100. data/doc/rdoc/files/README.html +12 -10
  101. data/doc/rdoc/files/ext/esi/common_rl.html +1 -1
  102. data/doc/rdoc/files/ext/esi/esi_parser_c.html +1 -1
  103. data/doc/rdoc/files/ext/esi/parser_c.html +1 -1
  104. data/doc/rdoc/files/ext/esi/parser_h.html +1 -1
  105. data/doc/rdoc/files/ext/esi/parser_rl.html +122 -82
  106. data/doc/rdoc/files/ext/esi/test/test_c.html +1 -1
  107. data/doc/rdoc/files/lib/esi/cache_rb.html +2 -1
  108. data/doc/rdoc/files/lib/esi/config_rb.html +2 -1
  109. data/doc/rdoc/files/lib/esi/dispatcher_rb.html +3 -1
  110. data/doc/rdoc/files/lib/esi/invalidator_rb.html +1 -1
  111. data/doc/rdoc/files/lib/esi/logger_rb.html +1 -1
  112. data/doc/rdoc/files/lib/esi/parser_rb.html +1 -1
  113. data/doc/rdoc/files/lib/esi/processor_rb.html +1 -1
  114. data/doc/rdoc/files/lib/esi/proxy_rb.html +2 -2
  115. data/doc/rdoc/files/{ext/esi/test/parser_c.html → lib/esi/rack_adapter_rb.html} +21 -5
  116. data/doc/rdoc/files/lib/esi/response_rb.html +1 -1
  117. data/doc/rdoc/files/lib/esi/router_rb.html +1 -1
  118. data/doc/rdoc/files/lib/esi/tag/attempt_rb.html +1 -1
  119. data/doc/rdoc/files/lib/esi/tag/base_rb.html +1 -1
  120. data/doc/rdoc/files/lib/esi/tag/container_rb.html +1 -1
  121. data/doc/rdoc/files/lib/esi/tag/except_rb.html +1 -1
  122. data/doc/rdoc/files/lib/esi/tag/include_rb.html +1 -1
  123. data/doc/rdoc/files/lib/esi/tag/invalidate_rb.html +1 -1
  124. data/doc/rdoc/files/lib/esi/tag/try_rb.html +1 -1
  125. data/doc/rdoc/files/lib/esi/version_rb.html +1 -1
  126. data/doc/rdoc/files/lib/multi_dirhandler_rb.html +1 -1
  127. data/doc/rdoc/fr_class_index.html +4 -0
  128. data/doc/rdoc/fr_file_index.html +1 -5
  129. data/doc/rdoc/fr_method_index.html +87 -76
  130. data/ext/esi/esi_parser.c +2 -2
  131. data/ext/esi/parser.c +133 -107
  132. data/ext/esi/parser.h +9 -4
  133. data/ext/esi/parser.rl +99 -73
  134. data/ext/esi/test/test.c +11 -6
  135. data/lib/esi/cache.rb +7 -3
  136. data/lib/esi/config.rb +4 -8
  137. data/lib/esi/dispatcher.rb +14 -5
  138. data/lib/esi/processor.rb +1 -1
  139. data/lib/esi/proxy.rb +58 -48
  140. data/lib/esi/rack_adapter.rb +97 -0
  141. data/lib/esi/response.rb +30 -1
  142. data/lib/esi/version.rb +1 -1
  143. data/test/bench-plot.rb +31 -0
  144. data/test/benchmarks/csv-perf-serial0.4 +101 -0
  145. data/test/benchmarks/csv-perf-trunk +101 -0
  146. data/test/benchmarks/perf-serial0.4-n1000-c1.csv +101 -0
  147. data/test/benchmarks/perf-serial0.4-n1000-c2.csv +101 -0
  148. data/test/benchmarks/perf-serial0.4-n1000-c3.csv +101 -0
  149. data/test/benchmarks/perf-serial0.4-n1000-c4.csv +101 -0
  150. data/test/benchmarks/perf-serial0.4-n1000-c5.csv +101 -0
  151. data/test/benchmarks/perf-serial0.4-n1000-c6.csv +101 -0
  152. data/test/benchmarks/perf-serial0.4-n1000-c7.csv +101 -0
  153. data/test/benchmarks/perf-trunk-n1000-c1.csv +101 -0
  154. data/test/benchmarks/perf-trunk-n1000-c2.csv +101 -0
  155. data/test/benchmarks/perf-trunk-n1000-c3.csv +101 -0
  156. data/test/benchmarks/perf-trunk-n1000-c4.csv +101 -0
  157. data/test/benchmarks/perf-trunk-n1000-c5.csv +101 -0
  158. data/test/benchmarks/perf-trunk-n1000-c6.csv +101 -0
  159. data/test/benchmarks/perf-trunk-n1000-c7.csv +101 -0
  160. data/test/load_test.rb +5 -2
  161. data/test/load_test_ab.rb +9 -4
  162. metadata +261 -227
  163. data/doc/rdoc/classes/ESI/Config.src/M000057.html +0 -18
  164. data/doc/rdoc/classes/ESI/Config.src/M000058.html +0 -20
  165. data/doc/rdoc/classes/ESI/Config.src/M000060.html +0 -24
  166. data/doc/rdoc/classes/ESI/Dispatcher.src/M000088.html +0 -18
  167. data/doc/rdoc/classes/ESI/MemcachedCache.src/M000047.html +0 -18
  168. data/doc/rdoc/classes/ESI/Proxy.src/M000069.html +0 -20
  169. data/doc/rdoc/classes/ESI/Proxy.src/M000070.html +0 -55
  170. data/doc/rdoc/classes/ESI/Response.src/M000078.html +0 -23
  171. data/doc/rdoc/files/ext/esi/test/common_rl.html +0 -160
  172. data/doc/rdoc/files/ext/esi/test/parser_h.html +0 -101
  173. data/doc/rdoc/files/ext/esi/test/parser_rl.html +0 -827
  174. data/doc/rdoc/files/ext/esi/test/sp_c.html +0 -101
  175. data/ext/esi/test/common.rl +0 -46
  176. data/ext/esi/test/parser.c +0 -1875
  177. data/ext/esi/test/parser.h +0 -120
  178. data/ext/esi/test/parser.rl +0 -585
  179. data/ext/esi/test/sp.c +0 -125
@@ -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/esi/cache.rb, line 190</span>
14
- 190: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sweep!</span>
15
- 191: <span class="ruby-ivar">@semaphore</span>.<span class="ruby-identifier">synchronize</span> { <span class="ruby-identifier">sweep_unlocked!</span> }
16
- 192: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/esi/cache.rb, line 194</span>
14
+ 194: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sweep!</span>
15
+ 195: <span class="ruby-ivar">@semaphore</span>.<span class="ruby-identifier">synchronize</span> { <span class="ruby-identifier">sweep_unlocked!</span> }
16
+ 196: <span class="ruby-keyword kw">end</span></pre>
17
17
  </body>
18
18
  </html>
@@ -10,13 +10,13 @@
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/esi/cache.rb, line 194</span>
14
- 194: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">keys</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
15
- 195: <span class="ruby-ivar">@semaphore</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
16
- 196: <span class="ruby-ivar">@cache</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span><span class="ruby-operator">|</span><span class="ruby-identifier">key</span>,<span class="ruby-identifier">data</span><span class="ruby-operator">|</span>
17
- 197: <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">key</span>, <span class="ruby-identifier">data</span>
18
- 198: <span class="ruby-keyword kw">end</span>
19
- 199: <span class="ruby-keyword kw">end</span>
20
- 200: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/esi/cache.rb, line 198</span>
14
+ 198: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">keys</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
15
+ 199: <span class="ruby-ivar">@semaphore</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
16
+ 200: <span class="ruby-ivar">@cache</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span><span class="ruby-operator">|</span><span class="ruby-identifier">key</span>,<span class="ruby-identifier">data</span><span class="ruby-operator">|</span>
17
+ 201: <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">key</span>, <span class="ruby-identifier">data</span>
18
+ 202: <span class="ruby-keyword kw">end</span>
19
+ 203: <span class="ruby-keyword kw">end</span>
20
+ 204: <span class="ruby-keyword kw">end</span></pre>
21
21
  </body>
22
22
  </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/esi/cache.rb, line 202</span>
14
- 202: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>( <span class="ruby-identifier">key</span> )
15
- 203: <span class="ruby-ivar">@semaphore</span>.<span class="ruby-identifier">synchronize</span> { <span class="ruby-ivar">@cache</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>) }
16
- 204: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/esi/cache.rb, line 206</span>
14
+ 206: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>( <span class="ruby-identifier">key</span> )
15
+ 207: <span class="ruby-ivar">@semaphore</span>.<span class="ruby-identifier">synchronize</span> { <span class="ruby-ivar">@cache</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>) }
16
+ 208: <span class="ruby-keyword kw">end</span></pre>
17
17
  </body>
18
18
  </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/esi/cache.rb, line 206</span>
14
- 206: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete_unlocked</span>( <span class="ruby-identifier">key</span> )
15
- 207: <span class="ruby-ivar">@cache</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>)
16
- 208: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/esi/cache.rb, line 210</span>
14
+ 210: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete_unlocked</span>( <span class="ruby-identifier">key</span> )
15
+ 211: <span class="ruby-ivar">@cache</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>)
16
+ 212: <span class="ruby-keyword kw">end</span></pre>
17
17
  </body>
18
18
  </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/esi/cache.rb, line 210</span>
14
- 210: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sweep_unlocked!</span>
15
- 211: <span class="ruby-ivar">@cache</span>.<span class="ruby-identifier">reject!</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-operator">!</span><span class="ruby-identifier">v</span>.<span class="ruby-identifier">valid?</span> }
16
- 212: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/esi/cache.rb, line 214</span>
14
+ 214: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sweep_unlocked!</span>
15
+ 215: <span class="ruby-ivar">@cache</span>.<span class="ruby-identifier">reject!</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-operator">!</span><span class="ruby-identifier">v</span>.<span class="ruby-identifier">valid?</span> }
16
+ 216: <span class="ruby-keyword kw">end</span></pre>
17
17
  </body>
18
18
  </html>
@@ -59,29 +59,29 @@
59
59
  lib/esi/tag/attempt.rb
60
60
  </a>
61
61
  <br />
62
- <a href="../../files/lib/esi/tag/base_rb.html">
63
- lib/esi/tag/base.rb
62
+ <a href="../../files/lib/esi/tag/invalidate_rb.html">
63
+ lib/esi/tag/invalidate.rb
64
64
  </a>
65
65
  <br />
66
66
  <a href="../../files/lib/esi/tag/container_rb.html">
67
67
  lib/esi/tag/container.rb
68
68
  </a>
69
- <br />
70
- <a href="../../files/lib/esi/tag/except_rb.html">
71
- lib/esi/tag/except.rb
72
- </a>
73
69
  <br />
74
70
  <a href="../../files/lib/esi/tag/include_rb.html">
75
71
  lib/esi/tag/include.rb
76
72
  </a>
77
73
  <br />
78
- <a href="../../files/lib/esi/tag/invalidate_rb.html">
79
- lib/esi/tag/invalidate.rb
74
+ <a href="../../files/lib/esi/tag/base_rb.html">
75
+ lib/esi/tag/base.rb
80
76
  </a>
81
77
  <br />
82
78
  <a href="../../files/lib/esi/tag/try_rb.html">
83
79
  lib/esi/tag/try.rb
84
80
  </a>
81
+ <br />
82
+ <a href="../../files/lib/esi/tag/except_rb.html">
83
+ lib/esi/tag/except.rb
84
+ </a>
85
85
  <br />
86
86
  </td>
87
87
  </tr>
data/doc/rdoc/created.rid CHANGED
@@ -1 +1 @@
1
- Mon, 16 Jun 2008 17:18:51 -0400
1
+ Mon, 23 Jun 2008 16:57:11 -0400
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Tue May 27 11:00:46 -0400 2008</td>
59
+ <td>Mon Jun 23 15:57:40 -0400 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Tue May 27 11:00:46 -0400 2008</td>
59
+ <td>Mon Jun 23 15:57:40 -0400 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Tue May 27 11:00:46 -0400 2008</td>
59
+ <td>Mon Jun 23 15:57:40 -0400 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -71,7 +71,8 @@
71
71
  <div id="description">
72
72
  <h1>About</h1>
73
73
  <p>
74
- MongrelESI is meant to make caching easier by distributing the cache logic.
74
+ mongrel-esi is meant to make caching easier by distributing the cache
75
+ logic.
75
76
  </p>
76
77
  <p>
77
78
  The idea is to represent each part of the page as a unique URL.
@@ -87,7 +88,8 @@ basic instructions
87
88
  esi:include:
88
89
  </p>
89
90
  <pre>
90
- src - request path, response replaces esi:include tag
91
+ src - request path, response replaces esi:include tag
92
+ alt - if src is unavailable, use alt
91
93
  timeout - how long to wait on the response
92
94
  max-age - how long to cache the entity
93
95
  onerror - whether continue on errors or trigger an exception
@@ -123,8 +125,8 @@ esi:try/esi:attempt/esi:except
123
125
  </pre>
124
126
  <h1>Proxy Config</h1>
125
127
  <p>
126
- MongrelESI is a proxy server. To configure where requests should be proxied
127
- modify the config/routes.yml file.
128
+ mongrel-esi is a proxy server. To configure where requests should be
129
+ proxied modify the config/routes.yml file.
128
130
  </p>
129
131
  <p>
130
132
  Here&#8216;s an example:
@@ -191,7 +193,7 @@ which will respond with:
191
193
  &lt;div&gt;hello User42&lt;/div&gt;
192
194
  </p>
193
195
  <p>
194
- And finally, MongrelESI will respond to the original client request with
196
+ And finally, mongrel-esi will respond to the original client request with
195
197
  the combined documents: &lt;html&gt; &lt;head&gt;&lt;title&gt;Your
196
198
  Page&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div
197
199
  class=&quot;header&quot;&gt;&lt;div&gt;hello User42&lt;/div&gt;&lt;/div&gt;
@@ -200,7 +202,7 @@ content&lt;/div&gt; &lt;/body&gt; &lt;/html&gt;
200
202
  </p>
201
203
  <h2>Integrating with your applications</h2>
202
204
  <p>
203
- MongrelESI was built to support integrating lots of applications together.
205
+ mongrel-esi was built to support integrating lots of applications together.
204
206
  </p>
205
207
  <p>
206
208
  Primarily, you&#8216;ll want to integrate by having one base application
@@ -212,14 +214,14 @@ part of the page, while rails delivers a reliable listing of current forum
212
214
  discussion, and maybe a python presense indicator for forum posts&#8230;
213
215
  </p>
214
216
  <p>
215
- One thing to keep in mind is mongrel esi is a proxy server. This means for
217
+ One thing to keep in mind is mongrel-esi is a proxy server. This means for
216
218
  each request it needs to know where to route the requests. To support this
217
219
  config.rb can express any regex to match a url and determine where a
218
220
  request should be forwarded as well as defining a default route.
219
221
  </p>
220
222
  <p>
221
223
  It is also sometimes convenient to allow multiple applications to store or
222
- house static content. For this to work mongrel esi needs to know in what
224
+ house static content. For this to work mongrel-esi needs to know in what
223
225
  directories to search for static files. This can be done by using the <a
224
226
  href="../classes/MultiDirHandler.html">MultiDirHandler</a> (see
225
227
  rev-config.rb)
@@ -230,7 +232,7 @@ From [<a href="http://www.w3.org/TR/esi-lang">www.w3.org/TR/esi-lang</a>
230
232
  esi-lang]
231
233
  </p>
232
234
  <p>
233
- MongrelESI supports basic include, exception handling and invalidation. It
235
+ mongrel-esi supports basic include, exception handling and invalidation. It
234
236
  does not include support for Variable or Conditional processing. It does
235
237
  have suppport for COOKIE variables. (e.g. $(HTTP_COOKIE{name}) will be
236
238
  replaced with the value of the cookie, name)
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Mon Jun 16 11:18:31 -0400 2008</td>
59
+ <td>Mon Jun 23 15:57:37 -0400 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Tue Jun 10 10:15:53 -0400 2008</td>
59
+ <td>Mon Jun 23 15:57:37 -0400 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Mon Jun 16 11:19:34 -0400 2008</td>
59
+ <td>Mon Jun 23 15:57:37 -0400 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Mon Jun 16 11:18:31 -0400 2008</td>
59
+ <td>Mon Jun 23 15:57:37 -0400 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Mon Jun 16 11:19:27 -0400 2008</td>
59
+ <td>Mon Jun 23 15:57:37 -0400 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -156,6 +156,24 @@ static void esi_parser_echo_char( ESIParser *parser, char ch ) {
156
156
  }
157
157
  </pre>
158
158
  <p>
159
+ } static void esi_parser_send_buffer( ESIParser *parser, const char *seq,
160
+ size_t len ) {
161
+ </p>
162
+ <pre>
163
+ const char *nseq = seq + len;
164
+ size_t nlen = parser-&gt;output_buffer_size + len;
165
+
166
+ if( nlen &lt; ESI_OUTPUT_BUFFER_SIZE ) {
167
+ memcpy( parser-&gt;output_buffer + parser-&gt;output_buffer_size, seq, len );
168
+ parser-&gt;output_buffer_size += len;
169
+ }
170
+ else if( nlen &gt; ESI_OUTPUT_BUFFER_SIZE ) {
171
+ while( seq != nseq ) {
172
+ esi_parser_echo_char( parser, *seq++ );
173
+ }
174
+ }
175
+ </pre>
176
+ <p>
159
177
  } /* send any buffered characters to the output handler.
160
178
  </p>
161
179
  <pre>
@@ -210,6 +228,7 @@ static void esi_parser_concat_to_echobuffer( ESIParser *parser, char ch ) {
210
228
  /* double the echobuffer size
211
229
  * we're getting some crazy input if this case ever happens
212
230
  */
231
+ printf( &quot;increase echobuffer: %d, %s\n&quot;, parser-&gt;echobuffer_allocated, parser-&gt;echobuffer );
213
232
  parser-&gt;echobuffer_allocated *= 2;
214
233
  parser-&gt;echobuffer = (char*)realloc( parser-&gt;echobuffer, parser-&gt;echobuffer_allocated );
215
234
  }
@@ -299,9 +318,8 @@ static void rtrim_pointer( const char **ptr, const char *bounds, size_t
299
318
  /* send the start tag and end tag message */
300
319
  esi_parser_flush_output( parser );
301
320
  parser-&gt;start_tag_handler( data, parser-&gt;tag_text, parser-&gt;tag_text_length, parser-&gt;attributes, parser-&gt;user_data );
302
- esi_parser_flush_output( parser );
303
321
  parser-&gt;end_tag_handler( data, parser-&gt;tag_text, parser-&gt;tag_text_length, parser-&gt;user_data );
304
- esi_parser_flush_output( parser );
322
+ //printf(&quot;\t[see inline tag]\n&quot;);
305
323
 
306
324
  /* mark the position */
307
325
  parser-&gt;tag_text = NULL;
@@ -321,7 +339,7 @@ static void rtrim_pointer( const char **ptr, const char *bounds, size_t
321
339
  /* send the start and end tag message */
322
340
  esi_parser_flush_output( parser );
323
341
  parser-&gt;start_tag_handler( data, parser-&gt;tag_text, parser-&gt;tag_text_length, parser-&gt;attributes, parser-&gt;user_data );
324
- esi_parser_flush_output( parser );
342
+ //printf(&quot;\t[see start tag with attributes]\n&quot;);
325
343
 
326
344
  parser-&gt;tag_text = NULL;
327
345
  parser-&gt;tag_text_length = 0;
@@ -387,7 +405,7 @@ static void rtrim_pointer( const char **ptr, const char *bounds, size_t
387
405
 
388
406
  esi_parser_flush_output( parser );
389
407
  parser-&gt;start_tag_handler( data, parser-&gt;tag_text, parser-&gt;tag_text_length, NULL, parser-&gt;user_data );
390
- esi_parser_flush_output( parser );
408
+ //printf(&quot;\t[see start tag]\n&quot;);
391
409
 
392
410
  esi_parser_echobuffer_clear( parser );
393
411
  }
@@ -405,7 +423,7 @@ static void rtrim_pointer( const char **ptr, const char *bounds, size_t
405
423
 
406
424
  esi_parser_flush_output( parser );
407
425
  parser-&gt;end_tag_handler( data, parser-&gt;tag_text, parser-&gt;tag_text_length, parser-&gt;user_data );
408
- esi_parser_flush_output( parser );
426
+ //printf(&quot;\t[see end tag]\n&quot;);
409
427
 
410
428
  esi_parser_echobuffer_clear( parser );
411
429
  }
@@ -463,8 +481,10 @@ const char *value, size_t value_length ) {
463
481
  </p>
464
482
  <pre>
465
483
  ESIAttribute *attr = (ESIAttribute*)malloc(sizeof(ESIAttribute));
466
- attr-&gt;name = esi_strndup(name, name_length);
467
- attr-&gt;value = esi_strndup(value, value_length);
484
+ attr-&gt;name = name;//esi_strndup(name, name_length);
485
+ attr-&gt;value = value;//esi_strndup(value, value_length);
486
+ attr-&gt;name_length = name_length;
487
+ attr-&gt;value_length = value_length;
468
488
  attr-&gt;next = NULL;
469
489
  return attr;
470
490
  </pre>
@@ -479,16 +499,16 @@ ESIAttribute *esi_attribute_copy( ESIAttribute *attribute ) {
479
499
  if( !attribute ){ return NULL; }
480
500
 
481
501
  // copy the first attribute
482
- nattr = esi_attribute_new( attribute-&gt;name, strlen( attribute-&gt;name ),
483
- attribute-&gt;value, strlen( attribute-&gt;value ) );
502
+ nattr = esi_attribute_new( attribute-&gt;name, attribute-&gt;name_length,
503
+ attribute-&gt;value, attribute-&gt;value_length );
484
504
  // save a pointer for return
485
505
  head = nattr;
486
506
  // copy next attributes
487
507
  attribute = attribute-&gt;next;
488
508
  while( attribute ) {
489
509
  // set the next attribute
490
- nattr-&gt;next = esi_attribute_new( attribute-&gt;name, strlen( attribute-&gt;name ),
491
- attribute-&gt;value, strlen( attribute-&gt;value ) );
510
+ nattr-&gt;next = esi_attribute_new( attribute-&gt;name, attribute-&gt;name_length,
511
+ attribute-&gt;value, attribute-&gt;value_length );
492
512
  // next attribute
493
513
  nattr = nattr-&gt;next;
494
514
  attribute = attribute-&gt;next;
@@ -504,8 +524,11 @@ void esi_attribute_free( ESIAttribute *attribute ) {
504
524
  <pre>
505
525
  ESIAttribute *ptr;
506
526
  while( attribute ){
507
- free( attribute-&gt;name );
508
- free( attribute-&gt;value );
527
+ </pre>
528
+ <p>
529
+ // free( attribute-&gt;name ); // free( attribute-&gt;value );
530
+ </p>
531
+ <pre>
509
532
  ptr = attribute-&gt;next;
510
533
  free( attribute );
511
534
  attribute = ptr;
@@ -526,9 +549,11 @@ ESIParser *esi_parser_new() {
526
549
  parser-&gt;attr_value = NULL;
527
550
  parser-&gt;overflow_data_size = 0;
528
551
  parser-&gt;overflow_data = NULL;
552
+ parser-&gt;overflow_data_allocated = 0;
553
+ parser-&gt;using_overflow = 0;
529
554
 
530
555
  /* allocate ESI_OUTPUT_BUFFER_SIZE bytes for the echobuffer */
531
- parser-&gt;echobuffer_allocated = ESI_OUTPUT_BUFFER_SIZE;
556
+ parser-&gt;echobuffer_allocated = ESI_ECHOBUFFER_SIZE;
532
557
  parser-&gt;echobuffer_index = -1;
533
558
  parser-&gt;echobuffer = (char*)malloc(sizeof(char)*parser-&gt;echobuffer_allocated);
534
559
 
@@ -551,6 +576,7 @@ ESIParser *esi_parser_new() {
551
576
  if( parser-&gt;overflow_data ){ free( parser-&gt;overflow_data ); }
552
577
 
553
578
  free( parser-&gt;echobuffer );
579
+
554
580
  esi_attribute_free( parser-&gt;attributes );
555
581
 
556
582
  free( parser );
@@ -647,6 +673,69 @@ size_t length ) {
647
673
  }
648
674
  </p>
649
675
  <p>
676
+ static void esi_parser_append_data_to_overflow_data( ESIParser *parser,
677
+ const char *data, size_t length ) {
678
+ </p>
679
+ <pre>
680
+ int mark_offset = 0;
681
+ int tag_text_offset = 0;
682
+ int attr_key_offset = 0;
683
+ int attr_value_offset = 0;
684
+
685
+ if( parser-&gt;using_overflow ) {
686
+ // recompute mark, tag_text, attr_key, and attr_value as they all exist within overflow_data
687
+ mark_offset = compute_offset( parser-&gt;mark, parser-&gt;overflow_data );
688
+ tag_text_offset = compute_offset( parser-&gt;tag_text, parser-&gt;overflow_data );
689
+ attr_key_offset = compute_offset( parser-&gt;attr_key, parser-&gt;overflow_data );
690
+ attr_value_offset = compute_offset( parser-&gt;attr_value, parser-&gt;overflow_data );
691
+ }
692
+ else {
693
+ // recompute mark, tag_text, attr_key, and attr_value as they all exist within data
694
+ mark_offset = compute_offset( parser-&gt;mark, data );
695
+ tag_text_offset = compute_offset( parser-&gt;tag_text, data );
696
+ attr_key_offset = compute_offset( parser-&gt;attr_key, data );
697
+ attr_value_offset = compute_offset( parser-&gt;attr_value, data );
698
+ }
699
+
700
+ if( parser-&gt;overflow_data ) {
701
+ // check if we need to resize or grow the buffer
702
+ if( (parser-&gt;overflow_data_size + length) &gt; parser-&gt;overflow_data_allocated ) {
703
+ parser-&gt;overflow_data_allocated += length;
704
+ </pre>
705
+ <p>
706
+ // printf( &quot;realloc: %d bytes, using %d\n&quot;,
707
+ (int)parser-&gt;overflow_data_allocated,
708
+ (int)(parser-&gt;overflow_data_size+length) );
709
+ </p>
710
+ <pre>
711
+ parser-&gt;overflow_data = (char*)realloc( parser-&gt;overflow_data, sizeof(char)*(parser-&gt;overflow_data_allocated) );
712
+ }
713
+ memcpy( parser-&gt;overflow_data+parser-&gt;overflow_data_size, data, length );
714
+ parser-&gt;overflow_data_size += length;
715
+ }
716
+ else {
717
+ parser-&gt;overflow_data_allocated = ESI_OUTPUT_BUFFER_SIZE &gt; length ? ESI_OUTPUT_BUFFER_SIZE : length;
718
+ parser-&gt;overflow_data = (char*)malloc( sizeof( char ) * parser-&gt;overflow_data_allocated );
719
+ memcpy( parser-&gt;overflow_data, data, length );
720
+ parser-&gt;overflow_data_size = length;
721
+ </pre>
722
+ <p>
723
+ // printf( &quot;malloc: %d for %d bytes\n&quot;,
724
+ (int)parser-&gt;overflow_data_allocated, (int)length );
725
+ </p>
726
+ <pre>
727
+ }
728
+
729
+ // in our new memory space mark will now be
730
+ parser-&gt;mark = ( mark_offset &gt;= 0 ) ? parser-&gt;overflow_data + mark_offset : NULL;
731
+ parser-&gt;tag_text = ( tag_text_offset &gt;= 0 ) ? parser-&gt;overflow_data + tag_text_offset : NULL;
732
+ parser-&gt;attr_key = ( attr_key_offset &gt;= 0 ) ? parser-&gt;overflow_data + attr_key_offset : NULL;
733
+ parser-&gt;attr_value = ( attr_value_offset &gt;= 0 ) ? parser-&gt;overflow_data + attr_value_offset : NULL;
734
+ </pre>
735
+ <p>
736
+ }
737
+ </p>
738
+ <p>
650
739
  /* accept an arbitrary length string buffer
651
740
  </p>
652
741
  <pre>
@@ -670,56 +759,31 @@ int esi_parser_execute( ESIParser *parser, const char *data, size_t length
670
759
  if( length == 0 ){ return cs; }
671
760
 
672
761
  /* scan data for any '&lt;esi:' start sequences, /&lt;$/, /&lt;e$/, /&lt;es$/, /&lt;esi$/, /&lt;esi:$/ */
673
- if( cs == esi_start ) {
762
+ if( cs == esi_start || cs == 0 ) {
674
763
  pindex = esi_parser_scan_for_start( parser, data, length );
675
- if( pindex == -1 ) {
676
- for( pindex = 0; pindex &lt; length; ++pindex ) {
677
- esi_parser_echo_char( parser, data[pindex] );
678
- }
679
- return cs;
764
+ if( pindex == -1 ) { /* this means there are no start sequences in the buffer we recieved */
765
+ esi_parser_send_buffer( parser, data, length );
766
+ return cs; /* no esi start sequences send it all out and break out early */
680
767
  }
681
768
  }
682
769
 
683
- /* there's an existing overflow buffer data append the new data to the existing data */
684
- if( parser-&gt;overflow_data &amp;&amp; parser-&gt;overflow_data_size &gt; 0 ) {
685
-
686
- // recompute mark, tag_text, attr_key, and attr_value since they all exist within overflow_data
687
- int mark_offset = compute_offset( parser-&gt;mark, parser-&gt;overflow_data );
688
- int tag_text_offset = compute_offset( parser-&gt;tag_text, parser-&gt;overflow_data );
689
- int attr_key_offset = compute_offset( parser-&gt;attr_key, parser-&gt;overflow_data );
690
- int attr_value_offset = compute_offset( parser-&gt;attr_value, parser-&gt;overflow_data );
691
-
692
- parser-&gt;overflow_data = (char*)realloc( parser-&gt;overflow_data, sizeof(char)*(parser-&gt;overflow_data_size+length) );
693
- memcpy( parser-&gt;overflow_data+parser-&gt;overflow_data_size, data, length );
694
-
695
- p = parser-&gt;overflow_data + parser-&gt;overflow_data_size;
696
-
697
- // in our new memory space mark will now be
698
- parser-&gt;mark = ( mark_offset &gt;= 0 ) ? parser-&gt;overflow_data + mark_offset : NULL;
699
- parser-&gt;tag_text = ( tag_text_offset &gt;= 0 ) ? parser-&gt;overflow_data + tag_text_offset : NULL;
700
- parser-&gt;attr_key = ( attr_key_offset &gt;= 0 ) ? parser-&gt;overflow_data + attr_key_offset : NULL;
701
- parser-&gt;attr_value = ( attr_value_offset &gt;= 0 ) ? parser-&gt;overflow_data + attr_value_offset : NULL;
770
+ /* there's an existing overflow buffer and it's being used, append the new data */
771
+ //if( parser-&gt;overflow_data &amp;&amp; parser-&gt;overflow_data_size &gt; 0 ) {
772
+ if( parser-&gt;using_overflow ) {
773
+ int prev_overflow_size = parser-&gt;overflow_data_size; // save the current overflow size
774
+ esi_parser_append_data_to_overflow_data( parser, data, length );
702
775
 
776
+ /* set parser variables */
777
+ p = parser-&gt;overflow_data + prev_overflow_size;
703
778
  data = parser-&gt;overflow_data;
704
- parser-&gt;overflow_data_size = length = length + parser-&gt;overflow_data_size;
705
- </pre>
706
- <p>
707
- // printf( &quot;grow overflow data: %ld\n&quot;,
708
- parser-&gt;overflow_data_size );
709
- </p>
710
- <pre>
779
+ length = parser-&gt;overflow_data_size;
711
780
  pe = data + length;
712
-
713
781
  }
714
782
 
715
783
  if( !parser-&gt;mark ) {
716
784
  parser-&gt;mark = p;
717
785
  }
718
- </pre>
719
- <p>
720
- // printf( &quot;cs: %d, &quot;, cs );
721
- </p>
722
- <pre>
786
+
723
787
  %% write exec;
724
788
 
725
789
  parser-&gt;cs = cs;
@@ -727,37 +791,13 @@ parser-&gt;overflow_data_size );
727
791
  if( cs != esi_start &amp;&amp; cs != 0 ) {
728
792
 
729
793
  /* reached the end and we're not at a termination point save the buffer as overflow */
730
- if( !parser-&gt;overflow_data ){
731
- // recompute mark, tag_text, attr_key, and attr_value since they all exist within overflow_data
732
- int mark_offset = compute_offset( parser-&gt;mark, data );
733
- int tag_text_offset = compute_offset( parser-&gt;tag_text, data );
734
- int attr_key_offset = compute_offset( parser-&gt;attr_key, data );
735
- int attr_value_offset = compute_offset( parser-&gt;attr_value, data );
736
- //debug_string( &quot;mark before move&quot;, parser-&gt;mark, 1 );
737
-
738
- if( ESI_OUTPUT_BUFFER_SIZE &gt; length ) {
739
- parser-&gt;echobuffer_allocated = ESI_OUTPUT_BUFFER_SIZE;
740
- }
741
- else {
742
- parser-&gt;echobuffer_allocated = length;
743
- }
744
- parser-&gt;overflow_data = (char*)malloc( sizeof( char ) * parser-&gt;echobuffer_allocated );
745
- memcpy( parser-&gt;overflow_data, data, length );
746
- parser-&gt;overflow_data_size = length;
747
- //printf( &quot;allocate overflow data: %ld\n&quot;, parser-&gt;echobuffer_allocated );
748
-
749
- // in our new memory space mark will now be
750
- parser-&gt;mark = ( mark_offset &gt;= 0 ) ? parser-&gt;overflow_data + mark_offset : NULL;
751
- parser-&gt;tag_text = ( tag_text_offset &gt;= 0 ) ? parser-&gt;overflow_data + tag_text_offset : NULL;
752
- parser-&gt;attr_key = ( attr_key_offset &gt;= 0 ) ? parser-&gt;overflow_data + attr_key_offset : NULL;
753
- parser-&gt;attr_value = ( attr_value_offset &gt;= 0 ) ? parser-&gt;overflow_data + attr_value_offset : NULL;
754
- //if( parser-&gt;mark ){ debug_string( &quot;mark after move&quot;, parser-&gt;mark, 1 ); } else { printf( &quot;mark is now empty\n&quot; ); }
794
+ if( !parser-&gt;using_overflow ) {
795
+ esi_parser_append_data_to_overflow_data( parser, data, length );
796
+ parser-&gt;using_overflow = 1;
755
797
  }
756
798
 
757
- }else if( parser-&gt;overflow_data ) {
758
- /* dump the overflow buffer execution ended at a final state */
759
- free( parser-&gt;overflow_data );
760
- parser-&gt;overflow_data = NULL;
799
+ } else if ( parser-&gt;using_overflow ) {
800
+ parser-&gt;using_overflow = 0;
761
801
  parser-&gt;overflow_data_size = 0;
762
802
  }
763
803