IOWA 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (502) hide show
  1. checksums.yaml +7 -0
  2. data/CONTRIBUTORS +14 -0
  3. data/README.md +23 -0
  4. data/RELEASE_NOTES +77 -0
  5. data/ToDo +21 -0
  6. data/components/CRUDList/CRUDList.html +13 -0
  7. data/components/CRUDList/CRUDList.iwa +136 -0
  8. data/components/Content/Content.html +0 -0
  9. data/components/Content/Content.iwa +143 -0
  10. data/components/Content/example/README +9 -0
  11. data/components/Content/example/cgi/iowa.cgi +10 -0
  12. data/components/Content/example/demo.rb +30 -0
  13. data/components/Content/example/doc/index.html +7 -0
  14. data/components/Content/example/iowa/Content.html +1 -0
  15. data/components/Content/example/iowa/Content.iwa +1 -0
  16. data/components/Content/example/iowa/Main.html +6 -0
  17. data/components/Content/example/iowa/Main.iwa +3 -0
  18. data/components/Content/example/iowa/_content/body +7 -0
  19. data/components/Content/example/iowa/_content/body2 +3 -0
  20. data/components/Content/example/iowa/_content/title +2 -0
  21. data/components/Content/example/iowa/app.cnf +8 -0
  22. data/components/Content/example/iowa/app.rb +8 -0
  23. data/components/Content/example/webrick.rb +38 -0
  24. data/components/Include/Include.html +1 -0
  25. data/components/Include/Include.iwa +30 -0
  26. data/components/Include/readme +5 -0
  27. data/components/JumpTo/JumpTo.html +8 -0
  28. data/components/JumpTo/JumpTo.iwa +8 -0
  29. data/components/JumpTo/readme +6 -0
  30. data/doc/Architecture.txt +6 -0
  31. data/doc/History.txt +33 -0
  32. data/doc/StandardDispatcher.txt +19 -0
  33. data/examples/blog/README +1 -0
  34. data/examples/hello_world/README +17 -0
  35. data/examples/hello_world/htdocs/hello_world_html.html +24 -0
  36. data/examples/hello_world/htdocs/hello_world_ruby.html +41 -0
  37. data/examples/hello_world/iowa/HelloWorld.html +14 -0
  38. data/examples/hello_world/iowa/HelloWorld.iwa +31 -0
  39. data/examples/hello_world/iowa/Index.html +16 -0
  40. data/examples/hello_world/iowa/Index.iwa +5 -0
  41. data/examples/hello_world/iowa/iowa_hello_world.cnf +19 -0
  42. data/examples/hello_world/iowa/iowa_hello_world.rb +5 -0
  43. data/examples/hello_world/iowa/mapfile.cnf +6 -0
  44. data/examples/hw1/iowa/Main.html +1 -0
  45. data/examples/hw1/iowa/README +9 -0
  46. data/examples/hw1/iowa/hw.rb +4 -0
  47. data/examples/hw2/iowa/Main.html +10 -0
  48. data/examples/hw2/iowa/Main.iwa +7 -0
  49. data/examples/hw2/iowa/README +16 -0
  50. data/examples/hw2/iowa/hw.rb +4 -0
  51. data/examples/hw3/iowa/Main.html +11 -0
  52. data/examples/hw3/iowa/Main.iwa +7 -0
  53. data/examples/hw3/iowa/README +22 -0
  54. data/examples/hw3/iowa/hw.rb +4 -0
  55. data/examples/hw4/iowa/Greetings.html +10 -0
  56. data/examples/hw4/iowa/Greetings.iwa +9 -0
  57. data/examples/hw4/iowa/Main.html +12 -0
  58. data/examples/hw4/iowa/Main.iwa +10 -0
  59. data/examples/hw4/iowa/README +28 -0
  60. data/examples/hw4/iowa/hw.rb +4 -0
  61. data/examples/hw5/iowa/Footer.html +2 -0
  62. data/examples/hw5/iowa/Greetings.html +4 -0
  63. data/examples/hw5/iowa/Greetings.iwa +12 -0
  64. data/examples/hw5/iowa/Header.html +6 -0
  65. data/examples/hw5/iowa/Main.html +12 -0
  66. data/examples/hw5/iowa/Main.iwa +13 -0
  67. data/examples/hw5/iowa/README +16 -0
  68. data/examples/hw5/iowa/hw.rb +4 -0
  69. data/examples/template_server/iowa/Content.iwa +121 -0
  70. data/examples/template_server/iowa/Content.view +0 -0
  71. data/examples/template_server/iowa/DBContentDispatcher.rb +112 -0
  72. data/examples/template_server/iowa/DBContentPage.html +3 -0
  73. data/examples/template_server/iowa/DBContentPage.iwa +85 -0
  74. data/examples/template_server/iowa/app.cnf +13 -0
  75. data/examples/template_server/iowa/app.rb +5 -0
  76. data/ext/Classifier/classifier.c +256 -0
  77. data/ext/Classifier/ext_help.h +14 -0
  78. data/ext/Classifier/extconf.rb +5 -0
  79. data/ext/Classifier/tst.h +40 -0
  80. data/ext/Classifier/tst_cleanup.c +24 -0
  81. data/ext/Classifier/tst_delete.c +146 -0
  82. data/ext/Classifier/tst_grow_node_free_list.c +38 -0
  83. data/ext/Classifier/tst_init.c +41 -0
  84. data/ext/Classifier/tst_insert.c +192 -0
  85. data/ext/Classifier/tst_search.c +68 -0
  86. data/ext/http11/README +11 -0
  87. data/ext/http11/ext_help.h +15 -0
  88. data/ext/http11/extconf.rb +5 -0
  89. data/ext/http11/http11.c +534 -0
  90. data/ext/http11/http11.c.dif +422 -0
  91. data/ext/http11/http11_parser.c +1243 -0
  92. data/ext/http11/http11_parser.c.dif +193 -0
  93. data/ext/http11/http11_parser.h +49 -0
  94. data/ext/http11/http11_parser.h.dif +20 -0
  95. data/ext/http11/http11_parser.rl +192 -0
  96. data/ext/httpmachine/Makefile +149 -0
  97. data/ext/httpmachine/extconf.rb +33 -0
  98. data/ext/httpmachine/http.cpp +430 -0
  99. data/ext/httpmachine/http.h +156 -0
  100. data/ext/httpmachine/rubyhttp.cpp +165 -0
  101. data/external/mime-types/LICENCE +18 -0
  102. data/external/mime-types/README +46 -0
  103. data/external/mime-types/doc/classes/MIME.html +120 -0
  104. data/external/mime-types/doc/classes/MIME/InvalidContentType.html +119 -0
  105. data/external/mime-types/doc/classes/MIME/Type.html +866 -0
  106. data/external/mime-types/doc/classes/MIME/Type.src/M000010.html +22 -0
  107. data/external/mime-types/doc/classes/MIME/Type.src/M000011.html +18 -0
  108. data/external/mime-types/doc/classes/MIME/Type.src/M000012.html +19 -0
  109. data/external/mime-types/doc/classes/MIME/Type.src/M000013.html +18 -0
  110. data/external/mime-types/doc/classes/MIME/Type.src/M000014.html +26 -0
  111. data/external/mime-types/doc/classes/MIME/Type.src/M000015.html +33 -0
  112. data/external/mime-types/doc/classes/MIME/Type.src/M000016.html +27 -0
  113. data/external/mime-types/doc/classes/MIME/Type.src/M000017.html +35 -0
  114. data/external/mime-types/doc/classes/MIME/Type.src/M000018.html +34 -0
  115. data/external/mime-types/doc/classes/MIME/Type.src/M000019.html +24 -0
  116. data/external/mime-types/doc/classes/MIME/Type.src/M000020.html +38 -0
  117. data/external/mime-types/doc/classes/MIME/Type.src/M000021.html +22 -0
  118. data/external/mime-types/doc/classes/MIME/Type.src/M000022.html +18 -0
  119. data/external/mime-types/doc/classes/MIME/Type.src/M000023.html +18 -0
  120. data/external/mime-types/doc/classes/MIME/Type.src/M000024.html +18 -0
  121. data/external/mime-types/doc/classes/MIME/Type.src/M000025.html +18 -0
  122. data/external/mime-types/doc/classes/MIME/Type.src/M000026.html +18 -0
  123. data/external/mime-types/doc/classes/MIME/Type.src/M000027.html +18 -0
  124. data/external/mime-types/doc/classes/MIME/Type.src/M000028.html +18 -0
  125. data/external/mime-types/doc/classes/MIME/Type.src/M000029.html +18 -0
  126. data/external/mime-types/doc/classes/MIME/Type.src/M000030.html +19 -0
  127. data/external/mime-types/doc/classes/MIME/Type.src/M000031.html +26 -0
  128. data/external/mime-types/doc/classes/MIME/Types.html +459 -0
  129. data/external/mime-types/doc/classes/MIME/Types.src/M000001.html +19 -0
  130. data/external/mime-types/doc/classes/MIME/Types.src/M000002.html +32 -0
  131. data/external/mime-types/doc/classes/MIME/Types.src/M000003.html +21 -0
  132. data/external/mime-types/doc/classes/MIME/Types.src/M000004.html +18 -0
  133. data/external/mime-types/doc/classes/MIME/Types.src/M000005.html +26 -0
  134. data/external/mime-types/doc/classes/MIME/Types.src/M000006.html +18 -0
  135. data/external/mime-types/doc/classes/MIME/Types.src/M000007.html +18 -0
  136. data/external/mime-types/doc/classes/MIME/Types.src/M000008.html +18 -0
  137. data/external/mime-types/doc/classes/MIME/Types.src/M000009.html +18 -0
  138. data/external/mime-types/doc/created.rid +1 -0
  139. data/external/mime-types/doc/files/ChangeLog.html +320 -0
  140. data/external/mime-types/doc/files/README.html +145 -0
  141. data/external/mime-types/doc/files/lib/mime/types_rb.html +101 -0
  142. data/external/mime-types/doc/fr_class_index.html +30 -0
  143. data/external/mime-types/doc/fr_file_index.html +29 -0
  144. data/external/mime-types/doc/fr_method_index.html +57 -0
  145. data/external/mime-types/doc/index.html +24 -0
  146. data/external/mime-types/doc/rdoc-style.css +208 -0
  147. data/external/mime-types/lib/mime/types.rb +1558 -0
  148. data/external/package.rb +672 -0
  149. data/external/test_support.rb +95 -0
  150. data/external/tmail/README +7 -0
  151. data/external/tmail/tmail.rb +4 -0
  152. data/external/tmail/tmail/address.rb +222 -0
  153. data/external/tmail/tmail/base64.rb +52 -0
  154. data/external/tmail/tmail/compat.rb +39 -0
  155. data/external/tmail/tmail/config.rb +50 -0
  156. data/external/tmail/tmail/encode.rb +447 -0
  157. data/external/tmail/tmail/header.rb +895 -0
  158. data/external/tmail/tmail/info.rb +14 -0
  159. data/external/tmail/tmail/loader.rb +1 -0
  160. data/external/tmail/tmail/mail.rb +869 -0
  161. data/external/tmail/tmail/mailbox.rb +386 -0
  162. data/external/tmail/tmail/mbox.rb +1 -0
  163. data/external/tmail/tmail/net.rb +260 -0
  164. data/external/tmail/tmail/obsolete.rb +123 -0
  165. data/external/tmail/tmail/parser.rb +1475 -0
  166. data/external/tmail/tmail/parser.y +372 -0
  167. data/external/tmail/tmail/port.rb +356 -0
  168. data/external/tmail/tmail/scanner.rb +17 -0
  169. data/external/tmail/tmail/scanner_r.rb +243 -0
  170. data/external/tmail/tmail/stringio.rb +256 -0
  171. data/external/tmail/tmail/textutils.rb +197 -0
  172. data/external/tmail/tmail/tmail.rb +1 -0
  173. data/external/tmail/tmail/utils.rb +23 -0
  174. data/external/win32-process/README +133 -0
  175. data/external/win32-process/lib/win32/process.rb +561 -0
  176. data/external/windows-pr/README +145 -0
  177. data/external/windows-pr/doc/conversion_guide.txt +25 -0
  178. data/external/windows-pr/lib/windows/clipboard.rb +72 -0
  179. data/external/windows-pr/lib/windows/console.rb +323 -0
  180. data/external/windows-pr/lib/windows/device_io.rb +88 -0
  181. data/external/windows-pr/lib/windows/directory.rb +80 -0
  182. data/external/windows-pr/lib/windows/error.rb +313 -0
  183. data/external/windows-pr/lib/windows/eventlog.rb +120 -0
  184. data/external/windows-pr/lib/windows/file.rb +349 -0
  185. data/external/windows-pr/lib/windows/filesystem.rb +16 -0
  186. data/external/windows-pr/lib/windows/handle.rb +31 -0
  187. data/external/windows-pr/lib/windows/library.rb +76 -0
  188. data/external/windows-pr/lib/windows/limits.rb +13 -0
  189. data/external/windows-pr/lib/windows/memory.rb +117 -0
  190. data/external/windows-pr/lib/windows/msvcrt/buffer.rb +48 -0
  191. data/external/windows-pr/lib/windows/msvcrt/file.rb +18 -0
  192. data/external/windows-pr/lib/windows/msvcrt/string.rb +46 -0
  193. data/external/windows-pr/lib/windows/national.rb +557 -0
  194. data/external/windows-pr/lib/windows/path.rb +296 -0
  195. data/external/windows-pr/lib/windows/pipe.rb +77 -0
  196. data/external/windows-pr/lib/windows/process.rb +171 -0
  197. data/external/windows-pr/lib/windows/registry.rb +238 -0
  198. data/external/windows-pr/lib/windows/security.rb +89 -0
  199. data/external/windows-pr/lib/windows/service.rb +183 -0
  200. data/external/windows-pr/lib/windows/shell.rb +88 -0
  201. data/external/windows-pr/lib/windows/sound.rb +52 -0
  202. data/external/windows-pr/lib/windows/synchronize.rb +161 -0
  203. data/external/windows-pr/lib/windows/system_info.rb +70 -0
  204. data/external/windows-pr/lib/windows/unicode.rb +138 -0
  205. data/external/windows-pr/lib/windows/window.rb +22 -0
  206. data/iowa.gemspec +45 -0
  207. data/microprojects/DiskCache/LICENSE +28 -0
  208. data/microprojects/DiskCache/README +17 -0
  209. data/microprojects/DiskCache/external/package.rb +608 -0
  210. data/microprojects/DiskCache/external/test_support.rb +8 -0
  211. data/microprojects/DiskCache/setup.rb +22 -0
  212. data/microprojects/DiskCache/src/iowa/Association.rb +67 -0
  213. data/microprojects/DiskCache/src/iowa/Constants.rb +159 -0
  214. data/microprojects/DiskCache/src/iowa/DiskStore.rb +377 -0
  215. data/microprojects/DiskCache/src/iowa/Hash.rb +63 -0
  216. data/microprojects/DiskCache/src/iowa/Lockfile.rb +575 -0
  217. data/microprojects/DiskCache/src/iowa/Mutex.rb +142 -0
  218. data/microprojects/DiskCache/src/iowa/caches/DiskCache.rb +605 -0
  219. data/microprojects/DiskCache/src/iowa/caches/LRUCache.rb +287 -0
  220. data/microprojects/DiskCache/test/TC_DiskCache.rb +218 -0
  221. data/microprojects/LRUCache/LICENSE +28 -0
  222. data/microprojects/LRUCache/README +13 -0
  223. data/microprojects/LRUCache/external/package.rb +608 -0
  224. data/microprojects/LRUCache/external/test_support.rb +8 -0
  225. data/microprojects/LRUCache/setup.rb +22 -0
  226. data/microprojects/LRUCache/src/iowa/Association.rb +57 -0
  227. data/microprojects/LRUCache/src/iowa/Constants.rb +159 -0
  228. data/microprojects/LRUCache/src/iowa/Hash.rb +63 -0
  229. data/microprojects/LRUCache/src/iowa/Mutex.rb +129 -0
  230. data/microprojects/LRUCache/src/iowa/caches/LRUCache.rb +287 -0
  231. data/microprojects/LRUCache/test/TC_LRUCache.rb +65 -0
  232. data/microprojects/LinkedList/LICENSE +28 -0
  233. data/microprojects/LinkedList/README +13 -0
  234. data/microprojects/LinkedList/external/package.rb +608 -0
  235. data/microprojects/LinkedList/external/test_support.rb +8 -0
  236. data/microprojects/LinkedList/setup.rb +22 -0
  237. data/microprojects/LinkedList/src/iowa/LinkedList.rb +165 -0
  238. data/microprojects/LinkedList/test/TC_LinkedList.rb +42 -0
  239. data/microprojects/README +8 -0
  240. data/setup.rb +116 -0
  241. data/share/iowa/app_skeleton/Main.html +8 -0
  242. data/share/iowa/app_skeleton/Main.iwa +15 -0
  243. data/share/iowa/app_skeleton/app.cnf +48 -0
  244. data/share/iowa/app_skeleton/app.rb +58 -0
  245. data/share/iowa/app_skeleton/models/model.rb +49 -0
  246. data/src/ihc.rb +223 -0
  247. data/src/iowa.cgi +29 -0
  248. data/src/iowa.rb +637 -0
  249. data/src/iowa/AbstractCache.rb +96 -0
  250. data/src/iowa/AcceptLanguage.rb +76 -0
  251. data/src/iowa/Application.rb +928 -0
  252. data/src/iowa/ApplicationStats.rb +72 -0
  253. data/src/iowa/Association.rb +67 -0
  254. data/src/iowa/BindingsParser.rb +62 -0
  255. data/src/iowa/Breakpoint.rb +273 -0
  256. data/src/iowa/CSS.rb +564 -0
  257. data/src/iowa/Client.rb +192 -0
  258. data/src/iowa/Component.rb +405 -0
  259. data/src/iowa/ComponentProxy.rb +26 -0
  260. data/src/iowa/Config.rb +21 -0
  261. data/src/iowa/Constants.rb +226 -0
  262. data/src/iowa/Context.rb +218 -0
  263. data/src/iowa/ContextLogger.rb +16 -0
  264. data/src/iowa/DbPool.rb +222 -0
  265. data/src/iowa/DetachedComponent.rb +18 -0
  266. data/src/iowa/Dispatcher.rb +27 -0
  267. data/src/iowa/DynamicElements.rb +471 -0
  268. data/src/iowa/Element.rb +100 -0
  269. data/src/iowa/Email.rb +287 -0
  270. data/src/iowa/Extensions/AllExtensions.rb +4 -0
  271. data/src/iowa/Extensions/Class.rb +94 -0
  272. data/src/iowa/Extensions/Date.rb +88 -0
  273. data/src/iowa/Extensions/DateTime.rb +88 -0
  274. data/src/iowa/Extensions/Hash.rb +22 -0
  275. data/src/iowa/Extensions/Kernel.rb +6 -0
  276. data/src/iowa/Extensions/Numeric.rb +47 -0
  277. data/src/iowa/Extensions/Object.rb +11 -0
  278. data/src/iowa/Extensions/String.rb +60 -0
  279. data/src/iowa/Extensions/Time.rb +89 -0
  280. data/src/iowa/Extensions/TimeExtensions.rb +6 -0
  281. data/src/iowa/Form.rb +368 -0
  282. data/src/iowa/Hash.rb +85 -0
  283. data/src/iowa/ISAAC.rb +175 -0
  284. data/src/iowa/ImageSize.rb +279 -0
  285. data/src/iowa/IowaComponentMixins.rb +7 -0
  286. data/src/iowa/JSON-lexer.rb +296 -0
  287. data/src/iowa/JSON-objects.rb +201 -0
  288. data/src/iowa/KeyValueCoding.rb +91 -0
  289. data/src/iowa/LinkedList.rb +175 -0
  290. data/src/iowa/Loader.rb +22 -0
  291. data/src/iowa/Lockfile.rb +575 -0
  292. data/src/iowa/Logger.rb +74 -0
  293. data/src/iowa/Monkey.rb +20 -0
  294. data/src/iowa/Mutex.rb +142 -0
  295. data/src/iowa/Policy.rb +70 -0
  296. data/src/iowa/Pool.rb +243 -0
  297. data/src/iowa/PrettyException.rb +1091 -0
  298. data/src/iowa/Request.rb +244 -0
  299. data/src/iowa/Response.rb +133 -0
  300. data/src/iowa/Session.rb +354 -0
  301. data/src/iowa/SessionStats.rb +78 -0
  302. data/src/iowa/String.rb +65 -0
  303. data/src/iowa/Tag.rb +101 -0
  304. data/src/iowa/TemplateParser.rb +236 -0
  305. data/src/iowa/Util.rb +314 -0
  306. data/src/iowa/Webcache.rb +122 -0
  307. data/src/iowa/caches/BiLevelCache.rb +65 -0
  308. data/src/iowa/caches/ClassLimitedCache.rb +67 -0
  309. data/src/iowa/caches/DiskCache.rb +609 -0
  310. data/src/iowa/caches/DiskStore.rb +380 -0
  311. data/src/iowa/caches/LRUCache-alternative.rb +155 -0
  312. data/src/iowa/caches/LRUCache.rb +290 -0
  313. data/src/iowa/caches/SimpleLRUCache.rb +112 -0
  314. data/src/iowa/dispatchers/StandardDispatcher.rb +396 -0
  315. data/src/iowa/dispatchers/StandardDispatcherWithClassifier.rb +93 -0
  316. data/src/iowa/js/iowa_jsonrpc.js +381 -0
  317. data/src/iowa/js/jsonrpc.js +187 -0
  318. data/src/iowa/js/jsonrpc_async.js +261 -0
  319. data/src/iowa/loaders/DiskLoader.rb +50 -0
  320. data/src/iowa/loggers/Analogger.rb +54 -0
  321. data/src/iowa/loggers/AsyncLogger.rb +54 -0
  322. data/src/iowa/loggers/BitBucket.rb +38 -0
  323. data/src/iowa/loggers/Log4R.rb +13 -0
  324. data/src/iowa/loggers/Log4rLogger.rb +48 -0
  325. data/src/iowa/loggers/Logger.rb +29 -0
  326. data/src/iowa/loggers/RubyLogger.rb +9 -0
  327. data/src/iowa/pools/DBConnectionPool.rb +53 -0
  328. data/src/iowa/request/Apache.rb +90 -0
  329. data/src/iowa/request/EMHybrid.rb +59 -0
  330. data/src/iowa/request/ENV.rb +80 -0
  331. data/src/iowa/request/FCGI.rb +68 -0
  332. data/src/iowa/request/HTTPMachine.rb +75 -0
  333. data/src/iowa/request/Mongrel.rb +68 -0
  334. data/src/iowa/request/WEBrick.rb +48 -0
  335. data/src/iowa/version.rb +3 -0
  336. data/src/iowa/webrick/HTTPServer.rb +43 -0
  337. data/src/iowa/webrick/WEBrickServlet.rb +28 -0
  338. data/src/iowa_fcgi_handler.rb +101 -0
  339. data/src/iowa_httpmachine.rb +141 -0
  340. data/src/iowa_hybrid.rb +193 -0
  341. data/src/iowa_hybrid_cluster.rb +231 -0
  342. data/src/iowa_mongrel.rb +136 -0
  343. data/src/iowa_webrick.rb +194 -0
  344. data/src/iowa_webrick_legacy.rb +104 -0
  345. data/src/mod_iowa.rb +104 -0
  346. data/tcss.rb +61 -0
  347. data/test/README.windows +12 -0
  348. data/test/TC_AcceptLanguage.rb +61 -0
  349. data/test/TC_AppConfig.rb +43 -0
  350. data/test/TC_AppConfig/cgi/iowa.cgi +7 -0
  351. data/test/TC_AppConfig/doc/index.html +1 -0
  352. data/test/TC_AppConfig/iowa/Main.html +4 -0
  353. data/test/TC_AppConfig/iowa/Main.iwa +17 -0
  354. data/test/TC_AppConfig/iowa/README +1 -0
  355. data/test/TC_AppConfig/iowa/app.cnf +19 -0
  356. data/test/TC_AppConfig/iowa/app.rb +8 -0
  357. data/test/TC_AppConfig/webrick.rb +38 -0
  358. data/test/TC_Association.rb +29 -0
  359. data/test/TC_BiLevelCache.rb +71 -0
  360. data/test/TC_CGI_Adaptor.rb +55 -0
  361. data/test/TC_CGI_Adaptor/cgi/iowa.cgi +7 -0
  362. data/test/TC_CGI_Adaptor/doc/index.html +1 -0
  363. data/test/TC_CGI_Adaptor/iowa/Main.html +8 -0
  364. data/test/TC_CGI_Adaptor/iowa/Main.iwa +14 -0
  365. data/test/TC_CGI_Adaptor/iowa/README +1 -0
  366. data/test/TC_CGI_Adaptor/iowa/app.cnf +8 -0
  367. data/test/TC_CGI_Adaptor/iowa/app.rb +8 -0
  368. data/test/TC_CGI_Adaptor/webrick.rb +38 -0
  369. data/test/TC_CSS.rb +660 -0
  370. data/test/TC_ClassLimitedCache.rb +89 -0
  371. data/test/TC_Classifier.rb +80 -0
  372. data/test/TC_DbPool.rb +127 -0
  373. data/test/TC_DiskCache.rb +218 -0
  374. data/test/TC_Hybrid.rb +58 -0
  375. data/test/TC_Hybrid/doc/thing.txt +1 -0
  376. data/test/TC_Hybrid/iowa/Main.html +3 -0
  377. data/test/TC_Hybrid/iowa/Main.iwa +7 -0
  378. data/test/TC_Hybrid/iowa/NewPage.html +1 -0
  379. data/test/TC_Hybrid/iowa/NewPage.iwa +5 -0
  380. data/test/TC_Hybrid/iowa/app.cnf +10 -0
  381. data/test/TC_Hybrid/iowa/app.rb +5 -0
  382. data/test/TC_IOWAFunctions/doc/Ajax1.html +1 -0
  383. data/test/TC_IOWAFunctions/doc/Ajax1.iwa +1 -0
  384. data/test/TC_IOWAFunctions/doc/index.html +1 -0
  385. data/test/TC_IOWAFunctions/doc/js/dojo.js +9686 -0
  386. data/test/TC_IOWAFunctions/iowa/Ajax1.html +40 -0
  387. data/test/TC_IOWAFunctions/iowa/Ajax1.iwa +23 -0
  388. data/test/TC_IOWAFunctions/iowa/AjaxWidget.iwa +19 -0
  389. data/test/TC_IOWAFunctions/iowa/AjaxWidget.view +22 -0
  390. data/test/TC_IOWAFunctions/iowa/DanielTest.html +9 -0
  391. data/test/TC_IOWAFunctions/iowa/DanielTest.iwa +10 -0
  392. data/test/TC_IOWAFunctions/iowa/IntervalWidget.html +1 -0
  393. data/test/TC_IOWAFunctions/iowa/IntervalWidget.iwa +14 -0
  394. data/test/TC_IOWAFunctions/iowa/Main.html +1 -0
  395. data/test/TC_IOWAFunctions/iowa/NestedRepeat1.html +12 -0
  396. data/test/TC_IOWAFunctions/iowa/NestedRepeat1.iwa +24 -0
  397. data/test/TC_IOWAFunctions/iowa/RPCResponse.iwa +7 -0
  398. data/test/TC_IOWAFunctions/iowa/RPCResponse.view +1 -0
  399. data/test/TC_IOWAFunctions/iowa/Repeat1.iwa +31 -0
  400. data/test/TC_IOWAFunctions/iowa/Repeat1.view +9 -0
  401. data/test/TC_IOWAFunctions/iowa/Repeat2.iwa +32 -0
  402. data/test/TC_IOWAFunctions/iowa/Repeat2.view +11 -0
  403. data/test/TC_IOWAFunctions/iowa/Repeat3.iwa +44 -0
  404. data/test/TC_IOWAFunctions/iowa/Repeat3.view +18 -0
  405. data/test/TC_IOWAFunctions/iowa/TesCon.html +1 -0
  406. data/test/TC_IOWAFunctions/iowa/TesCon.iwa +5 -0
  407. data/test/TC_IOWAFunctions/iowa/app.cnf +19 -0
  408. data/test/TC_IOWAFunctions/iowa/app.rb +9 -0
  409. data/test/TC_IOWAFunctions/iowa/mapfile.cnf +8 -0
  410. data/test/TC_ISAAC.rb +52 -0
  411. data/test/TC_ImageSize.rb +84 -0
  412. data/test/TC_ImageSize/img.bmp +0 -0
  413. data/test/TC_ImageSize/img.gif +0 -0
  414. data/test/TC_ImageSize/img.jpg +0 -0
  415. data/test/TC_ImageSize/img.pcx +0 -0
  416. data/test/TC_ImageSize/img.pgm +7144 -0
  417. data/test/TC_ImageSize/img.png +0 -0
  418. data/test/TC_ImageSize/img.ppm +0 -0
  419. data/test/TC_ImageSize/img.psd +0 -0
  420. data/test/TC_ImageSize/img.tiff +0 -0
  421. data/test/TC_ImageSize/img.xbm +22 -0
  422. data/test/TC_KeyValueCoding.rb +35 -0
  423. data/test/TC_LRUCache.rb +296 -0
  424. data/test/TC_LinkedList.rb +46 -0
  425. data/test/TC_Lockfile.rb +106 -0
  426. data/test/TC_Minimal.rb +45 -0
  427. data/test/TC_Minimal/app.cnf +8 -0
  428. data/test/TC_Minimal/cgi-bin/iowa.cgi +11 -0
  429. data/test/TC_Minimal/doc/index.html +1 -0
  430. data/test/TC_Minimal/iowa/Main.html +1 -0
  431. data/test/TC_Minimal/iowa/README +1 -0
  432. data/test/TC_Minimal/iowa/app.rb +3 -0
  433. data/test/TC_Minimal/webrick.rb +38 -0
  434. data/test/TC_Mongrel.rb +58 -0
  435. data/test/TC_Mongrel/doc/thing.txt +1 -0
  436. data/test/TC_Mongrel/iowa/Main.html +3 -0
  437. data/test/TC_Mongrel/iowa/Main.iwa +7 -0
  438. data/test/TC_Mongrel/iowa/NewPage.html +1 -0
  439. data/test/TC_Mongrel/iowa/NewPage.iwa +5 -0
  440. data/test/TC_Mongrel/iowa/app.cnf +10 -0
  441. data/test/TC_Mongrel/iowa/app.rb +5 -0
  442. data/test/TC_NoSubclass.rb +56 -0
  443. data/test/TC_NoSubclass/cgi/iowa.cgi +7 -0
  444. data/test/TC_NoSubclass/doc/index.html +1 -0
  445. data/test/TC_NoSubclass/iowa/Main.html +8 -0
  446. data/test/TC_NoSubclass/iowa/Main.iwa +14 -0
  447. data/test/TC_NoSubclass/iowa/README +1 -0
  448. data/test/TC_NoSubclass/iowa/app.cnf +8 -0
  449. data/test/TC_NoSubclass/iowa/app.rb +5 -0
  450. data/test/TC_NoSubclass/webrick.rb +38 -0
  451. data/test/TC_Pool.rb +139 -0
  452. data/test/TC_RenderedCache/doc/thing.txt +1 -0
  453. data/test/TC_RenderedCache/iowa/BigPage.html +1 -0
  454. data/test/TC_RenderedCache/iowa/BigPage.iwa +12 -0
  455. data/test/TC_RenderedCache/iowa/Main.html +3 -0
  456. data/test/TC_RenderedCache/iowa/Main.iwa +7 -0
  457. data/test/TC_RenderedCache/iowa/NewPage.html +1 -0
  458. data/test/TC_RenderedCache/iowa/NewPage.iwa +11 -0
  459. data/test/TC_RenderedCache/iowa/app.cnf +13 -0
  460. data/test/TC_RenderedCache/iowa/app.rb +5 -0
  461. data/test/TC_RenderedCache/iowa/mapfile.map +4 -0
  462. data/test/TC_ResourceURL.rb +73 -0
  463. data/test/TC_ResourceURL/iowa/Main.html +2 -0
  464. data/test/TC_ResourceURL/iowa/Main.iwa +10 -0
  465. data/test/TC_ResourceURL/iowa/app.cnf +10 -0
  466. data/test/TC_ResourceURL/iowa/app.rb +5 -0
  467. data/test/TC_SimpleDetached.rb +41 -0
  468. data/test/TC_StandardDispatcher.rb +362 -0
  469. data/test/TC_StandardDispatcherWithClassifier.rb +358 -0
  470. data/test/TC_String.rb +24 -0
  471. data/test/TC_Tag.rb +41 -0
  472. data/test/TC_Webrick.rb +56 -0
  473. data/test/TC_Webrick/doc/thing.txt +1 -0
  474. data/test/TC_Webrick/iowa/Main.html +3 -0
  475. data/test/TC_Webrick/iowa/Main.iwa +7 -0
  476. data/test/TC_Webrick/iowa/NewPage.html +1 -0
  477. data/test/TC_Webrick/iowa/NewPage.iwa +5 -0
  478. data/test/TC_Webrick/iowa/app.cnf +10 -0
  479. data/test/TC_Webrick/iowa/app.rb +5 -0
  480. data/test/tc_template.rb +15 -0
  481. data/test/tests.conf +19 -0
  482. data/utils/CVS/Entries +3 -0
  483. data/utils/CVS/Repository +1 -0
  484. data/utils/CVS/Root +1 -0
  485. data/utils/QuickCert-1.0.2.tar.gz +0 -0
  486. data/utils/QuickCert-1.0.2/InstalledFiles +7 -0
  487. data/utils/QuickCert-1.0.2/MANIFEST +10 -0
  488. data/utils/QuickCert-1.0.2/Makefile +15 -0
  489. data/utils/QuickCert-1.0.2/README +56 -0
  490. data/utils/QuickCert-1.0.2/bin/QuickCert +355 -0
  491. data/utils/QuickCert-1.0.2/config.save +12 -0
  492. data/utils/QuickCert-1.0.2/data/examples/ruby/QuickCert/README +60 -0
  493. data/utils/QuickCert-1.0.2/data/examples/ruby/QuickCert/drbssl_c.rb +26 -0
  494. data/utils/QuickCert-1.0.2/data/examples/ruby/QuickCert/drbssl_s.rb +35 -0
  495. data/utils/QuickCert-1.0.2/data/examples/ruby/QuickCert/qc_config +21 -0
  496. data/utils/QuickCert-1.0.2/lib/QuickCert/defaults.rb +28 -0
  497. data/utils/QuickCert-1.0.2/setup.rb +1312 -0
  498. data/utils/iowa_apps +422 -0
  499. data/utils/smtp_sink.rb +9 -0
  500. data/utils/startup_template.cnf +27 -0
  501. data/utils/startup_template.rb +73 -0
  502. metadata +551 -0
@@ -0,0 +1,422 @@
1
+ *** /usr/local/ruby184/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/ext/http11/http11.c 2006-12-30 14:55:52.000000000 -0600
2
+ --- ./http11.c 2007-01-15 09:20:08.000000000 -0600
3
+ ***************
4
+ *** 1,6 ****
5
+ --- 1,11 ----
6
+ /**
7
+ * Copyright (c) 2005 Zed A. Shaw
8
+ * You can redistribute it and/or modify it under the same terms as Ruby.
9
+ + *
10
+ + * Modified September 2006, January 2007 by Kirk Haines in order to make
11
+ + * return results * more convenient for IOWA use and to separate the classifier
12
+ + * code from the parser code. To see the changes that were made, look in the
13
+ + * .dif files.
14
+ */
15
+ #include "ruby.h"
16
+ #include "ext_help.h"
17
+ ***************
18
+ *** 8,21 ****
19
+ #include <string.h>
20
+ #include "http11_parser.h"
21
+ #include <ctype.h>
22
+ - #include "tst.h"
23
+
24
+ ! static VALUE mMongrel;
25
+ static VALUE cHttpParser;
26
+ - static VALUE cURIClassifier;
27
+ static VALUE eHttpParserError;
28
+
29
+ - #define id_handler_map rb_intern("@handler_map")
30
+ #define id_http_body rb_intern("@http_body")
31
+
32
+ static VALUE global_http_prefix;
33
+ --- 13,23 ----
34
+ #include <string.h>
35
+ #include "http11_parser.h"
36
+ #include <ctype.h>
37
+
38
+ ! static VALUE mIowa;
39
+ static VALUE cHttpParser;
40
+ static VALUE eHttpParserError;
41
+
42
+ #define id_http_body rb_intern("@http_body")
43
+
44
+ static VALUE global_http_prefix;
45
+ ***************
46
+ *** 35,46 ****
47
+ static VALUE global_server_protocol;
48
+ static VALUE global_server_protocol_value;
49
+ static VALUE global_http_host;
50
+ ! static VALUE global_mongrel_version;
51
+ static VALUE global_server_software;
52
+ static VALUE global_port_80;
53
+
54
+ - #define TRIE_INCREASE 30
55
+ -
56
+ /** Defines common length and error messages for input length validation. */
57
+ #define DEF_MAX_LENGTH(N,length) const size_t MAX_##N##_LENGTH = length; const char *MAX_##N##_LENGTH_ERR = "HTTP element " # N " is longer than the " # length " allowed length."
58
+
59
+ --- 37,46 ----
60
+ static VALUE global_server_protocol;
61
+ static VALUE global_server_protocol_value;
62
+ static VALUE global_http_host;
63
+ ! static VALUE global_parser_version;
64
+ static VALUE global_server_software;
65
+ static VALUE global_port_80;
66
+
67
+ /** Defines common length and error messages for input length validation. */
68
+ #define DEF_MAX_LENGTH(N,length) const size_t MAX_##N##_LENGTH = length; const char *MAX_##N##_LENGTH_ERR = "HTTP element " # N " is longer than the " # length " allowed length."
69
+
70
+ ***************
71
+ *** 75,85 ****
72
+ f = rb_str_buf_cat(f, field, flen);
73
+
74
+ for(ch = RSTRING(f)->ptr, end = ch + RSTRING(f)->len; ch < end; ch++) {
75
+ ! if(*ch == '-') {
76
+ ! *ch = '_';
77
+ ! } else {
78
+ ! *ch = toupper(*ch);
79
+ ! }
80
+ }
81
+
82
+ rb_hash_aset(req, f, v);
83
+ --- 75,81 ----
84
+ f = rb_str_buf_cat(f, field, flen);
85
+
86
+ for(ch = RSTRING(f)->ptr, end = ch + RSTRING(f)->len; ch < end; ch++) {
87
+ ! *ch = toupper(*ch);
88
+ }
89
+
90
+ rb_hash_aset(req, f, v);
91
+ ***************
92
+ *** 173,179 ****
93
+ // grab the initial body and stuff it into an ivar
94
+ rb_ivar_set(req, id_http_body, rb_str_new(at, length));
95
+ rb_hash_aset(req, global_server_protocol, global_server_protocol_value);
96
+ ! rb_hash_aset(req, global_server_software, global_mongrel_version);
97
+ }
98
+
99
+
100
+ --- 169,175 ----
101
+ // grab the initial body and stuff it into an ivar
102
+ rb_ivar_set(req, id_http_body, rb_str_new(at, length));
103
+ rb_hash_aset(req, global_server_protocol, global_server_protocol_value);
104
+ ! rb_hash_aset(req, global_server_software, global_parser_version);
105
+ }
106
+
107
+
108
+ ***************
109
+ *** 258,264 ****
110
+
111
+ /**
112
+ * call-seq:
113
+ ! * parser.execute(req_hash, data, start) -> Integer
114
+ *
115
+ * Takes a Hash and a String of data, parses the String of data filling in the Hash
116
+ * returning an Integer to indicate how much of the data has been read. No matter
117
+ --- 254,260 ----
118
+
119
+ /**
120
+ * call-seq:
121
+ ! * parser.execute(req_headers, req_params, data, start) -> Integer
122
+ *
123
+ * Takes a Hash and a String of data, parses the String of data filling in the Hash
124
+ * returning an Integer to indicate how much of the data has been read. No matter
125
+ ***************
126
+ *** 273,279 ****
127
+ * the parsing from that position. It needs all of the original data as well
128
+ * so you have to append to the data buffer as you read.
129
+ */
130
+ ! VALUE HttpParser_execute(VALUE self, VALUE req_hash, VALUE data, VALUE start)
131
+ {
132
+ http_parser *http = NULL;
133
+ int from = 0;
134
+ --- 269,275 ----
135
+ * the parsing from that position. It needs all of the original data as well
136
+ * so you have to append to the data buffer as you read.
137
+ */
138
+ ! VALUE HttpParser_execute(VALUE self, VALUE req_headers, VALUE req_params, VALUE data, VALUE start)
139
+ {
140
+ http_parser *http = NULL;
141
+ int from = 0;
142
+ ***************
143
+ *** 289,295 ****
144
+ if(from >= dlen) {
145
+ rb_raise(eHttpParserError, "Requested start is after data buffer end.");
146
+ } else {
147
+ ! http->data = (void *)req_hash;
148
+ http_parser_execute(http, dptr, dlen, from);
149
+
150
+ VALIDATE_MAX_LENGTH(http_parser_nread(http), HEADER);
151
+ --- 285,293 ----
152
+ if(from >= dlen) {
153
+ rb_raise(eHttpParserError, "Requested start is after data buffer end.");
154
+ } else {
155
+ ! http->paramdata = (void *)req_params;
156
+ ! http->headerdata = (void *)req_headers;
157
+ !
158
+ http_parser_execute(http, dptr, dlen, from);
159
+
160
+ VALIDATE_MAX_LENGTH(http_parser_nread(http), HEADER);
161
+ ***************
162
+ *** 349,545 ****
163
+ return INT2FIX(http->nread);
164
+ }
165
+
166
+ -
167
+ - void URIClassifier_free(void *data)
168
+ - {
169
+ - TRACE();
170
+ -
171
+ - if(data) {
172
+ - tst_cleanup((struct tst *)data);
173
+ - }
174
+ - }
175
+ -
176
+ -
177
+ -
178
+ - VALUE URIClassifier_alloc(VALUE klass)
179
+ - {
180
+ - VALUE obj;
181
+ - struct tst *tst = tst_init(TRIE_INCREASE);
182
+ - TRACE();
183
+ - assert(tst && "failed to initialize trie structure");
184
+ -
185
+ - obj = Data_Wrap_Struct(klass, NULL, URIClassifier_free, tst);
186
+ -
187
+ - return obj;
188
+ - }
189
+ -
190
+ - /**
191
+ - * call-seq:
192
+ - * URIClassifier.new -> URIClassifier
193
+ - *
194
+ - * Initializes a new URIClassifier object that you can use to associate URI sequences
195
+ - * with objects. You can actually use it with any string sequence and any objects,
196
+ - * but it's mostly used with URIs.
197
+ - *
198
+ - * It uses TST from http://www.octavian.org/cs/software.html to build an ternary search
199
+ - * trie to hold all of the URIs. It uses this to do an initial search for the a URI
200
+ - * prefix, and then to break the URI into SCRIPT_NAME and PATH_INFO portions. It actually
201
+ - * will do two searches most of the time in order to find the right handler for the
202
+ - * registered prefix portion.
203
+ - *
204
+ - */
205
+ - VALUE URIClassifier_init(VALUE self)
206
+ - {
207
+ - VALUE hash;
208
+ -
209
+ - // we create an internal hash to protect stuff from the GC
210
+ - hash = rb_hash_new();
211
+ - rb_ivar_set(self, id_handler_map, hash);
212
+ -
213
+ - return self;
214
+ - }
215
+ -
216
+ -
217
+ - /**
218
+ - * call-seq:
219
+ - * uc.register("/someuri", SampleHandler.new) -> nil
220
+ - *
221
+ - * Registers the SampleHandler (one for all requests) with the "/someuri".
222
+ - * When URIClassifier::resolve is called with "/someuri" it'll return
223
+ - * SampleHandler immediately. When called with "/someuri/iwant" it'll also
224
+ - * return SomeHandler immediatly, with no additional searches, but it will
225
+ - * return path info with "/iwant".
226
+ - *
227
+ - * You actually can reuse this class to register nearly anything and
228
+ - * quickly resolve it. This could be used for caching, fast mapping, etc.
229
+ - * The downside is it uses much more memory than a Hash, but it can be
230
+ - * a lot faster. It's main advantage is that it works on prefixes, which
231
+ - * is damn hard to get right with a Hash.
232
+ - */
233
+ - VALUE URIClassifier_register(VALUE self, VALUE uri, VALUE handler)
234
+ - {
235
+ - int rc = 0;
236
+ - void *ptr = NULL;
237
+ - struct tst *tst = NULL;
238
+ - DATA_GET(self, struct tst, tst);
239
+ -
240
+ - rc = tst_insert((unsigned char *)StringValueCStr(uri), (void *)handler , tst, 0, &ptr);
241
+ -
242
+ - if(rc == TST_DUPLICATE_KEY) {
243
+ - rb_raise(rb_eStandardError, "Handler already registered with that name");
244
+ - } else if(rc == TST_ERROR) {
245
+ - rb_raise(rb_eStandardError, "Memory error registering handler");
246
+ - } else if(rc == TST_NULL_KEY) {
247
+ - rb_raise(rb_eStandardError, "URI was empty");
248
+ - }
249
+ -
250
+ - rb_hash_aset(rb_ivar_get(self, id_handler_map), uri, handler);
251
+ -
252
+ - return Qnil;
253
+ - }
254
+ -
255
+ -
256
+ - /**
257
+ - * call-seq:
258
+ - * uc.unregister("/someuri")
259
+ - *
260
+ - * Yep, just removes this uri and it's handler from the trie.
261
+ - */
262
+ - VALUE URIClassifier_unregister(VALUE self, VALUE uri)
263
+ - {
264
+ - void *handler = NULL;
265
+ - struct tst *tst = NULL;
266
+ - DATA_GET(self, struct tst, tst);
267
+ -
268
+ - handler = tst_delete((unsigned char *)StringValueCStr(uri), tst);
269
+ -
270
+ - if(handler) {
271
+ - rb_hash_delete(rb_ivar_get(self, id_handler_map), uri);
272
+ -
273
+ - return (VALUE)handler;
274
+ - } else {
275
+ - return Qnil;
276
+ - }
277
+ - }
278
+ -
279
+ -
280
+ - /**
281
+ - * call-seq:
282
+ - * uc.resolve("/someuri") -> "/someuri", "", handler
283
+ - * uc.resolve("/someuri/pathinfo") -> "/someuri", "/pathinfo", handler
284
+ - * uc.resolve("/notfound/orhere") -> nil, nil, nil
285
+ - * uc.resolve("/") -> "/", "/", handler # if uc.register("/", handler)
286
+ - * uc.resolve("/path/from/root") -> "/", "/path/from/root", handler # if uc.register("/", handler)
287
+ - *
288
+ - * Attempts to resolve either the whole URI or at the longest prefix, returning
289
+ - * the prefix (as script_info), path (as path_info), and registered handler
290
+ - * (usually an HttpHandler). If it doesn't find a handler registered at the longest
291
+ - * match then it returns nil,nil,nil.
292
+ - *
293
+ - * Because the resolver uses a trie you are able to register a handler at *any* character
294
+ - * in the URI and it will be handled as long as it's the longest prefix. So, if you
295
+ - * registered handler #1 at "/something/lik", and #2 at "/something/like/that", then a
296
+ - * a search for "/something/like" would give you #1. A search for "/something/like/that/too"
297
+ - * would give you #2.
298
+ - *
299
+ - * This is very powerful since it means you can also attach handlers to parts of the ;
300
+ - * (semi-colon) separated path params, any part of the path, use off chars, anything really.
301
+ - * It also means that it's very efficient to do this only taking as long as the URI has
302
+ - * characters.
303
+ - *
304
+ - * A slight modification to the CGI 1.2 standard is given for handlers registered to "/".
305
+ - * CGI expects all CGI scripts to be at some script path, so it doesn't really say anything
306
+ - * about a script that handles the root. To make this work, the resolver will detect that
307
+ - * the requested handler is at "/", and return that for script_name, and then simply return
308
+ - * the full URI back as path_info.
309
+ - *
310
+ - * It expects strings with no embedded '\0' characters. Don't try other string-like stuff yet.
311
+ - */
312
+ - VALUE URIClassifier_resolve(VALUE self, VALUE uri)
313
+ - {
314
+ - void *handler = NULL;
315
+ - int pref_len = 0;
316
+ - struct tst *tst = NULL;
317
+ - VALUE result;
318
+ - unsigned char *uri_str = NULL;
319
+ -
320
+ - DATA_GET(self, struct tst, tst);
321
+ - uri_str = (unsigned char *)StringValueCStr(uri);
322
+ -
323
+ - handler = tst_search(uri_str, tst, &pref_len);
324
+ -
325
+ - // setup for multiple return values
326
+ - result = rb_ary_new();
327
+ -
328
+ - if(handler) {
329
+ - rb_ary_push(result, rb_str_substr (uri, 0, pref_len));
330
+ - // compensate for a script_name="/" where we need to add the "/" to path_info to keep it consistent
331
+ - if(pref_len == 1 && uri_str[0] == '/') {
332
+ - // matches the root URI so we have to use the whole URI as the path_info
333
+ - rb_ary_push(result, uri);
334
+ - } else {
335
+ - // matches a script so process like normal
336
+ - rb_ary_push(result, rb_str_substr(uri, pref_len, RSTRING(uri)->len));
337
+ - }
338
+ -
339
+ - rb_ary_push(result, (VALUE)handler);
340
+ - } else {
341
+ - // not found so push back nothing
342
+ - rb_ary_push(result, Qnil);
343
+ - rb_ary_push(result, Qnil);
344
+ - rb_ary_push(result, Qnil);
345
+ - }
346
+ -
347
+ - return result;
348
+ - }
349
+ -
350
+ -
351
+ void Init_http11()
352
+ {
353
+
354
+ ! mMongrel = rb_define_module("Mongrel");
355
+
356
+ ! DEF_GLOBAL(http_prefix, "HTTP_");
357
+ DEF_GLOBAL(request_method, "REQUEST_METHOD");
358
+ DEF_GLOBAL(request_uri, "REQUEST_URI");
359
+ DEF_GLOBAL(query_string, "QUERY_STRING");
360
+ --- 347,358 ----
361
+ return INT2FIX(http->nread);
362
+ }
363
+
364
+ void Init_http11()
365
+ {
366
+
367
+ ! mIowa = rb_define_module("Iowa");
368
+
369
+ ! DEF_GLOBAL(http_prefix, "");
370
+ DEF_GLOBAL(request_method, "REQUEST_METHOD");
371
+ DEF_GLOBAL(request_uri, "REQUEST_URI");
372
+ DEF_GLOBAL(query_string, "QUERY_STRING");
373
+ ***************
374
+ *** 556,583 ****
375
+ DEF_GLOBAL(server_protocol, "SERVER_PROTOCOL");
376
+ DEF_GLOBAL(server_protocol_value, "HTTP/1.1");
377
+ DEF_GLOBAL(http_host, "HTTP_HOST");
378
+ ! DEF_GLOBAL(mongrel_version, "Mongrel 0.3.13.4");
379
+ DEF_GLOBAL(server_software, "SERVER_SOFTWARE");
380
+ DEF_GLOBAL(port_80, "80");
381
+
382
+ ! eHttpParserError = rb_define_class_under(mMongrel, "HttpParserError", rb_eIOError);
383
+
384
+ ! cHttpParser = rb_define_class_under(mMongrel, "HttpParser", rb_cObject);
385
+ rb_define_alloc_func(cHttpParser, HttpParser_alloc);
386
+ rb_define_method(cHttpParser, "initialize", HttpParser_init,0);
387
+ rb_define_method(cHttpParser, "reset", HttpParser_reset,0);
388
+ rb_define_method(cHttpParser, "finish", HttpParser_finish,0);
389
+ ! rb_define_method(cHttpParser, "execute", HttpParser_execute,3);
390
+ rb_define_method(cHttpParser, "error?", HttpParser_has_error,0);
391
+ rb_define_method(cHttpParser, "finished?", HttpParser_is_finished,0);
392
+ rb_define_method(cHttpParser, "nread", HttpParser_nread,0);
393
+ -
394
+ - cURIClassifier = rb_define_class_under(mMongrel, "URIClassifier", rb_cObject);
395
+ - rb_define_alloc_func(cURIClassifier, URIClassifier_alloc);
396
+ - rb_define_method(cURIClassifier, "initialize", URIClassifier_init, 0);
397
+ - rb_define_method(cURIClassifier, "register", URIClassifier_register, 2);
398
+ - rb_define_method(cURIClassifier, "unregister", URIClassifier_unregister, 1);
399
+ - rb_define_method(cURIClassifier, "resolve", URIClassifier_resolve, 1);
400
+ }
401
+ -
402
+ -
403
+ --- 369,387 ----
404
+ DEF_GLOBAL(server_protocol, "SERVER_PROTOCOL");
405
+ DEF_GLOBAL(server_protocol_value, "HTTP/1.1");
406
+ DEF_GLOBAL(http_host, "HTTP_HOST");
407
+ ! DEF_GLOBAL(parser_version, "IOWA 0.99.2.18");
408
+ DEF_GLOBAL(server_software, "SERVER_SOFTWARE");
409
+ DEF_GLOBAL(port_80, "80");
410
+
411
+ ! eHttpParserError = rb_define_class_under(mIowa, "HttpParserError", rb_eIOError);
412
+
413
+ ! cHttpParser = rb_define_class_under(mIowa, "HttpParser", rb_cObject);
414
+ rb_define_alloc_func(cHttpParser, HttpParser_alloc);
415
+ rb_define_method(cHttpParser, "initialize", HttpParser_init,0);
416
+ rb_define_method(cHttpParser, "reset", HttpParser_reset,0);
417
+ rb_define_method(cHttpParser, "finish", HttpParser_finish,0);
418
+ ! rb_define_method(cHttpParser, "execute", HttpParser_execute,4);
419
+ rb_define_method(cHttpParser, "error?", HttpParser_has_error,0);
420
+ rb_define_method(cHttpParser, "finished?", HttpParser_is_finished,0);
421
+ rb_define_method(cHttpParser, "nread", HttpParser_nread,0);
422
+ }
@@ -0,0 +1,1243 @@
1
+ #line 1 "ext/http11/http11_parser.rl"
2
+ /**
3
+ * Copyright (c) 2005 Zed A. Shaw
4
+ * You can redistribute it and/or modify it under the same terms as Ruby.
5
+ */
6
+ #include "http11_parser.h"
7
+ #include <stdio.h>
8
+ #include <assert.h>
9
+ #include <stdlib.h>
10
+ #include <ctype.h>
11
+ #include <string.h>
12
+
13
+ /*
14
+ * capitalizes all lower-case ASCII characters,
15
+ * converts dashes to underscores.
16
+ */
17
+ static void snake_upcase_char(char *c)
18
+ {
19
+ if (*c >= 'a' && *c <= 'z')
20
+ *c &= ~0x20;
21
+ else if (*c == '-')
22
+ *c = '_';
23
+ }
24
+
25
+ #define LEN(AT, FPC) (FPC - buffer - parser->AT)
26
+ #define MARK(M,FPC) (parser->M = (FPC) - buffer)
27
+ #define PTR_TO(F) (buffer + parser->F)
28
+
29
+ /** Machine **/
30
+
31
+ #line 87 "ext/http11/http11_parser.rl"
32
+
33
+
34
+ /** Data **/
35
+
36
+ #line 37 "ext/http11/http11_parser.c"
37
+ static const int http_parser_start = 1;
38
+ static const int http_parser_first_final = 57;
39
+ static const int http_parser_error = 0;
40
+
41
+ static const int http_parser_en_main = 1;
42
+
43
+ #line 91 "ext/http11/http11_parser.rl"
44
+
45
+ int http_parser_init(http_parser *parser) {
46
+ int cs = 0;
47
+
48
+ #line 49 "ext/http11/http11_parser.c"
49
+ {
50
+ cs = http_parser_start;
51
+ }
52
+ #line 95 "ext/http11/http11_parser.rl"
53
+ parser->cs = cs;
54
+ parser->body_start = 0;
55
+ parser->content_len = 0;
56
+ parser->mark = 0;
57
+ parser->nread = 0;
58
+ parser->field_len = 0;
59
+ parser->field_start = 0;
60
+
61
+ return(1);
62
+ }
63
+
64
+
65
+ /** exec **/
66
+ size_t http_parser_execute(http_parser *parser, const char *buffer, size_t len, size_t off) {
67
+ const char *p, *pe;
68
+ int cs = parser->cs;
69
+
70
+ assert(off <= len && "offset past end of buffer");
71
+
72
+ p = buffer+off;
73
+ pe = buffer+len;
74
+
75
+ /* assert(*pe == '\0' && "pointer does not end on NUL"); */
76
+ assert(pe - p == len - off && "pointers aren't same distance");
77
+
78
+
79
+ #line 80 "ext/http11/http11_parser.c"
80
+ {
81
+ if ( p == pe )
82
+ goto _test_eof;
83
+ switch ( cs )
84
+ {
85
+ case 1:
86
+ switch( (*p) ) {
87
+ case 36: goto tr0;
88
+ case 95: goto tr0;
89
+ }
90
+ if ( (*p) < 48 ) {
91
+ if ( 45 <= (*p) && (*p) <= 46 )
92
+ goto tr0;
93
+ } else if ( (*p) > 57 ) {
94
+ if ( 65 <= (*p) && (*p) <= 90 )
95
+ goto tr0;
96
+ } else
97
+ goto tr0;
98
+ goto st0;
99
+ st0:
100
+ cs = 0;
101
+ goto _out;
102
+ tr0:
103
+ #line 34 "ext/http11/http11_parser.rl"
104
+ {MARK(mark, p); }
105
+ goto st2;
106
+ st2:
107
+ if ( ++p == pe )
108
+ goto _test_eof2;
109
+ case 2:
110
+ #line 111 "ext/http11/http11_parser.c"
111
+ switch( (*p) ) {
112
+ case 32: goto tr2;
113
+ case 36: goto st38;
114
+ case 95: goto st38;
115
+ }
116
+ if ( (*p) < 48 ) {
117
+ if ( 45 <= (*p) && (*p) <= 46 )
118
+ goto st38;
119
+ } else if ( (*p) > 57 ) {
120
+ if ( 65 <= (*p) && (*p) <= 90 )
121
+ goto st38;
122
+ } else
123
+ goto st38;
124
+ goto st0;
125
+ tr2:
126
+ #line 49 "ext/http11/http11_parser.rl"
127
+ {
128
+ if(parser->request_method != NULL)
129
+ parser->request_method(parser->data, PTR_TO(mark), LEN(mark, p));
130
+ }
131
+ goto st3;
132
+ st3:
133
+ if ( ++p == pe )
134
+ goto _test_eof3;
135
+ case 3:
136
+ #line 137 "ext/http11/http11_parser.c"
137
+ switch( (*p) ) {
138
+ case 42: goto tr4;
139
+ case 43: goto tr5;
140
+ case 47: goto tr6;
141
+ case 58: goto tr7;
142
+ }
143
+ if ( (*p) < 65 ) {
144
+ if ( 45 <= (*p) && (*p) <= 57 )
145
+ goto tr5;
146
+ } else if ( (*p) > 90 ) {
147
+ if ( 97 <= (*p) && (*p) <= 122 )
148
+ goto tr5;
149
+ } else
150
+ goto tr5;
151
+ goto st0;
152
+ tr4:
153
+ #line 34 "ext/http11/http11_parser.rl"
154
+ {MARK(mark, p); }
155
+ goto st4;
156
+ st4:
157
+ if ( ++p == pe )
158
+ goto _test_eof4;
159
+ case 4:
160
+ #line 161 "ext/http11/http11_parser.c"
161
+ switch( (*p) ) {
162
+ case 32: goto tr8;
163
+ case 35: goto tr9;
164
+ }
165
+ goto st0;
166
+ tr8:
167
+ #line 53 "ext/http11/http11_parser.rl"
168
+ {
169
+ if(parser->request_uri != NULL)
170
+ parser->request_uri(parser->data, PTR_TO(mark), LEN(mark, p));
171
+ }
172
+ goto st5;
173
+ tr31:
174
+ #line 34 "ext/http11/http11_parser.rl"
175
+ {MARK(mark, p); }
176
+ #line 57 "ext/http11/http11_parser.rl"
177
+ {
178
+ if(parser->fragment != NULL)
179
+ parser->fragment(parser->data, PTR_TO(mark), LEN(mark, p));
180
+ }
181
+ goto st5;
182
+ tr34:
183
+ #line 57 "ext/http11/http11_parser.rl"
184
+ {
185
+ if(parser->fragment != NULL)
186
+ parser->fragment(parser->data, PTR_TO(mark), LEN(mark, p));
187
+ }
188
+ goto st5;
189
+ tr42:
190
+ #line 73 "ext/http11/http11_parser.rl"
191
+ {
192
+ if(parser->request_path != NULL)
193
+ parser->request_path(parser->data, PTR_TO(mark), LEN(mark,p));
194
+ }
195
+ #line 53 "ext/http11/http11_parser.rl"
196
+ {
197
+ if(parser->request_uri != NULL)
198
+ parser->request_uri(parser->data, PTR_TO(mark), LEN(mark, p));
199
+ }
200
+ goto st5;
201
+ tr53:
202
+ #line 62 "ext/http11/http11_parser.rl"
203
+ {MARK(query_start, p); }
204
+ #line 63 "ext/http11/http11_parser.rl"
205
+ {
206
+ if(parser->query_string != NULL)
207
+ parser->query_string(parser->data, PTR_TO(query_start), LEN(query_start, p));
208
+ }
209
+ #line 53 "ext/http11/http11_parser.rl"
210
+ {
211
+ if(parser->request_uri != NULL)
212
+ parser->request_uri(parser->data, PTR_TO(mark), LEN(mark, p));
213
+ }
214
+ goto st5;
215
+ tr57:
216
+ #line 63 "ext/http11/http11_parser.rl"
217
+ {
218
+ if(parser->query_string != NULL)
219
+ parser->query_string(parser->data, PTR_TO(query_start), LEN(query_start, p));
220
+ }
221
+ #line 53 "ext/http11/http11_parser.rl"
222
+ {
223
+ if(parser->request_uri != NULL)
224
+ parser->request_uri(parser->data, PTR_TO(mark), LEN(mark, p));
225
+ }
226
+ goto st5;
227
+ st5:
228
+ if ( ++p == pe )
229
+ goto _test_eof5;
230
+ case 5:
231
+ #line 232 "ext/http11/http11_parser.c"
232
+ if ( (*p) == 72 )
233
+ goto tr10;
234
+ goto st0;
235
+ tr10:
236
+ #line 34 "ext/http11/http11_parser.rl"
237
+ {MARK(mark, p); }
238
+ goto st6;
239
+ st6:
240
+ if ( ++p == pe )
241
+ goto _test_eof6;
242
+ case 6:
243
+ #line 244 "ext/http11/http11_parser.c"
244
+ if ( (*p) == 84 )
245
+ goto st7;
246
+ goto st0;
247
+ st7:
248
+ if ( ++p == pe )
249
+ goto _test_eof7;
250
+ case 7:
251
+ if ( (*p) == 84 )
252
+ goto st8;
253
+ goto st0;
254
+ st8:
255
+ if ( ++p == pe )
256
+ goto _test_eof8;
257
+ case 8:
258
+ if ( (*p) == 80 )
259
+ goto st9;
260
+ goto st0;
261
+ st9:
262
+ if ( ++p == pe )
263
+ goto _test_eof9;
264
+ case 9:
265
+ if ( (*p) == 47 )
266
+ goto st10;
267
+ goto st0;
268
+ st10:
269
+ if ( ++p == pe )
270
+ goto _test_eof10;
271
+ case 10:
272
+ if ( 48 <= (*p) && (*p) <= 57 )
273
+ goto st11;
274
+ goto st0;
275
+ st11:
276
+ if ( ++p == pe )
277
+ goto _test_eof11;
278
+ case 11:
279
+ if ( (*p) == 46 )
280
+ goto st12;
281
+ if ( 48 <= (*p) && (*p) <= 57 )
282
+ goto st11;
283
+ goto st0;
284
+ st12:
285
+ if ( ++p == pe )
286
+ goto _test_eof12;
287
+ case 12:
288
+ if ( 48 <= (*p) && (*p) <= 57 )
289
+ goto st13;
290
+ goto st0;
291
+ st13:
292
+ if ( ++p == pe )
293
+ goto _test_eof13;
294
+ case 13:
295
+ if ( (*p) == 13 )
296
+ goto tr18;
297
+ if ( 48 <= (*p) && (*p) <= 57 )
298
+ goto st13;
299
+ goto st0;
300
+ tr18:
301
+ #line 68 "ext/http11/http11_parser.rl"
302
+ {
303
+ if(parser->http_version != NULL)
304
+ parser->http_version(parser->data, PTR_TO(mark), LEN(mark, p));
305
+ }
306
+ goto st14;
307
+ tr26:
308
+ #line 43 "ext/http11/http11_parser.rl"
309
+ { MARK(mark, p); }
310
+ #line 44 "ext/http11/http11_parser.rl"
311
+ {
312
+ if(parser->http_field != NULL) {
313
+ parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
314
+ }
315
+ }
316
+ goto st14;
317
+ tr29:
318
+ #line 44 "ext/http11/http11_parser.rl"
319
+ {
320
+ if(parser->http_field != NULL) {
321
+ parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
322
+ }
323
+ }
324
+ goto st14;
325
+ st14:
326
+ if ( ++p == pe )
327
+ goto _test_eof14;
328
+ case 14:
329
+ #line 330 "ext/http11/http11_parser.c"
330
+ if ( (*p) == 10 )
331
+ goto st15;
332
+ goto st0;
333
+ st15:
334
+ if ( ++p == pe )
335
+ goto _test_eof15;
336
+ case 15:
337
+ switch( (*p) ) {
338
+ case 13: goto st16;
339
+ case 33: goto tr21;
340
+ case 124: goto tr21;
341
+ case 126: goto tr21;
342
+ }
343
+ if ( (*p) < 45 ) {
344
+ if ( (*p) > 39 ) {
345
+ if ( 42 <= (*p) && (*p) <= 43 )
346
+ goto tr21;
347
+ } else if ( (*p) >= 35 )
348
+ goto tr21;
349
+ } else if ( (*p) > 46 ) {
350
+ if ( (*p) < 65 ) {
351
+ if ( 48 <= (*p) && (*p) <= 57 )
352
+ goto tr21;
353
+ } else if ( (*p) > 90 ) {
354
+ if ( 94 <= (*p) && (*p) <= 122 )
355
+ goto tr21;
356
+ } else
357
+ goto tr21;
358
+ } else
359
+ goto tr21;
360
+ goto st0;
361
+ st16:
362
+ if ( ++p == pe )
363
+ goto _test_eof16;
364
+ case 16:
365
+ if ( (*p) == 10 )
366
+ goto tr22;
367
+ goto st0;
368
+ tr22:
369
+ #line 78 "ext/http11/http11_parser.rl"
370
+ {
371
+ parser->body_start = p - buffer + 1;
372
+ if(parser->header_done != NULL)
373
+ parser->header_done(parser->data, p + 1, pe - p - 1);
374
+ {p++; cs = 57; goto _out;}
375
+ }
376
+ goto st57;
377
+ st57:
378
+ if ( ++p == pe )
379
+ goto _test_eof57;
380
+ case 57:
381
+ #line 382 "ext/http11/http11_parser.c"
382
+ goto st0;
383
+ tr21:
384
+ #line 37 "ext/http11/http11_parser.rl"
385
+ { MARK(field_start, p); }
386
+ #line 38 "ext/http11/http11_parser.rl"
387
+ { snake_upcase_char((char *)p); }
388
+ goto st17;
389
+ tr23:
390
+ #line 38 "ext/http11/http11_parser.rl"
391
+ { snake_upcase_char((char *)p); }
392
+ goto st17;
393
+ st17:
394
+ if ( ++p == pe )
395
+ goto _test_eof17;
396
+ case 17:
397
+ #line 398 "ext/http11/http11_parser.c"
398
+ switch( (*p) ) {
399
+ case 33: goto tr23;
400
+ case 58: goto tr24;
401
+ case 124: goto tr23;
402
+ case 126: goto tr23;
403
+ }
404
+ if ( (*p) < 45 ) {
405
+ if ( (*p) > 39 ) {
406
+ if ( 42 <= (*p) && (*p) <= 43 )
407
+ goto tr23;
408
+ } else if ( (*p) >= 35 )
409
+ goto tr23;
410
+ } else if ( (*p) > 46 ) {
411
+ if ( (*p) < 65 ) {
412
+ if ( 48 <= (*p) && (*p) <= 57 )
413
+ goto tr23;
414
+ } else if ( (*p) > 90 ) {
415
+ if ( 94 <= (*p) && (*p) <= 122 )
416
+ goto tr23;
417
+ } else
418
+ goto tr23;
419
+ } else
420
+ goto tr23;
421
+ goto st0;
422
+ tr24:
423
+ #line 39 "ext/http11/http11_parser.rl"
424
+ {
425
+ parser->field_len = LEN(field_start, p);
426
+ }
427
+ goto st18;
428
+ tr27:
429
+ #line 43 "ext/http11/http11_parser.rl"
430
+ { MARK(mark, p); }
431
+ goto st18;
432
+ st18:
433
+ if ( ++p == pe )
434
+ goto _test_eof18;
435
+ case 18:
436
+ #line 437 "ext/http11/http11_parser.c"
437
+ switch( (*p) ) {
438
+ case 13: goto tr26;
439
+ case 32: goto tr27;
440
+ }
441
+ goto tr25;
442
+ tr25:
443
+ #line 43 "ext/http11/http11_parser.rl"
444
+ { MARK(mark, p); }
445
+ goto st19;
446
+ st19:
447
+ if ( ++p == pe )
448
+ goto _test_eof19;
449
+ case 19:
450
+ #line 451 "ext/http11/http11_parser.c"
451
+ if ( (*p) == 13 )
452
+ goto tr29;
453
+ goto st19;
454
+ tr9:
455
+ #line 53 "ext/http11/http11_parser.rl"
456
+ {
457
+ if(parser->request_uri != NULL)
458
+ parser->request_uri(parser->data, PTR_TO(mark), LEN(mark, p));
459
+ }
460
+ goto st20;
461
+ tr43:
462
+ #line 73 "ext/http11/http11_parser.rl"
463
+ {
464
+ if(parser->request_path != NULL)
465
+ parser->request_path(parser->data, PTR_TO(mark), LEN(mark,p));
466
+ }
467
+ #line 53 "ext/http11/http11_parser.rl"
468
+ {
469
+ if(parser->request_uri != NULL)
470
+ parser->request_uri(parser->data, PTR_TO(mark), LEN(mark, p));
471
+ }
472
+ goto st20;
473
+ tr54:
474
+ #line 62 "ext/http11/http11_parser.rl"
475
+ {MARK(query_start, p); }
476
+ #line 63 "ext/http11/http11_parser.rl"
477
+ {
478
+ if(parser->query_string != NULL)
479
+ parser->query_string(parser->data, PTR_TO(query_start), LEN(query_start, p));
480
+ }
481
+ #line 53 "ext/http11/http11_parser.rl"
482
+ {
483
+ if(parser->request_uri != NULL)
484
+ parser->request_uri(parser->data, PTR_TO(mark), LEN(mark, p));
485
+ }
486
+ goto st20;
487
+ tr58:
488
+ #line 63 "ext/http11/http11_parser.rl"
489
+ {
490
+ if(parser->query_string != NULL)
491
+ parser->query_string(parser->data, PTR_TO(query_start), LEN(query_start, p));
492
+ }
493
+ #line 53 "ext/http11/http11_parser.rl"
494
+ {
495
+ if(parser->request_uri != NULL)
496
+ parser->request_uri(parser->data, PTR_TO(mark), LEN(mark, p));
497
+ }
498
+ goto st20;
499
+ st20:
500
+ if ( ++p == pe )
501
+ goto _test_eof20;
502
+ case 20:
503
+ #line 504 "ext/http11/http11_parser.c"
504
+ switch( (*p) ) {
505
+ case 32: goto tr31;
506
+ case 37: goto tr32;
507
+ case 60: goto st0;
508
+ case 62: goto st0;
509
+ case 127: goto st0;
510
+ }
511
+ if ( (*p) > 31 ) {
512
+ if ( 34 <= (*p) && (*p) <= 35 )
513
+ goto st0;
514
+ } else if ( (*p) >= 0 )
515
+ goto st0;
516
+ goto tr30;
517
+ tr30:
518
+ #line 34 "ext/http11/http11_parser.rl"
519
+ {MARK(mark, p); }
520
+ goto st21;
521
+ st21:
522
+ if ( ++p == pe )
523
+ goto _test_eof21;
524
+ case 21:
525
+ #line 526 "ext/http11/http11_parser.c"
526
+ switch( (*p) ) {
527
+ case 32: goto tr34;
528
+ case 37: goto st22;
529
+ case 60: goto st0;
530
+ case 62: goto st0;
531
+ case 127: goto st0;
532
+ }
533
+ if ( (*p) > 31 ) {
534
+ if ( 34 <= (*p) && (*p) <= 35 )
535
+ goto st0;
536
+ } else if ( (*p) >= 0 )
537
+ goto st0;
538
+ goto st21;
539
+ tr32:
540
+ #line 34 "ext/http11/http11_parser.rl"
541
+ {MARK(mark, p); }
542
+ goto st22;
543
+ st22:
544
+ if ( ++p == pe )
545
+ goto _test_eof22;
546
+ case 22:
547
+ #line 548 "ext/http11/http11_parser.c"
548
+ if ( (*p) < 65 ) {
549
+ if ( 48 <= (*p) && (*p) <= 57 )
550
+ goto st23;
551
+ } else if ( (*p) > 70 ) {
552
+ if ( 97 <= (*p) && (*p) <= 102 )
553
+ goto st23;
554
+ } else
555
+ goto st23;
556
+ goto st0;
557
+ st23:
558
+ if ( ++p == pe )
559
+ goto _test_eof23;
560
+ case 23:
561
+ if ( (*p) < 65 ) {
562
+ if ( 48 <= (*p) && (*p) <= 57 )
563
+ goto st21;
564
+ } else if ( (*p) > 70 ) {
565
+ if ( 97 <= (*p) && (*p) <= 102 )
566
+ goto st21;
567
+ } else
568
+ goto st21;
569
+ goto st0;
570
+ tr5:
571
+ #line 34 "ext/http11/http11_parser.rl"
572
+ {MARK(mark, p); }
573
+ goto st24;
574
+ st24:
575
+ if ( ++p == pe )
576
+ goto _test_eof24;
577
+ case 24:
578
+ #line 579 "ext/http11/http11_parser.c"
579
+ switch( (*p) ) {
580
+ case 43: goto st24;
581
+ case 58: goto st25;
582
+ }
583
+ if ( (*p) < 48 ) {
584
+ if ( 45 <= (*p) && (*p) <= 46 )
585
+ goto st24;
586
+ } else if ( (*p) > 57 ) {
587
+ if ( (*p) > 90 ) {
588
+ if ( 97 <= (*p) && (*p) <= 122 )
589
+ goto st24;
590
+ } else if ( (*p) >= 65 )
591
+ goto st24;
592
+ } else
593
+ goto st24;
594
+ goto st0;
595
+ tr7:
596
+ #line 34 "ext/http11/http11_parser.rl"
597
+ {MARK(mark, p); }
598
+ goto st25;
599
+ st25:
600
+ if ( ++p == pe )
601
+ goto _test_eof25;
602
+ case 25:
603
+ #line 604 "ext/http11/http11_parser.c"
604
+ switch( (*p) ) {
605
+ case 32: goto tr8;
606
+ case 34: goto st0;
607
+ case 35: goto tr9;
608
+ case 37: goto st26;
609
+ case 60: goto st0;
610
+ case 62: goto st0;
611
+ case 127: goto st0;
612
+ }
613
+ if ( 0 <= (*p) && (*p) <= 31 )
614
+ goto st0;
615
+ goto st25;
616
+ st26:
617
+ if ( ++p == pe )
618
+ goto _test_eof26;
619
+ case 26:
620
+ if ( (*p) < 65 ) {
621
+ if ( 48 <= (*p) && (*p) <= 57 )
622
+ goto st27;
623
+ } else if ( (*p) > 70 ) {
624
+ if ( 97 <= (*p) && (*p) <= 102 )
625
+ goto st27;
626
+ } else
627
+ goto st27;
628
+ goto st0;
629
+ st27:
630
+ if ( ++p == pe )
631
+ goto _test_eof27;
632
+ case 27:
633
+ if ( (*p) < 65 ) {
634
+ if ( 48 <= (*p) && (*p) <= 57 )
635
+ goto st25;
636
+ } else if ( (*p) > 70 ) {
637
+ if ( 97 <= (*p) && (*p) <= 102 )
638
+ goto st25;
639
+ } else
640
+ goto st25;
641
+ goto st0;
642
+ tr6:
643
+ #line 34 "ext/http11/http11_parser.rl"
644
+ {MARK(mark, p); }
645
+ goto st28;
646
+ st28:
647
+ if ( ++p == pe )
648
+ goto _test_eof28;
649
+ case 28:
650
+ #line 651 "ext/http11/http11_parser.c"
651
+ switch( (*p) ) {
652
+ case 32: goto tr42;
653
+ case 34: goto st0;
654
+ case 35: goto tr43;
655
+ case 37: goto st29;
656
+ case 59: goto tr45;
657
+ case 60: goto st0;
658
+ case 62: goto st0;
659
+ case 63: goto tr46;
660
+ case 127: goto st0;
661
+ }
662
+ if ( 0 <= (*p) && (*p) <= 31 )
663
+ goto st0;
664
+ goto st28;
665
+ st29:
666
+ if ( ++p == pe )
667
+ goto _test_eof29;
668
+ case 29:
669
+ if ( (*p) < 65 ) {
670
+ if ( 48 <= (*p) && (*p) <= 57 )
671
+ goto st30;
672
+ } else if ( (*p) > 70 ) {
673
+ if ( 97 <= (*p) && (*p) <= 102 )
674
+ goto st30;
675
+ } else
676
+ goto st30;
677
+ goto st0;
678
+ st30:
679
+ if ( ++p == pe )
680
+ goto _test_eof30;
681
+ case 30:
682
+ if ( (*p) < 65 ) {
683
+ if ( 48 <= (*p) && (*p) <= 57 )
684
+ goto st28;
685
+ } else if ( (*p) > 70 ) {
686
+ if ( 97 <= (*p) && (*p) <= 102 )
687
+ goto st28;
688
+ } else
689
+ goto st28;
690
+ goto st0;
691
+ tr45:
692
+ #line 73 "ext/http11/http11_parser.rl"
693
+ {
694
+ if(parser->request_path != NULL)
695
+ parser->request_path(parser->data, PTR_TO(mark), LEN(mark,p));
696
+ }
697
+ goto st31;
698
+ st31:
699
+ if ( ++p == pe )
700
+ goto _test_eof31;
701
+ case 31:
702
+ #line 703 "ext/http11/http11_parser.c"
703
+ switch( (*p) ) {
704
+ case 32: goto tr8;
705
+ case 34: goto st0;
706
+ case 35: goto tr9;
707
+ case 37: goto st32;
708
+ case 60: goto st0;
709
+ case 62: goto st0;
710
+ case 63: goto st34;
711
+ case 127: goto st0;
712
+ }
713
+ if ( 0 <= (*p) && (*p) <= 31 )
714
+ goto st0;
715
+ goto st31;
716
+ st32:
717
+ if ( ++p == pe )
718
+ goto _test_eof32;
719
+ case 32:
720
+ if ( (*p) < 65 ) {
721
+ if ( 48 <= (*p) && (*p) <= 57 )
722
+ goto st33;
723
+ } else if ( (*p) > 70 ) {
724
+ if ( 97 <= (*p) && (*p) <= 102 )
725
+ goto st33;
726
+ } else
727
+ goto st33;
728
+ goto st0;
729
+ st33:
730
+ if ( ++p == pe )
731
+ goto _test_eof33;
732
+ case 33:
733
+ if ( (*p) < 65 ) {
734
+ if ( 48 <= (*p) && (*p) <= 57 )
735
+ goto st31;
736
+ } else if ( (*p) > 70 ) {
737
+ if ( 97 <= (*p) && (*p) <= 102 )
738
+ goto st31;
739
+ } else
740
+ goto st31;
741
+ goto st0;
742
+ tr46:
743
+ #line 73 "ext/http11/http11_parser.rl"
744
+ {
745
+ if(parser->request_path != NULL)
746
+ parser->request_path(parser->data, PTR_TO(mark), LEN(mark,p));
747
+ }
748
+ goto st34;
749
+ st34:
750
+ if ( ++p == pe )
751
+ goto _test_eof34;
752
+ case 34:
753
+ #line 754 "ext/http11/http11_parser.c"
754
+ switch( (*p) ) {
755
+ case 32: goto tr53;
756
+ case 34: goto st0;
757
+ case 35: goto tr54;
758
+ case 37: goto tr55;
759
+ case 60: goto st0;
760
+ case 62: goto st0;
761
+ case 127: goto st0;
762
+ }
763
+ if ( 0 <= (*p) && (*p) <= 31 )
764
+ goto st0;
765
+ goto tr52;
766
+ tr52:
767
+ #line 62 "ext/http11/http11_parser.rl"
768
+ {MARK(query_start, p); }
769
+ goto st35;
770
+ st35:
771
+ if ( ++p == pe )
772
+ goto _test_eof35;
773
+ case 35:
774
+ #line 775 "ext/http11/http11_parser.c"
775
+ switch( (*p) ) {
776
+ case 32: goto tr57;
777
+ case 34: goto st0;
778
+ case 35: goto tr58;
779
+ case 37: goto st36;
780
+ case 60: goto st0;
781
+ case 62: goto st0;
782
+ case 127: goto st0;
783
+ }
784
+ if ( 0 <= (*p) && (*p) <= 31 )
785
+ goto st0;
786
+ goto st35;
787
+ tr55:
788
+ #line 62 "ext/http11/http11_parser.rl"
789
+ {MARK(query_start, p); }
790
+ goto st36;
791
+ st36:
792
+ if ( ++p == pe )
793
+ goto _test_eof36;
794
+ case 36:
795
+ #line 796 "ext/http11/http11_parser.c"
796
+ if ( (*p) < 65 ) {
797
+ if ( 48 <= (*p) && (*p) <= 57 )
798
+ goto st37;
799
+ } else if ( (*p) > 70 ) {
800
+ if ( 97 <= (*p) && (*p) <= 102 )
801
+ goto st37;
802
+ } else
803
+ goto st37;
804
+ goto st0;
805
+ st37:
806
+ if ( ++p == pe )
807
+ goto _test_eof37;
808
+ case 37:
809
+ if ( (*p) < 65 ) {
810
+ if ( 48 <= (*p) && (*p) <= 57 )
811
+ goto st35;
812
+ } else if ( (*p) > 70 ) {
813
+ if ( 97 <= (*p) && (*p) <= 102 )
814
+ goto st35;
815
+ } else
816
+ goto st35;
817
+ goto st0;
818
+ st38:
819
+ if ( ++p == pe )
820
+ goto _test_eof38;
821
+ case 38:
822
+ switch( (*p) ) {
823
+ case 32: goto tr2;
824
+ case 36: goto st39;
825
+ case 95: goto st39;
826
+ }
827
+ if ( (*p) < 48 ) {
828
+ if ( 45 <= (*p) && (*p) <= 46 )
829
+ goto st39;
830
+ } else if ( (*p) > 57 ) {
831
+ if ( 65 <= (*p) && (*p) <= 90 )
832
+ goto st39;
833
+ } else
834
+ goto st39;
835
+ goto st0;
836
+ st39:
837
+ if ( ++p == pe )
838
+ goto _test_eof39;
839
+ case 39:
840
+ switch( (*p) ) {
841
+ case 32: goto tr2;
842
+ case 36: goto st40;
843
+ case 95: goto st40;
844
+ }
845
+ if ( (*p) < 48 ) {
846
+ if ( 45 <= (*p) && (*p) <= 46 )
847
+ goto st40;
848
+ } else if ( (*p) > 57 ) {
849
+ if ( 65 <= (*p) && (*p) <= 90 )
850
+ goto st40;
851
+ } else
852
+ goto st40;
853
+ goto st0;
854
+ st40:
855
+ if ( ++p == pe )
856
+ goto _test_eof40;
857
+ case 40:
858
+ switch( (*p) ) {
859
+ case 32: goto tr2;
860
+ case 36: goto st41;
861
+ case 95: goto st41;
862
+ }
863
+ if ( (*p) < 48 ) {
864
+ if ( 45 <= (*p) && (*p) <= 46 )
865
+ goto st41;
866
+ } else if ( (*p) > 57 ) {
867
+ if ( 65 <= (*p) && (*p) <= 90 )
868
+ goto st41;
869
+ } else
870
+ goto st41;
871
+ goto st0;
872
+ st41:
873
+ if ( ++p == pe )
874
+ goto _test_eof41;
875
+ case 41:
876
+ switch( (*p) ) {
877
+ case 32: goto tr2;
878
+ case 36: goto st42;
879
+ case 95: goto st42;
880
+ }
881
+ if ( (*p) < 48 ) {
882
+ if ( 45 <= (*p) && (*p) <= 46 )
883
+ goto st42;
884
+ } else if ( (*p) > 57 ) {
885
+ if ( 65 <= (*p) && (*p) <= 90 )
886
+ goto st42;
887
+ } else
888
+ goto st42;
889
+ goto st0;
890
+ st42:
891
+ if ( ++p == pe )
892
+ goto _test_eof42;
893
+ case 42:
894
+ switch( (*p) ) {
895
+ case 32: goto tr2;
896
+ case 36: goto st43;
897
+ case 95: goto st43;
898
+ }
899
+ if ( (*p) < 48 ) {
900
+ if ( 45 <= (*p) && (*p) <= 46 )
901
+ goto st43;
902
+ } else if ( (*p) > 57 ) {
903
+ if ( 65 <= (*p) && (*p) <= 90 )
904
+ goto st43;
905
+ } else
906
+ goto st43;
907
+ goto st0;
908
+ st43:
909
+ if ( ++p == pe )
910
+ goto _test_eof43;
911
+ case 43:
912
+ switch( (*p) ) {
913
+ case 32: goto tr2;
914
+ case 36: goto st44;
915
+ case 95: goto st44;
916
+ }
917
+ if ( (*p) < 48 ) {
918
+ if ( 45 <= (*p) && (*p) <= 46 )
919
+ goto st44;
920
+ } else if ( (*p) > 57 ) {
921
+ if ( 65 <= (*p) && (*p) <= 90 )
922
+ goto st44;
923
+ } else
924
+ goto st44;
925
+ goto st0;
926
+ st44:
927
+ if ( ++p == pe )
928
+ goto _test_eof44;
929
+ case 44:
930
+ switch( (*p) ) {
931
+ case 32: goto tr2;
932
+ case 36: goto st45;
933
+ case 95: goto st45;
934
+ }
935
+ if ( (*p) < 48 ) {
936
+ if ( 45 <= (*p) && (*p) <= 46 )
937
+ goto st45;
938
+ } else if ( (*p) > 57 ) {
939
+ if ( 65 <= (*p) && (*p) <= 90 )
940
+ goto st45;
941
+ } else
942
+ goto st45;
943
+ goto st0;
944
+ st45:
945
+ if ( ++p == pe )
946
+ goto _test_eof45;
947
+ case 45:
948
+ switch( (*p) ) {
949
+ case 32: goto tr2;
950
+ case 36: goto st46;
951
+ case 95: goto st46;
952
+ }
953
+ if ( (*p) < 48 ) {
954
+ if ( 45 <= (*p) && (*p) <= 46 )
955
+ goto st46;
956
+ } else if ( (*p) > 57 ) {
957
+ if ( 65 <= (*p) && (*p) <= 90 )
958
+ goto st46;
959
+ } else
960
+ goto st46;
961
+ goto st0;
962
+ st46:
963
+ if ( ++p == pe )
964
+ goto _test_eof46;
965
+ case 46:
966
+ switch( (*p) ) {
967
+ case 32: goto tr2;
968
+ case 36: goto st47;
969
+ case 95: goto st47;
970
+ }
971
+ if ( (*p) < 48 ) {
972
+ if ( 45 <= (*p) && (*p) <= 46 )
973
+ goto st47;
974
+ } else if ( (*p) > 57 ) {
975
+ if ( 65 <= (*p) && (*p) <= 90 )
976
+ goto st47;
977
+ } else
978
+ goto st47;
979
+ goto st0;
980
+ st47:
981
+ if ( ++p == pe )
982
+ goto _test_eof47;
983
+ case 47:
984
+ switch( (*p) ) {
985
+ case 32: goto tr2;
986
+ case 36: goto st48;
987
+ case 95: goto st48;
988
+ }
989
+ if ( (*p) < 48 ) {
990
+ if ( 45 <= (*p) && (*p) <= 46 )
991
+ goto st48;
992
+ } else if ( (*p) > 57 ) {
993
+ if ( 65 <= (*p) && (*p) <= 90 )
994
+ goto st48;
995
+ } else
996
+ goto st48;
997
+ goto st0;
998
+ st48:
999
+ if ( ++p == pe )
1000
+ goto _test_eof48;
1001
+ case 48:
1002
+ switch( (*p) ) {
1003
+ case 32: goto tr2;
1004
+ case 36: goto st49;
1005
+ case 95: goto st49;
1006
+ }
1007
+ if ( (*p) < 48 ) {
1008
+ if ( 45 <= (*p) && (*p) <= 46 )
1009
+ goto st49;
1010
+ } else if ( (*p) > 57 ) {
1011
+ if ( 65 <= (*p) && (*p) <= 90 )
1012
+ goto st49;
1013
+ } else
1014
+ goto st49;
1015
+ goto st0;
1016
+ st49:
1017
+ if ( ++p == pe )
1018
+ goto _test_eof49;
1019
+ case 49:
1020
+ switch( (*p) ) {
1021
+ case 32: goto tr2;
1022
+ case 36: goto st50;
1023
+ case 95: goto st50;
1024
+ }
1025
+ if ( (*p) < 48 ) {
1026
+ if ( 45 <= (*p) && (*p) <= 46 )
1027
+ goto st50;
1028
+ } else if ( (*p) > 57 ) {
1029
+ if ( 65 <= (*p) && (*p) <= 90 )
1030
+ goto st50;
1031
+ } else
1032
+ goto st50;
1033
+ goto st0;
1034
+ st50:
1035
+ if ( ++p == pe )
1036
+ goto _test_eof50;
1037
+ case 50:
1038
+ switch( (*p) ) {
1039
+ case 32: goto tr2;
1040
+ case 36: goto st51;
1041
+ case 95: goto st51;
1042
+ }
1043
+ if ( (*p) < 48 ) {
1044
+ if ( 45 <= (*p) && (*p) <= 46 )
1045
+ goto st51;
1046
+ } else if ( (*p) > 57 ) {
1047
+ if ( 65 <= (*p) && (*p) <= 90 )
1048
+ goto st51;
1049
+ } else
1050
+ goto st51;
1051
+ goto st0;
1052
+ st51:
1053
+ if ( ++p == pe )
1054
+ goto _test_eof51;
1055
+ case 51:
1056
+ switch( (*p) ) {
1057
+ case 32: goto tr2;
1058
+ case 36: goto st52;
1059
+ case 95: goto st52;
1060
+ }
1061
+ if ( (*p) < 48 ) {
1062
+ if ( 45 <= (*p) && (*p) <= 46 )
1063
+ goto st52;
1064
+ } else if ( (*p) > 57 ) {
1065
+ if ( 65 <= (*p) && (*p) <= 90 )
1066
+ goto st52;
1067
+ } else
1068
+ goto st52;
1069
+ goto st0;
1070
+ st52:
1071
+ if ( ++p == pe )
1072
+ goto _test_eof52;
1073
+ case 52:
1074
+ switch( (*p) ) {
1075
+ case 32: goto tr2;
1076
+ case 36: goto st53;
1077
+ case 95: goto st53;
1078
+ }
1079
+ if ( (*p) < 48 ) {
1080
+ if ( 45 <= (*p) && (*p) <= 46 )
1081
+ goto st53;
1082
+ } else if ( (*p) > 57 ) {
1083
+ if ( 65 <= (*p) && (*p) <= 90 )
1084
+ goto st53;
1085
+ } else
1086
+ goto st53;
1087
+ goto st0;
1088
+ st53:
1089
+ if ( ++p == pe )
1090
+ goto _test_eof53;
1091
+ case 53:
1092
+ switch( (*p) ) {
1093
+ case 32: goto tr2;
1094
+ case 36: goto st54;
1095
+ case 95: goto st54;
1096
+ }
1097
+ if ( (*p) < 48 ) {
1098
+ if ( 45 <= (*p) && (*p) <= 46 )
1099
+ goto st54;
1100
+ } else if ( (*p) > 57 ) {
1101
+ if ( 65 <= (*p) && (*p) <= 90 )
1102
+ goto st54;
1103
+ } else
1104
+ goto st54;
1105
+ goto st0;
1106
+ st54:
1107
+ if ( ++p == pe )
1108
+ goto _test_eof54;
1109
+ case 54:
1110
+ switch( (*p) ) {
1111
+ case 32: goto tr2;
1112
+ case 36: goto st55;
1113
+ case 95: goto st55;
1114
+ }
1115
+ if ( (*p) < 48 ) {
1116
+ if ( 45 <= (*p) && (*p) <= 46 )
1117
+ goto st55;
1118
+ } else if ( (*p) > 57 ) {
1119
+ if ( 65 <= (*p) && (*p) <= 90 )
1120
+ goto st55;
1121
+ } else
1122
+ goto st55;
1123
+ goto st0;
1124
+ st55:
1125
+ if ( ++p == pe )
1126
+ goto _test_eof55;
1127
+ case 55:
1128
+ switch( (*p) ) {
1129
+ case 32: goto tr2;
1130
+ case 36: goto st56;
1131
+ case 95: goto st56;
1132
+ }
1133
+ if ( (*p) < 48 ) {
1134
+ if ( 45 <= (*p) && (*p) <= 46 )
1135
+ goto st56;
1136
+ } else if ( (*p) > 57 ) {
1137
+ if ( 65 <= (*p) && (*p) <= 90 )
1138
+ goto st56;
1139
+ } else
1140
+ goto st56;
1141
+ goto st0;
1142
+ st56:
1143
+ if ( ++p == pe )
1144
+ goto _test_eof56;
1145
+ case 56:
1146
+ if ( (*p) == 32 )
1147
+ goto tr2;
1148
+ goto st0;
1149
+ }
1150
+ _test_eof2: cs = 2; goto _test_eof;
1151
+ _test_eof3: cs = 3; goto _test_eof;
1152
+ _test_eof4: cs = 4; goto _test_eof;
1153
+ _test_eof5: cs = 5; goto _test_eof;
1154
+ _test_eof6: cs = 6; goto _test_eof;
1155
+ _test_eof7: cs = 7; goto _test_eof;
1156
+ _test_eof8: cs = 8; goto _test_eof;
1157
+ _test_eof9: cs = 9; goto _test_eof;
1158
+ _test_eof10: cs = 10; goto _test_eof;
1159
+ _test_eof11: cs = 11; goto _test_eof;
1160
+ _test_eof12: cs = 12; goto _test_eof;
1161
+ _test_eof13: cs = 13; goto _test_eof;
1162
+ _test_eof14: cs = 14; goto _test_eof;
1163
+ _test_eof15: cs = 15; goto _test_eof;
1164
+ _test_eof16: cs = 16; goto _test_eof;
1165
+ _test_eof57: cs = 57; goto _test_eof;
1166
+ _test_eof17: cs = 17; goto _test_eof;
1167
+ _test_eof18: cs = 18; goto _test_eof;
1168
+ _test_eof19: cs = 19; goto _test_eof;
1169
+ _test_eof20: cs = 20; goto _test_eof;
1170
+ _test_eof21: cs = 21; goto _test_eof;
1171
+ _test_eof22: cs = 22; goto _test_eof;
1172
+ _test_eof23: cs = 23; goto _test_eof;
1173
+ _test_eof24: cs = 24; goto _test_eof;
1174
+ _test_eof25: cs = 25; goto _test_eof;
1175
+ _test_eof26: cs = 26; goto _test_eof;
1176
+ _test_eof27: cs = 27; goto _test_eof;
1177
+ _test_eof28: cs = 28; goto _test_eof;
1178
+ _test_eof29: cs = 29; goto _test_eof;
1179
+ _test_eof30: cs = 30; goto _test_eof;
1180
+ _test_eof31: cs = 31; goto _test_eof;
1181
+ _test_eof32: cs = 32; goto _test_eof;
1182
+ _test_eof33: cs = 33; goto _test_eof;
1183
+ _test_eof34: cs = 34; goto _test_eof;
1184
+ _test_eof35: cs = 35; goto _test_eof;
1185
+ _test_eof36: cs = 36; goto _test_eof;
1186
+ _test_eof37: cs = 37; goto _test_eof;
1187
+ _test_eof38: cs = 38; goto _test_eof;
1188
+ _test_eof39: cs = 39; goto _test_eof;
1189
+ _test_eof40: cs = 40; goto _test_eof;
1190
+ _test_eof41: cs = 41; goto _test_eof;
1191
+ _test_eof42: cs = 42; goto _test_eof;
1192
+ _test_eof43: cs = 43; goto _test_eof;
1193
+ _test_eof44: cs = 44; goto _test_eof;
1194
+ _test_eof45: cs = 45; goto _test_eof;
1195
+ _test_eof46: cs = 46; goto _test_eof;
1196
+ _test_eof47: cs = 47; goto _test_eof;
1197
+ _test_eof48: cs = 48; goto _test_eof;
1198
+ _test_eof49: cs = 49; goto _test_eof;
1199
+ _test_eof50: cs = 50; goto _test_eof;
1200
+ _test_eof51: cs = 51; goto _test_eof;
1201
+ _test_eof52: cs = 52; goto _test_eof;
1202
+ _test_eof53: cs = 53; goto _test_eof;
1203
+ _test_eof54: cs = 54; goto _test_eof;
1204
+ _test_eof55: cs = 55; goto _test_eof;
1205
+ _test_eof56: cs = 56; goto _test_eof;
1206
+
1207
+ _test_eof: {}
1208
+ _out: {}
1209
+ }
1210
+ #line 121 "ext/http11/http11_parser.rl"
1211
+
1212
+ if (!http_parser_has_error(parser))
1213
+ parser->cs = cs;
1214
+ parser->nread += p - (buffer + off);
1215
+
1216
+ assert(p <= pe && "buffer overflow after parsing execute");
1217
+ assert(parser->nread <= len && "nread longer than length");
1218
+ assert(parser->body_start <= len && "body starts after buffer end");
1219
+ assert(parser->mark < len && "mark is after buffer end");
1220
+ assert(parser->field_len <= len && "field has length longer than whole buffer");
1221
+ assert(parser->field_start < len && "field starts after buffer end");
1222
+
1223
+ return(parser->nread);
1224
+ }
1225
+
1226
+ int http_parser_finish(http_parser *parser)
1227
+ {
1228
+ if (http_parser_has_error(parser) ) {
1229
+ return -1;
1230
+ } else if (http_parser_is_finished(parser) ) {
1231
+ return 1;
1232
+ } else {
1233
+ return 0;
1234
+ }
1235
+ }
1236
+
1237
+ int http_parser_has_error(http_parser *parser) {
1238
+ return parser->cs == http_parser_error;
1239
+ }
1240
+
1241
+ int http_parser_is_finished(http_parser *parser) {
1242
+ return parser->cs >= http_parser_first_final;
1243
+ }