mongrel 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (263) hide show
  1. data.tar.gz.sig +2 -0
  2. data/CHANGELOG +2 -0
  3. data/Manifest +68 -0
  4. data/bin/mongrel_rails +55 -22
  5. data/examples/camping/README +3 -0
  6. data/examples/httpd.conf +474 -0
  7. data/examples/mime.yaml +3 -0
  8. data/examples/mongrel.conf +9 -0
  9. data/examples/monitrc +57 -0
  10. data/ext/http11/http11.c +25 -12
  11. data/ext/http11/http11_parser.c +456 -331
  12. data/ext/http11/http11_parser.h +1 -0
  13. data/ext/http11/http11_parser.java.rl +170 -0
  14. data/ext/http11/http11_parser.rl +8 -48
  15. data/ext/http11/http11_parser_common.rl +54 -0
  16. data/ext/http11/tst.h +2 -2
  17. data/ext/http11/tst_cleanup.c +0 -1
  18. data/ext/http11/tst_insert.c +29 -3
  19. data/ext/http11/tst_search.c +60 -55
  20. data/lib/mongrel.rb +68 -53
  21. data/lib/mongrel/cgi.rb +3 -3
  22. data/lib/mongrel/command.rb +1 -1
  23. data/lib/mongrel/configurator.rb +41 -31
  24. data/lib/mongrel/debug.rb +2 -5
  25. data/lib/mongrel/handlers.rb +23 -9
  26. data/lib/mongrel/mime_types.yml +2 -1
  27. data/lib/mongrel/rails.rb +7 -15
  28. data/mongrel-public_cert.pem +20 -0
  29. data/mongrel.gemspec +211 -0
  30. data/test/jruby_socket.rb +39 -0
  31. data/test/test_cgi_wrapper.rb +26 -0
  32. data/test/test_command.rb +1 -4
  33. data/test/test_conditional.rb +6 -18
  34. data/test/test_configurator.rb +5 -8
  35. data/test/test_debug.rb +3 -11
  36. data/test/test_handlers.rb +8 -10
  37. data/test/test_http11.rb +24 -5
  38. data/test/test_redirect_handler.rb +2 -6
  39. data/test/test_request_progress.rb +5 -9
  40. data/test/test_response.rb +24 -3
  41. data/test/test_stats.rb +1 -3
  42. data/test/test_uriclassifier.rb +170 -81
  43. data/test/test_ws.rb +25 -24
  44. data/test/testhelp.rb +26 -3
  45. data/tools/trickletest.rb +2 -2
  46. metadata +138 -333
  47. metadata.gz.sig +0 -0
  48. data/Rakefile +0 -117
  49. data/doc/rdoc/classes/IO.html +0 -170
  50. data/doc/rdoc/classes/IO.src/M000003.html +0 -19
  51. data/doc/rdoc/classes/IO.src/M000004.html +0 -19
  52. data/doc/rdoc/classes/Kernel.html +0 -159
  53. data/doc/rdoc/classes/Kernel.src/M000012.html +0 -19
  54. data/doc/rdoc/classes/Kernel.src/M000013.html +0 -23
  55. data/doc/rdoc/classes/Mongrel.html +0 -204
  56. data/doc/rdoc/classes/Mongrel/CGIWrapper.html +0 -404
  57. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000115.html +0 -25
  58. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000116.html +0 -47
  59. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000117.html +0 -34
  60. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000118.html +0 -32
  61. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000119.html +0 -25
  62. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000120.html +0 -18
  63. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000121.html +0 -18
  64. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000122.html +0 -18
  65. data/doc/rdoc/classes/Mongrel/CGIWrapper.src/M000123.html +0 -19
  66. data/doc/rdoc/classes/Mongrel/Camping.html +0 -177
  67. data/doc/rdoc/classes/Mongrel/Camping.src/M000041.html +0 -22
  68. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.html +0 -184
  69. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000042.html +0 -20
  70. data/doc/rdoc/classes/Mongrel/Camping/CampingHandler.src/M000043.html +0 -58
  71. data/doc/rdoc/classes/Mongrel/Command.html +0 -132
  72. data/doc/rdoc/classes/Mongrel/Command/Base.html +0 -384
  73. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000018.html +0 -24
  74. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000019.html +0 -42
  75. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000020.html +0 -18
  76. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000021.html +0 -18
  77. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000022.html +0 -18
  78. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000023.html +0 -18
  79. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000024.html +0 -22
  80. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000025.html +0 -18
  81. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000026.html +0 -18
  82. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000027.html +0 -18
  83. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000028.html +0 -24
  84. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000029.html +0 -24
  85. data/doc/rdoc/classes/Mongrel/Command/Base.src/M000030.html +0 -18
  86. data/doc/rdoc/classes/Mongrel/Command/Registry.html +0 -192
  87. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000031.html +0 -20
  88. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000032.html +0 -29
  89. data/doc/rdoc/classes/Mongrel/Command/Registry.src/M000033.html +0 -58
  90. data/doc/rdoc/classes/Mongrel/Configurator.html +0 -716
  91. data/doc/rdoc/classes/Mongrel/Configurator.src/M000093.html +0 -27
  92. data/doc/rdoc/classes/Mongrel/Configurator.src/M000094.html +0 -31
  93. data/doc/rdoc/classes/Mongrel/Configurator.src/M000095.html +0 -18
  94. data/doc/rdoc/classes/Mongrel/Configurator.src/M000096.html +0 -21
  95. data/doc/rdoc/classes/Mongrel/Configurator.src/M000097.html +0 -20
  96. data/doc/rdoc/classes/Mongrel/Configurator.src/M000098.html +0 -23
  97. data/doc/rdoc/classes/Mongrel/Configurator.src/M000099.html +0 -18
  98. data/doc/rdoc/classes/Mongrel/Configurator.src/M000100.html +0 -38
  99. data/doc/rdoc/classes/Mongrel/Configurator.src/M000101.html +0 -19
  100. data/doc/rdoc/classes/Mongrel/Configurator.src/M000102.html +0 -39
  101. data/doc/rdoc/classes/Mongrel/Configurator.src/M000103.html +0 -33
  102. data/doc/rdoc/classes/Mongrel/Configurator.src/M000104.html +0 -18
  103. data/doc/rdoc/classes/Mongrel/Configurator.src/M000105.html +0 -24
  104. data/doc/rdoc/classes/Mongrel/Configurator.src/M000106.html +0 -19
  105. data/doc/rdoc/classes/Mongrel/Configurator.src/M000107.html +0 -18
  106. data/doc/rdoc/classes/Mongrel/Configurator.src/M000108.html +0 -22
  107. data/doc/rdoc/classes/Mongrel/Configurator.src/M000109.html +0 -22
  108. data/doc/rdoc/classes/Mongrel/Configurator.src/M000110.html +0 -18
  109. data/doc/rdoc/classes/Mongrel/Configurator.src/M000111.html +0 -34
  110. data/doc/rdoc/classes/Mongrel/Configurator.src/M000112.html +0 -18
  111. data/doc/rdoc/classes/Mongrel/Configurator.src/M000113.html +0 -36
  112. data/doc/rdoc/classes/Mongrel/Configurator.src/M000114.html +0 -18
  113. data/doc/rdoc/classes/Mongrel/Const.html +0 -337
  114. data/doc/rdoc/classes/Mongrel/DeflateFilter.html +0 -188
  115. data/doc/rdoc/classes/Mongrel/DeflateFilter.src/M000124.html +0 -19
  116. data/doc/rdoc/classes/Mongrel/DeflateFilter.src/M000125.html +0 -23
  117. data/doc/rdoc/classes/Mongrel/DirHandler.html +0 -303
  118. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000051.html +0 -21
  119. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000052.html +0 -42
  120. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000053.html +0 -38
  121. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000054.html +0 -65
  122. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000055.html +0 -39
  123. data/doc/rdoc/classes/Mongrel/DirHandler.src/M000056.html +0 -18
  124. data/doc/rdoc/classes/Mongrel/Error404Handler.html +0 -171
  125. data/doc/rdoc/classes/Mongrel/Error404Handler.src/M000126.html +0 -18
  126. data/doc/rdoc/classes/Mongrel/Error404Handler.src/M000127.html +0 -18
  127. data/doc/rdoc/classes/Mongrel/HeaderOut.html +0 -190
  128. data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000066.html +0 -21
  129. data/doc/rdoc/classes/Mongrel/HeaderOut.src/M000067.html +0 -21
  130. data/doc/rdoc/classes/Mongrel/HttpHandler.html +0 -215
  131. data/doc/rdoc/classes/Mongrel/HttpHandler.src/M000072.html +0 -17
  132. data/doc/rdoc/classes/Mongrel/HttpHandler.src/M000073.html +0 -17
  133. data/doc/rdoc/classes/Mongrel/HttpHandler.src/M000074.html +0 -17
  134. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.html +0 -210
  135. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000014.html +0 -17
  136. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000015.html +0 -17
  137. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000016.html +0 -19
  138. data/doc/rdoc/classes/Mongrel/HttpHandlerPlugin.src/M000017.html +0 -17
  139. data/doc/rdoc/classes/Mongrel/HttpParams.html +0 -131
  140. data/doc/rdoc/classes/Mongrel/HttpParser.html +0 -278
  141. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000044.html +0 -28
  142. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000045.html +0 -29
  143. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000046.html +0 -29
  144. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000047.html +0 -59
  145. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000048.html +0 -27
  146. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000049.html +0 -27
  147. data/doc/rdoc/classes/Mongrel/HttpParser.src/M000050.html +0 -28
  148. data/doc/rdoc/classes/Mongrel/HttpParserError.html +0 -111
  149. data/doc/rdoc/classes/Mongrel/HttpRequest.html +0 -284
  150. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000133.html +0 -50
  151. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000134.html +0 -41
  152. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000135.html +0 -29
  153. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000136.html +0 -20
  154. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000137.html +0 -20
  155. data/doc/rdoc/classes/Mongrel/HttpRequest.src/M000138.html +0 -32
  156. data/doc/rdoc/classes/Mongrel/HttpResponse.html +0 -443
  157. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000075.html +0 -25
  158. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000076.html +0 -20
  159. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000077.html +0 -26
  160. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000078.html +0 -22
  161. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000079.html +0 -22
  162. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000080.html +0 -22
  163. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000081.html +0 -31
  164. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000082.html +0 -21
  165. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000083.html +0 -20
  166. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000084.html +0 -20
  167. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000085.html +0 -20
  168. data/doc/rdoc/classes/Mongrel/HttpResponse.src/M000086.html +0 -18
  169. data/doc/rdoc/classes/Mongrel/HttpServer.html +0 -402
  170. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000057.html +0 -25
  171. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000058.html +0 -100
  172. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000059.html +0 -32
  173. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000060.html +0 -21
  174. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000061.html +0 -29
  175. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000062.html +0 -65
  176. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000063.html +0 -34
  177. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000064.html +0 -18
  178. data/doc/rdoc/classes/Mongrel/HttpServer.src/M000065.html +0 -22
  179. data/doc/rdoc/classes/Mongrel/Rails.html +0 -112
  180. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.html +0 -225
  181. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000034.html +0 -37
  182. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000035.html +0 -25
  183. data/doc/rdoc/classes/Mongrel/Rails/RailsConfigurator.src/M000036.html +0 -26
  184. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.html +0 -263
  185. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000037.html +0 -23
  186. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000038.html +0 -56
  187. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000039.html +0 -20
  188. data/doc/rdoc/classes/Mongrel/Rails/RailsHandler.src/M000040.html +0 -25
  189. data/doc/rdoc/classes/Mongrel/RedirectHandler.html +0 -187
  190. data/doc/rdoc/classes/Mongrel/RedirectHandler.src/M000131.html +0 -22
  191. data/doc/rdoc/classes/Mongrel/RedirectHandler.src/M000132.html +0 -27
  192. data/doc/rdoc/classes/Mongrel/StatisticsFilter.html +0 -211
  193. data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/M000128.html +0 -24
  194. data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/M000129.html +0 -24
  195. data/doc/rdoc/classes/Mongrel/StatisticsFilter.src/M000130.html +0 -18
  196. data/doc/rdoc/classes/Mongrel/Stats.html +0 -309
  197. data/doc/rdoc/classes/Mongrel/Stats.src/M000139.html +0 -19
  198. data/doc/rdoc/classes/Mongrel/Stats.src/M000140.html +0 -23
  199. data/doc/rdoc/classes/Mongrel/Stats.src/M000141.html +0 -26
  200. data/doc/rdoc/classes/Mongrel/Stats.src/M000142.html +0 -18
  201. data/doc/rdoc/classes/Mongrel/Stats.src/M000143.html +0 -18
  202. data/doc/rdoc/classes/Mongrel/Stats.src/M000144.html +0 -18
  203. data/doc/rdoc/classes/Mongrel/Stats.src/M000145.html +0 -23
  204. data/doc/rdoc/classes/Mongrel/Stats.src/M000146.html +0 -20
  205. data/doc/rdoc/classes/Mongrel/StatusHandler.html +0 -194
  206. data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000068.html +0 -18
  207. data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000069.html +0 -24
  208. data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000070.html +0 -42
  209. data/doc/rdoc/classes/Mongrel/StatusHandler.src/M000071.html +0 -20
  210. data/doc/rdoc/classes/Mongrel/StopServer.html +0 -117
  211. data/doc/rdoc/classes/Mongrel/TimeoutError.html +0 -117
  212. data/doc/rdoc/classes/Mongrel/URIClassifier.html +0 -317
  213. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000087.html +0 -18
  214. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000088.html +0 -18
  215. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000089.html +0 -39
  216. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000090.html +0 -51
  217. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000091.html +0 -36
  218. data/doc/rdoc/classes/Mongrel/URIClassifier.src/M000092.html +0 -83
  219. data/doc/rdoc/classes/MongrelDbg.html +0 -209
  220. data/doc/rdoc/classes/MongrelDbg.src/M000007.html +0 -24
  221. data/doc/rdoc/classes/MongrelDbg.src/M000008.html +0 -20
  222. data/doc/rdoc/classes/MongrelDbg.src/M000009.html +0 -22
  223. data/doc/rdoc/classes/MongrelDbg.src/M000010.html +0 -21
  224. data/doc/rdoc/classes/MongrelDbg.src/M000011.html +0 -18
  225. data/doc/rdoc/classes/Mutex.html +0 -158
  226. data/doc/rdoc/classes/Mutex.src/M000001.html +0 -24
  227. data/doc/rdoc/classes/Mutex.src/M000002.html +0 -32
  228. data/doc/rdoc/classes/RequestLog.html +0 -115
  229. data/doc/rdoc/classes/RequestLog/Access.html +0 -151
  230. data/doc/rdoc/classes/RequestLog/Access.src/M000147.html +0 -19
  231. data/doc/rdoc/classes/RequestLog/Files.html +0 -144
  232. data/doc/rdoc/classes/RequestLog/Files.src/M000148.html +0 -19
  233. data/doc/rdoc/classes/RequestLog/Objects.html +0 -150
  234. data/doc/rdoc/classes/RequestLog/Objects.src/M000150.html +0 -51
  235. data/doc/rdoc/classes/RequestLog/Params.html +0 -144
  236. data/doc/rdoc/classes/RequestLog/Params.src/M000151.html +0 -19
  237. data/doc/rdoc/classes/RequestLog/Threads.html +0 -144
  238. data/doc/rdoc/classes/RequestLog/Threads.src/M000149.html +0 -34
  239. data/doc/rdoc/classes/TCPServer.html +0 -173
  240. data/doc/rdoc/classes/TCPServer.src/M000005.html +0 -19
  241. data/doc/rdoc/created.rid +0 -1
  242. data/doc/rdoc/files/COPYING.html +0 -168
  243. data/doc/rdoc/files/LICENSE.html +0 -168
  244. data/doc/rdoc/files/README.html +0 -213
  245. data/doc/rdoc/files/ext/http11/http11_c.html +0 -101
  246. data/doc/rdoc/files/lib/mongrel/camping_rb.html +0 -120
  247. data/doc/rdoc/files/lib/mongrel/cgi_rb.html +0 -120
  248. data/doc/rdoc/files/lib/mongrel/command_rb.html +0 -123
  249. data/doc/rdoc/files/lib/mongrel/configurator_rb.html +0 -111
  250. data/doc/rdoc/files/lib/mongrel/debug_rb.html +0 -122
  251. data/doc/rdoc/files/lib/mongrel/handlers_rb.html +0 -122
  252. data/doc/rdoc/files/lib/mongrel/init_rb.html +0 -121
  253. data/doc/rdoc/files/lib/mongrel/rails_rb.html +0 -123
  254. data/doc/rdoc/files/lib/mongrel/stats_rb.html +0 -113
  255. data/doc/rdoc/files/lib/mongrel/tcphack_rb.html +0 -113
  256. data/doc/rdoc/files/lib/mongrel_rb.html +0 -135
  257. data/doc/rdoc/files/lib/mutex_fix_rb.html +0 -108
  258. data/doc/rdoc/fr_class_index.html +0 -68
  259. data/doc/rdoc/fr_file_index.html +0 -42
  260. data/doc/rdoc/fr_method_index.html +0 -177
  261. data/doc/rdoc/index.html +0 -24
  262. data/doc/rdoc/rdoc-style.css +0 -208
  263. data/tools/rakehelp.rb +0 -117
@@ -0,0 +1,3 @@
1
+ ---
2
+ .jpeg: image/jpeg
3
+ .png: image/test
@@ -0,0 +1,9 @@
1
+ ---
2
+ :environment: production
3
+ :daemon: "true"
4
+ :host: 0.0.0.0
5
+ :log_file: log/mongrel.log
6
+ :docroot: public
7
+ :debug: "false"
8
+ :port: 3000
9
+ :pid_file: log/mongrel.pid
@@ -0,0 +1,57 @@
1
+ set daemon 60
2
+ set logfile syslog facility log_daemon
3
+ set mailserver localhost
4
+ set mail-format { from: monit@localhost }
5
+ set alert root@localhost
6
+
7
+ check process sshd with pidfile /var/run/sshd.pid
8
+ start program "/etc/init.d/ssh start"
9
+ stop program "/etc/init.d/ssh stop"
10
+ if failed port 22 protocol ssh then restart
11
+ if 5 restarts within 5 cycles then timeout
12
+
13
+ check process mysql with pidfile /var/run/mysqld/mysqld.pid
14
+ group database
15
+ start program = "/etc/init.d/mysql start"
16
+ stop program = "/etc/init.d/mysql stop"
17
+ if failed host 127.0.0.1 port 3306 then restart
18
+ if 5 restarts within 5 cycles then timeout
19
+
20
+ check process httpd with pidfile /usr/local/apache2/logs/httpd.pid
21
+ group www-data
22
+ start program "/usr/local/apache2/bin/apachectl start"
23
+ stop program "/usr/local/apache2/bin/apachectl stop"
24
+ if failed host localhost port 80 protocol http
25
+ and request "/" then alert
26
+ if cpu is greater than 60% for 2 cycles then alert
27
+ if cpu > 80% for 5 cycles then restart
28
+ if children > 250 then restart
29
+ if loadavg(5min) greater than 10 for 8 cycles then alert
30
+ if 3 restarts within 5 cycles then timeout
31
+
32
+ check process mongrel_8000 with pidfile /var/rails/MYAPP/log/mongrel.8000.pid
33
+ group root
34
+ if failed host 127.0.0.1 port 8000 protocol http
35
+ and request "/" then alert
36
+ if cpu is greater than 60% for 2 cycles then alert
37
+ if cpu > 80% for 5 cycles then restart
38
+ if loadavg(5min) greater than 10 for 8 cycles then restart
39
+ if 3 restarts within 5 cycles then timeout
40
+
41
+ check process mongrel_8001 with pidfile /var/rails/MYAPP/log/mongrel.8001.pid
42
+ group root
43
+ if failed host 127.0.0.1 port 8001 protocol http
44
+ and request "/" then alert
45
+ if cpu is greater than 60% for 2 cycles then alert
46
+ if cpu > 80% for 5 cycles then alert
47
+ if loadavg(5min) greater than 10 for 8 cycles then alert
48
+ if 3 restarts within 5 cycles then timeout
49
+
50
+ check process postfix with pidfile /var/spool/postfix/pid/master.pid
51
+ group mail
52
+ start program = "/etc/init.d/postfix start"
53
+ stop program = "/etc/init.d/postfix stop"
54
+ if failed port 25 protocol smtp then restart
55
+ if 5 restarts within 5 cycles then timeout
56
+
57
+
@@ -21,6 +21,7 @@ static VALUE eHttpParserError;
21
21
  static VALUE global_http_prefix;
22
22
  static VALUE global_request_method;
23
23
  static VALUE global_request_uri;
24
+ static VALUE global_fragment;
24
25
  static VALUE global_query_string;
25
26
  static VALUE global_http_version;
26
27
  static VALUE global_content_length;
@@ -55,6 +56,7 @@ static VALUE global_port_80;
55
56
  DEF_MAX_LENGTH(FIELD_NAME, 256);
56
57
  DEF_MAX_LENGTH(FIELD_VALUE, 80 * 1024);
57
58
  DEF_MAX_LENGTH(REQUEST_URI, 1024 * 12);
59
+ DEF_MAX_LENGTH(FRAGMENT, 1024); /* Don't know if this length is specified somewhere or not */
58
60
  DEF_MAX_LENGTH(REQUEST_PATH, 1024);
59
61
  DEF_MAX_LENGTH(QUERY_STRING, (1024 * 10));
60
62
  DEF_MAX_LENGTH(HEADER, (1024 * (80 + 32)));
@@ -105,6 +107,17 @@ void request_uri(void *data, const char *at, size_t length)
105
107
  rb_hash_aset(req, global_request_uri, val);
106
108
  }
107
109
 
110
+ void fragment(void *data, const char *at, size_t length)
111
+ {
112
+ VALUE req = (VALUE)data;
113
+ VALUE val = Qnil;
114
+
115
+ VALIDATE_MAX_LENGTH(length, FRAGMENT);
116
+
117
+ val = rb_str_new(at, length);
118
+ rb_hash_aset(req, global_fragment, val);
119
+ }
120
+
108
121
  void request_path(void *data, const char *at, size_t length)
109
122
  {
110
123
  VALUE req = (VALUE)data;
@@ -157,7 +170,7 @@ void header_done(void *data, const char *at, size_t length)
157
170
 
158
171
  rb_hash_aset(req, global_gateway_interface, global_gateway_interface_value);
159
172
  if((temp = rb_hash_aref(req, global_http_host)) != Qnil) {
160
- // ruby better close strings off with a '\0' dammit
173
+ /* ruby better close strings off with a '\0' dammit */
161
174
  colon = strchr(RSTRING(temp)->ptr, ':');
162
175
  if(colon != NULL) {
163
176
  rb_hash_aset(req, global_server_name, rb_str_substr(temp, 0, colon - RSTRING(temp)->ptr));
@@ -170,7 +183,7 @@ void header_done(void *data, const char *at, size_t length)
170
183
  }
171
184
  }
172
185
 
173
- // grab the initial body and stuff it into an ivar
186
+ /* grab the initial body and stuff it into an ivar */
174
187
  rb_ivar_set(req, id_http_body, rb_str_new(at, length));
175
188
  rb_hash_aset(req, global_server_protocol, global_server_protocol_value);
176
189
  rb_hash_aset(req, global_server_software, global_mongrel_version);
@@ -194,6 +207,7 @@ VALUE HttpParser_alloc(VALUE klass)
194
207
  hp->http_field = http_field;
195
208
  hp->request_method = request_method;
196
209
  hp->request_uri = request_uri;
210
+ hp->fragment = fragment;
197
211
  hp->request_path = request_path;
198
212
  hp->query_string = query_string;
199
213
  hp->http_version = http_version;
@@ -392,7 +406,7 @@ VALUE URIClassifier_init(VALUE self)
392
406
  {
393
407
  VALUE hash;
394
408
 
395
- // we create an internal hash to protect stuff from the GC
409
+ /* we create an internal hash to protect stuff from the GC */
396
410
  hash = rb_hash_new();
397
411
  rb_ivar_set(self, id_handler_map, hash);
398
412
 
@@ -506,25 +520,25 @@ VALUE URIClassifier_resolve(VALUE self, VALUE uri)
506
520
  DATA_GET(self, struct tst, tst);
507
521
  uri_str = (unsigned char *)StringValueCStr(uri);
508
522
 
509
- handler = tst_search(uri_str, tst, &pref_len);
523
+ handler = tst_search(uri_str, tst, TST_LONGEST_MATCH, &pref_len);
510
524
 
511
- // setup for multiple return values
525
+ /* setup for multiple return values */
512
526
  result = rb_ary_new();
513
527
 
514
528
  if(handler) {
515
529
  rb_ary_push(result, rb_str_substr (uri, 0, pref_len));
516
- // compensate for a script_name="/" where we need to add the "/" to path_info to keep it consistent
530
+ /* compensate for a script_name="/" where we need to add the "/" to path_info to keep it consistent */
517
531
  if(pref_len == 1 && uri_str[0] == '/') {
518
- // matches the root URI so we have to use the whole URI as the path_info
532
+ /* matches the root URI so we have to use the whole URI as the path_info */
519
533
  rb_ary_push(result, uri);
520
534
  } else {
521
- // matches a script so process like normal
535
+ /* matches a script so process like normal */
522
536
  rb_ary_push(result, rb_str_substr(uri, pref_len, RSTRING(uri)->len));
523
537
  }
524
538
 
525
539
  rb_ary_push(result, (VALUE)handler);
526
540
  } else {
527
- // not found so push back nothing
541
+ /* not found so push back nothing */
528
542
  rb_ary_push(result, Qnil);
529
543
  rb_ary_push(result, Qnil);
530
544
  rb_ary_push(result, Qnil);
@@ -542,6 +556,7 @@ void Init_http11()
542
556
  DEF_GLOBAL(http_prefix, "HTTP_");
543
557
  DEF_GLOBAL(request_method, "REQUEST_METHOD");
544
558
  DEF_GLOBAL(request_uri, "REQUEST_URI");
559
+ DEF_GLOBAL(fragment, "FRAGMENT");
545
560
  DEF_GLOBAL(query_string, "QUERY_STRING");
546
561
  DEF_GLOBAL(http_version, "HTTP_VERSION");
547
562
  DEF_GLOBAL(request_path, "REQUEST_PATH");
@@ -556,7 +571,7 @@ void Init_http11()
556
571
  DEF_GLOBAL(server_protocol, "SERVER_PROTOCOL");
557
572
  DEF_GLOBAL(server_protocol_value, "HTTP/1.1");
558
573
  DEF_GLOBAL(http_host, "HTTP_HOST");
559
- DEF_GLOBAL(mongrel_version, "Mongrel 1.0.1");
574
+ DEF_GLOBAL(mongrel_version, "Mongrel 1.0.2");
560
575
  DEF_GLOBAL(server_software, "SERVER_SOFTWARE");
561
576
  DEF_GLOBAL(port_80, "80");
562
577
 
@@ -579,5 +594,3 @@ void Init_http11()
579
594
  rb_define_method(cURIClassifier, "unregister", URIClassifier_unregister, 1);
580
595
  rb_define_method(cURIClassifier, "resolve", URIClassifier_resolve, 1);
581
596
  }
582
-
583
-
@@ -1,4 +1,4 @@
1
- #line 1 "ext/http11/http11_parser.rl"
1
+ #line 1 "http11_parser.rl"
2
2
  /**
3
3
  * Copyright (c) 2005 Zed A. Shaw
4
4
  * You can redistribute it and/or modify it under the same terms as Ruby.
@@ -14,29 +14,30 @@
14
14
  #define MARK(M,FPC) (parser->M = (FPC) - buffer)
15
15
  #define PTR_TO(F) (buffer + parser->F)
16
16
 
17
- /** machine **/
18
- #line 114 "ext/http11/http11_parser.rl"
17
+ /** Machine **/
19
18
 
19
+ #line 74 "http11_parser.rl"
20
20
 
21
- /** Data **/
22
21
 
23
- #line 24 "ext/http11/http11_parser.c"
24
- static const int http_parser_start = 0;
22
+ /** Data **/
25
23
 
26
- static const int http_parser_first_final = 53;
24
+ #line 25 "http11_parser.c"
25
+ static const int http_parser_start = 1;
26
+ static const int http_parser_first_final = 57;
27
+ static const int http_parser_error = 0;
27
28
 
28
- static const int http_parser_error = 1;
29
+ static const int http_parser_en_main = 1;
29
30
 
30
- #line 118 "ext/http11/http11_parser.rl"
31
+ #line 78 "http11_parser.rl"
31
32
 
32
33
  int http_parser_init(http_parser *parser) {
33
34
  int cs = 0;
34
35
 
35
- #line 36 "ext/http11/http11_parser.c"
36
+ #line 37 "http11_parser.c"
36
37
  {
37
38
  cs = http_parser_start;
38
39
  }
39
- #line 122 "ext/http11/http11_parser.rl"
40
+ #line 82 "http11_parser.rl"
40
41
  parser->cs = cs;
41
42
  parser->body_start = 0;
42
43
  parser->content_len = 0;
@@ -64,53 +65,53 @@ size_t http_parser_execute(http_parser *parser, const char *buffer, size_t len,
64
65
 
65
66
 
66
67
 
67
- #line 68 "ext/http11/http11_parser.c"
68
+ #line 69 "http11_parser.c"
68
69
  {
69
70
  if ( p == pe )
70
71
  goto _out;
71
72
  switch ( cs )
72
73
  {
73
- case 0:
74
+ case 1:
74
75
  switch( (*p) ) {
75
- case 36: goto tr14;
76
- case 95: goto tr14;
76
+ case 36: goto tr0;
77
+ case 95: goto tr0;
77
78
  }
78
79
  if ( (*p) < 48 ) {
79
80
  if ( 45 <= (*p) && (*p) <= 46 )
80
- goto tr14;
81
+ goto tr0;
81
82
  } else if ( (*p) > 57 ) {
82
83
  if ( 65 <= (*p) && (*p) <= 90 )
83
- goto tr14;
84
+ goto tr0;
84
85
  } else
85
- goto tr14;
86
- goto st1;
87
- st1:
88
- goto _out1;
89
- tr14:
90
- #line 20 "ext/http11/http11_parser.rl"
86
+ goto tr0;
87
+ goto st0;
88
+ st0:
89
+ goto _out0;
90
+ tr0:
91
+ #line 22 "http11_parser.rl"
91
92
  {MARK(mark, p); }
92
93
  goto st2;
93
94
  st2:
94
95
  if ( ++p == pe )
95
96
  goto _out2;
96
97
  case 2:
97
- #line 98 "ext/http11/http11_parser.c"
98
+ #line 99 "http11_parser.c"
98
99
  switch( (*p) ) {
99
- case 32: goto tr17;
100
- case 36: goto st34;
101
- case 95: goto st34;
100
+ case 32: goto tr2;
101
+ case 36: goto st38;
102
+ case 95: goto st38;
102
103
  }
103
104
  if ( (*p) < 48 ) {
104
105
  if ( 45 <= (*p) && (*p) <= 46 )
105
- goto st34;
106
+ goto st38;
106
107
  } else if ( (*p) > 57 ) {
107
108
  if ( 65 <= (*p) && (*p) <= 90 )
108
- goto st34;
109
+ goto st38;
109
110
  } else
110
- goto st34;
111
- goto st1;
112
- tr17:
113
- #line 34 "ext/http11/http11_parser.rl"
111
+ goto st38;
112
+ goto st0;
113
+ tr2:
114
+ #line 36 "http11_parser.rl"
114
115
  {
115
116
  if(parser->request_method != NULL)
116
117
  parser->request_method(parser->data, PTR_TO(mark), LEN(mark, p));
@@ -120,74 +121,83 @@ st3:
120
121
  if ( ++p == pe )
121
122
  goto _out3;
122
123
  case 3:
123
- #line 124 "ext/http11/http11_parser.c"
124
+ #line 125 "http11_parser.c"
124
125
  switch( (*p) ) {
125
- case 42: goto tr10;
126
- case 43: goto tr11;
127
- case 47: goto tr12;
128
- case 58: goto tr13;
126
+ case 42: goto tr4;
127
+ case 43: goto tr5;
128
+ case 47: goto tr6;
129
+ case 58: goto tr7;
129
130
  }
130
131
  if ( (*p) < 65 ) {
131
132
  if ( 45 <= (*p) && (*p) <= 57 )
132
- goto tr11;
133
+ goto tr5;
133
134
  } else if ( (*p) > 90 ) {
134
135
  if ( 97 <= (*p) && (*p) <= 122 )
135
- goto tr11;
136
+ goto tr5;
136
137
  } else
137
- goto tr11;
138
- goto st1;
139
- tr10:
140
- #line 20 "ext/http11/http11_parser.rl"
138
+ goto tr5;
139
+ goto st0;
140
+ tr4:
141
+ #line 22 "http11_parser.rl"
141
142
  {MARK(mark, p); }
142
143
  goto st4;
143
144
  st4:
144
145
  if ( ++p == pe )
145
146
  goto _out4;
146
147
  case 4:
147
- #line 148 "ext/http11/http11_parser.c"
148
- if ( (*p) == 32 )
149
- goto tr19;
150
- goto st1;
151
- tr19:
152
- #line 38 "ext/http11/http11_parser.rl"
148
+ #line 149 "http11_parser.c"
149
+ switch( (*p) ) {
150
+ case 32: goto tr8;
151
+ case 35: goto tr9;
152
+ }
153
+ goto st0;
154
+ tr8:
155
+ #line 40 "http11_parser.rl"
153
156
  {
154
157
  if(parser->request_uri != NULL)
155
158
  parser->request_uri(parser->data, PTR_TO(mark), LEN(mark, p));
156
159
  }
157
160
  goto st5;
158
- tr28:
159
- #line 44 "ext/http11/http11_parser.rl"
161
+ tr30:
162
+ #line 44 "http11_parser.rl"
160
163
  {
161
- if(parser->query_string != NULL)
162
- parser->query_string(parser->data, PTR_TO(query_start), LEN(query_start, p));
163
- }
164
- #line 38 "ext/http11/http11_parser.rl"
165
- {
166
- if(parser->request_uri != NULL)
167
- parser->request_uri(parser->data, PTR_TO(mark), LEN(mark, p));
164
+ if(parser->fragment != NULL)
165
+ parser->fragment(parser->data, PTR_TO(mark), LEN(mark, p));
168
166
  }
169
167
  goto st5;
170
- tr31:
171
- #line 54 "ext/http11/http11_parser.rl"
168
+ tr40:
169
+ #line 60 "http11_parser.rl"
172
170
  {
173
171
  if(parser->request_path != NULL)
174
172
  parser->request_path(parser->data, PTR_TO(mark), LEN(mark,p));
175
173
  }
176
- #line 38 "ext/http11/http11_parser.rl"
174
+ #line 40 "http11_parser.rl"
177
175
  {
178
176
  if(parser->request_uri != NULL)
179
177
  parser->request_uri(parser->data, PTR_TO(mark), LEN(mark, p));
180
178
  }
181
179
  goto st5;
182
- tr40:
183
- #line 43 "ext/http11/http11_parser.rl"
180
+ tr51:
181
+ #line 49 "http11_parser.rl"
184
182
  {MARK(query_start, p); }
185
- #line 44 "ext/http11/http11_parser.rl"
183
+ #line 50 "http11_parser.rl"
186
184
  {
187
185
  if(parser->query_string != NULL)
188
186
  parser->query_string(parser->data, PTR_TO(query_start), LEN(query_start, p));
189
187
  }
190
- #line 38 "ext/http11/http11_parser.rl"
188
+ #line 40 "http11_parser.rl"
189
+ {
190
+ if(parser->request_uri != NULL)
191
+ parser->request_uri(parser->data, PTR_TO(mark), LEN(mark, p));
192
+ }
193
+ goto st5;
194
+ tr55:
195
+ #line 50 "http11_parser.rl"
196
+ {
197
+ if(parser->query_string != NULL)
198
+ parser->query_string(parser->data, PTR_TO(query_start), LEN(query_start, p));
199
+ }
200
+ #line 40 "http11_parser.rl"
191
201
  {
192
202
  if(parser->request_uri != NULL)
193
203
  parser->request_uri(parser->data, PTR_TO(mark), LEN(mark, p));
@@ -197,50 +207,50 @@ st5:
197
207
  if ( ++p == pe )
198
208
  goto _out5;
199
209
  case 5:
200
- #line 201 "ext/http11/http11_parser.c"
210
+ #line 211 "http11_parser.c"
201
211
  if ( (*p) == 72 )
202
- goto tr3;
203
- goto st1;
204
- tr3:
205
- #line 20 "ext/http11/http11_parser.rl"
212
+ goto tr10;
213
+ goto st0;
214
+ tr10:
215
+ #line 22 "http11_parser.rl"
206
216
  {MARK(mark, p); }
207
217
  goto st6;
208
218
  st6:
209
219
  if ( ++p == pe )
210
220
  goto _out6;
211
221
  case 6:
212
- #line 213 "ext/http11/http11_parser.c"
222
+ #line 223 "http11_parser.c"
213
223
  if ( (*p) == 84 )
214
224
  goto st7;
215
- goto st1;
225
+ goto st0;
216
226
  st7:
217
227
  if ( ++p == pe )
218
228
  goto _out7;
219
229
  case 7:
220
230
  if ( (*p) == 84 )
221
231
  goto st8;
222
- goto st1;
232
+ goto st0;
223
233
  st8:
224
234
  if ( ++p == pe )
225
235
  goto _out8;
226
236
  case 8:
227
237
  if ( (*p) == 80 )
228
238
  goto st9;
229
- goto st1;
239
+ goto st0;
230
240
  st9:
231
241
  if ( ++p == pe )
232
242
  goto _out9;
233
243
  case 9:
234
244
  if ( (*p) == 47 )
235
245
  goto st10;
236
- goto st1;
246
+ goto st0;
237
247
  st10:
238
248
  if ( ++p == pe )
239
249
  goto _out10;
240
250
  case 10:
241
251
  if ( 48 <= (*p) && (*p) <= 57 )
242
252
  goto st11;
243
- goto st1;
253
+ goto st0;
244
254
  st11:
245
255
  if ( ++p == pe )
246
256
  goto _out11;
@@ -249,32 +259,32 @@ case 11:
249
259
  goto st12;
250
260
  if ( 48 <= (*p) && (*p) <= 57 )
251
261
  goto st11;
252
- goto st1;
262
+ goto st0;
253
263
  st12:
254
264
  if ( ++p == pe )
255
265
  goto _out12;
256
266
  case 12:
257
267
  if ( 48 <= (*p) && (*p) <= 57 )
258
268
  goto st13;
259
- goto st1;
269
+ goto st0;
260
270
  st13:
261
271
  if ( ++p == pe )
262
272
  goto _out13;
263
273
  case 13:
264
274
  if ( (*p) == 13 )
265
- goto tr22;
275
+ goto tr18;
266
276
  if ( 48 <= (*p) && (*p) <= 57 )
267
277
  goto st13;
268
- goto st1;
269
- tr22:
270
- #line 49 "ext/http11/http11_parser.rl"
278
+ goto st0;
279
+ tr18:
280
+ #line 55 "http11_parser.rl"
271
281
  {
272
282
  if(parser->http_version != NULL)
273
283
  parser->http_version(parser->data, PTR_TO(mark), LEN(mark, p));
274
284
  }
275
285
  goto st14;
276
- tr36:
277
- #line 29 "ext/http11/http11_parser.rl"
286
+ tr26:
287
+ #line 31 "http11_parser.rl"
278
288
  {
279
289
  if(parser->http_field != NULL) {
280
290
  parser->http_field(parser->data, PTR_TO(field_start), parser->field_len, PTR_TO(mark), LEN(mark, p));
@@ -285,10 +295,10 @@ st14:
285
295
  if ( ++p == pe )
286
296
  goto _out14;
287
297
  case 14:
288
- #line 289 "ext/http11/http11_parser.c"
298
+ #line 299 "http11_parser.c"
289
299
  if ( (*p) == 10 )
290
300
  goto st15;
291
- goto st1;
301
+ goto st0;
292
302
  st15:
293
303
  if ( ++p == pe )
294
304
  goto _out15;
@@ -316,41 +326,41 @@ case 15:
316
326
  goto tr21;
317
327
  } else
318
328
  goto tr21;
319
- goto st1;
329
+ goto st0;
320
330
  st16:
321
331
  if ( ++p == pe )
322
332
  goto _out16;
323
333
  case 16:
324
334
  if ( (*p) == 10 )
325
- goto tr25;
326
- goto st1;
327
- tr25:
328
- #line 59 "ext/http11/http11_parser.rl"
335
+ goto tr22;
336
+ goto st0;
337
+ tr22:
338
+ #line 65 "http11_parser.rl"
329
339
  {
330
340
  parser->body_start = p - buffer + 1;
331
341
  if(parser->header_done != NULL)
332
342
  parser->header_done(parser->data, p + 1, pe - p - 1);
333
- goto _out53;
343
+ goto _out57;
334
344
  }
335
- goto st53;
336
- st53:
345
+ goto st57;
346
+ st57:
337
347
  if ( ++p == pe )
338
- goto _out53;
339
- case 53:
340
- #line 341 "ext/http11/http11_parser.c"
341
- goto st1;
348
+ goto _out57;
349
+ case 57:
350
+ #line 351 "http11_parser.c"
351
+ goto st0;
342
352
  tr21:
343
- #line 23 "ext/http11/http11_parser.rl"
353
+ #line 25 "http11_parser.rl"
344
354
  { MARK(field_start, p); }
345
355
  goto st17;
346
356
  st17:
347
357
  if ( ++p == pe )
348
358
  goto _out17;
349
359
  case 17:
350
- #line 351 "ext/http11/http11_parser.c"
360
+ #line 361 "http11_parser.c"
351
361
  switch( (*p) ) {
352
362
  case 33: goto st17;
353
- case 58: goto tr16;
363
+ case 58: goto tr24;
354
364
  case 124: goto st17;
355
365
  case 126: goto st17;
356
366
  }
@@ -371,90 +381,133 @@ case 17:
371
381
  goto st17;
372
382
  } else
373
383
  goto st17;
374
- goto st1;
375
- tr16:
376
- #line 24 "ext/http11/http11_parser.rl"
384
+ goto st0;
385
+ tr24:
386
+ #line 26 "http11_parser.rl"
377
387
  {
378
388
  parser->field_len = LEN(field_start, p);
379
389
  }
380
390
  goto st18;
381
- tr38:
382
- #line 28 "ext/http11/http11_parser.rl"
391
+ tr27:
392
+ #line 30 "http11_parser.rl"
383
393
  { MARK(mark, p); }
384
394
  goto st18;
385
395
  st18:
386
396
  if ( ++p == pe )
387
397
  goto _out18;
388
398
  case 18:
389
- #line 390 "ext/http11/http11_parser.c"
399
+ #line 400 "http11_parser.c"
390
400
  switch( (*p) ) {
391
- case 13: goto tr36;
392
- case 32: goto tr38;
401
+ case 13: goto tr26;
402
+ case 32: goto tr27;
393
403
  }
394
- goto tr37;
395
- tr37:
396
- #line 28 "ext/http11/http11_parser.rl"
404
+ goto tr25;
405
+ tr25:
406
+ #line 30 "http11_parser.rl"
397
407
  { MARK(mark, p); }
398
408
  goto st19;
399
409
  st19:
400
410
  if ( ++p == pe )
401
411
  goto _out19;
402
412
  case 19:
403
- #line 404 "ext/http11/http11_parser.c"
413
+ #line 414 "http11_parser.c"
404
414
  if ( (*p) == 13 )
405
- goto tr36;
415
+ goto tr26;
406
416
  goto st19;
407
- tr11:
408
- #line 20 "ext/http11/http11_parser.rl"
409
- {MARK(mark, p); }
417
+ tr9:
418
+ #line 40 "http11_parser.rl"
419
+ {
420
+ if(parser->request_uri != NULL)
421
+ parser->request_uri(parser->data, PTR_TO(mark), LEN(mark, p));
422
+ }
423
+ goto st20;
424
+ tr41:
425
+ #line 60 "http11_parser.rl"
426
+ {
427
+ if(parser->request_path != NULL)
428
+ parser->request_path(parser->data, PTR_TO(mark), LEN(mark,p));
429
+ }
430
+ #line 40 "http11_parser.rl"
431
+ {
432
+ if(parser->request_uri != NULL)
433
+ parser->request_uri(parser->data, PTR_TO(mark), LEN(mark, p));
434
+ }
435
+ goto st20;
436
+ tr52:
437
+ #line 49 "http11_parser.rl"
438
+ {MARK(query_start, p); }
439
+ #line 50 "http11_parser.rl"
440
+ {
441
+ if(parser->query_string != NULL)
442
+ parser->query_string(parser->data, PTR_TO(query_start), LEN(query_start, p));
443
+ }
444
+ #line 40 "http11_parser.rl"
445
+ {
446
+ if(parser->request_uri != NULL)
447
+ parser->request_uri(parser->data, PTR_TO(mark), LEN(mark, p));
448
+ }
449
+ goto st20;
450
+ tr56:
451
+ #line 50 "http11_parser.rl"
452
+ {
453
+ if(parser->query_string != NULL)
454
+ parser->query_string(parser->data, PTR_TO(query_start), LEN(query_start, p));
455
+ }
456
+ #line 40 "http11_parser.rl"
457
+ {
458
+ if(parser->request_uri != NULL)
459
+ parser->request_uri(parser->data, PTR_TO(mark), LEN(mark, p));
460
+ }
410
461
  goto st20;
411
462
  st20:
412
463
  if ( ++p == pe )
413
464
  goto _out20;
414
465
  case 20:
415
- #line 416 "ext/http11/http11_parser.c"
466
+ #line 467 "http11_parser.c"
416
467
  switch( (*p) ) {
417
- case 43: goto st20;
418
- case 58: goto st21;
468
+ case 32: goto tr30;
469
+ case 37: goto tr31;
470
+ case 60: goto st0;
471
+ case 62: goto st0;
472
+ case 127: goto st0;
419
473
  }
420
- if ( (*p) < 48 ) {
421
- if ( 45 <= (*p) && (*p) <= 46 )
422
- goto st20;
423
- } else if ( (*p) > 57 ) {
424
- if ( (*p) > 90 ) {
425
- if ( 97 <= (*p) && (*p) <= 122 )
426
- goto st20;
427
- } else if ( (*p) >= 65 )
428
- goto st20;
429
- } else
430
- goto st20;
431
- goto st1;
432
- tr13:
433
- #line 20 "ext/http11/http11_parser.rl"
474
+ if ( (*p) > 31 ) {
475
+ if ( 34 <= (*p) && (*p) <= 35 )
476
+ goto st0;
477
+ } else if ( (*p) >= 0 )
478
+ goto st0;
479
+ goto tr29;
480
+ tr29:
481
+ #line 22 "http11_parser.rl"
434
482
  {MARK(mark, p); }
435
483
  goto st21;
436
484
  st21:
437
485
  if ( ++p == pe )
438
486
  goto _out21;
439
487
  case 21:
440
- #line 441 "ext/http11/http11_parser.c"
488
+ #line 489 "http11_parser.c"
441
489
  switch( (*p) ) {
442
- case 32: goto tr19;
490
+ case 32: goto tr30;
443
491
  case 37: goto st22;
444
- case 60: goto st1;
445
- case 62: goto st1;
446
- case 127: goto st1;
492
+ case 60: goto st0;
493
+ case 62: goto st0;
494
+ case 127: goto st0;
447
495
  }
448
496
  if ( (*p) > 31 ) {
449
497
  if ( 34 <= (*p) && (*p) <= 35 )
450
- goto st1;
498
+ goto st0;
451
499
  } else if ( (*p) >= 0 )
452
- goto st1;
500
+ goto st0;
453
501
  goto st21;
502
+ tr31:
503
+ #line 22 "http11_parser.rl"
504
+ {MARK(mark, p); }
505
+ goto st22;
454
506
  st22:
455
507
  if ( ++p == pe )
456
508
  goto _out22;
457
509
  case 22:
510
+ #line 511 "http11_parser.c"
458
511
  if ( (*p) < 65 ) {
459
512
  if ( 48 <= (*p) && (*p) <= 57 )
460
513
  goto st23;
@@ -463,7 +516,7 @@ case 22:
463
516
  goto st23;
464
517
  } else
465
518
  goto st23;
466
- goto st1;
519
+ goto st0;
467
520
  st23:
468
521
  if ( ++p == pe )
469
522
  goto _out23;
@@ -476,165 +529,157 @@ case 23:
476
529
  goto st21;
477
530
  } else
478
531
  goto st21;
479
- goto st1;
480
- tr12:
481
- #line 20 "ext/http11/http11_parser.rl"
532
+ goto st0;
533
+ tr5:
534
+ #line 22 "http11_parser.rl"
482
535
  {MARK(mark, p); }
483
536
  goto st24;
484
537
  st24:
485
538
  if ( ++p == pe )
486
539
  goto _out24;
487
540
  case 24:
488
- #line 489 "ext/http11/http11_parser.c"
541
+ #line 542 "http11_parser.c"
489
542
  switch( (*p) ) {
490
- case 32: goto tr31;
491
- case 37: goto st25;
492
- case 59: goto tr33;
493
- case 60: goto st1;
494
- case 62: goto st1;
495
- case 63: goto tr34;
496
- case 127: goto st1;
543
+ case 43: goto st24;
544
+ case 58: goto st25;
497
545
  }
498
- if ( (*p) > 31 ) {
499
- if ( 34 <= (*p) && (*p) <= 35 )
500
- goto st1;
501
- } else if ( (*p) >= 0 )
502
- goto st1;
503
- goto st24;
546
+ if ( (*p) < 48 ) {
547
+ if ( 45 <= (*p) && (*p) <= 46 )
548
+ goto st24;
549
+ } else if ( (*p) > 57 ) {
550
+ if ( (*p) > 90 ) {
551
+ if ( 97 <= (*p) && (*p) <= 122 )
552
+ goto st24;
553
+ } else if ( (*p) >= 65 )
554
+ goto st24;
555
+ } else
556
+ goto st24;
557
+ goto st0;
558
+ tr7:
559
+ #line 22 "http11_parser.rl"
560
+ {MARK(mark, p); }
561
+ goto st25;
504
562
  st25:
505
563
  if ( ++p == pe )
506
564
  goto _out25;
507
565
  case 25:
508
- if ( (*p) < 65 ) {
509
- if ( 48 <= (*p) && (*p) <= 57 )
510
- goto st26;
511
- } else if ( (*p) > 70 ) {
512
- if ( 97 <= (*p) && (*p) <= 102 )
513
- goto st26;
514
- } else
515
- goto st26;
516
- goto st1;
566
+ #line 567 "http11_parser.c"
567
+ switch( (*p) ) {
568
+ case 32: goto tr8;
569
+ case 34: goto st0;
570
+ case 35: goto tr9;
571
+ case 37: goto st26;
572
+ case 60: goto st0;
573
+ case 62: goto st0;
574
+ case 127: goto st0;
575
+ }
576
+ if ( 0 <= (*p) && (*p) <= 31 )
577
+ goto st0;
578
+ goto st25;
517
579
  st26:
518
580
  if ( ++p == pe )
519
581
  goto _out26;
520
582
  case 26:
521
583
  if ( (*p) < 65 ) {
522
584
  if ( 48 <= (*p) && (*p) <= 57 )
523
- goto st24;
585
+ goto st27;
524
586
  } else if ( (*p) > 70 ) {
525
587
  if ( 97 <= (*p) && (*p) <= 102 )
526
- goto st24;
588
+ goto st27;
527
589
  } else
528
- goto st24;
529
- goto st1;
530
- tr33:
531
- #line 54 "ext/http11/http11_parser.rl"
532
- {
533
- if(parser->request_path != NULL)
534
- parser->request_path(parser->data, PTR_TO(mark), LEN(mark,p));
535
- }
536
- goto st27;
590
+ goto st27;
591
+ goto st0;
537
592
  st27:
538
593
  if ( ++p == pe )
539
594
  goto _out27;
540
595
  case 27:
541
- #line 542 "ext/http11/http11_parser.c"
542
- switch( (*p) ) {
543
- case 32: goto tr19;
544
- case 37: goto st28;
545
- case 60: goto st1;
546
- case 62: goto st1;
547
- case 63: goto st30;
548
- case 127: goto st1;
549
- }
550
- if ( (*p) > 31 ) {
551
- if ( 34 <= (*p) && (*p) <= 35 )
552
- goto st1;
553
- } else if ( (*p) >= 0 )
554
- goto st1;
555
- goto st27;
596
+ if ( (*p) < 65 ) {
597
+ if ( 48 <= (*p) && (*p) <= 57 )
598
+ goto st25;
599
+ } else if ( (*p) > 70 ) {
600
+ if ( 97 <= (*p) && (*p) <= 102 )
601
+ goto st25;
602
+ } else
603
+ goto st25;
604
+ goto st0;
605
+ tr6:
606
+ #line 22 "http11_parser.rl"
607
+ {MARK(mark, p); }
608
+ goto st28;
556
609
  st28:
557
610
  if ( ++p == pe )
558
611
  goto _out28;
559
612
  case 28:
613
+ #line 614 "http11_parser.c"
614
+ switch( (*p) ) {
615
+ case 32: goto tr40;
616
+ case 34: goto st0;
617
+ case 35: goto tr41;
618
+ case 37: goto st29;
619
+ case 59: goto tr43;
620
+ case 60: goto st0;
621
+ case 62: goto st0;
622
+ case 63: goto tr44;
623
+ case 127: goto st0;
624
+ }
625
+ if ( 0 <= (*p) && (*p) <= 31 )
626
+ goto st0;
627
+ goto st28;
628
+ st29:
629
+ if ( ++p == pe )
630
+ goto _out29;
631
+ case 29:
560
632
  if ( (*p) < 65 ) {
561
633
  if ( 48 <= (*p) && (*p) <= 57 )
562
- goto st29;
634
+ goto st30;
563
635
  } else if ( (*p) > 70 ) {
564
636
  if ( 97 <= (*p) && (*p) <= 102 )
565
- goto st29;
637
+ goto st30;
566
638
  } else
567
- goto st29;
568
- goto st1;
569
- st29:
639
+ goto st30;
640
+ goto st0;
641
+ st30:
570
642
  if ( ++p == pe )
571
- goto _out29;
572
- case 29:
643
+ goto _out30;
644
+ case 30:
573
645
  if ( (*p) < 65 ) {
574
646
  if ( 48 <= (*p) && (*p) <= 57 )
575
- goto st27;
647
+ goto st28;
576
648
  } else if ( (*p) > 70 ) {
577
649
  if ( 97 <= (*p) && (*p) <= 102 )
578
- goto st27;
650
+ goto st28;
579
651
  } else
580
- goto st27;
581
- goto st1;
582
- tr34:
583
- #line 54 "ext/http11/http11_parser.rl"
652
+ goto st28;
653
+ goto st0;
654
+ tr43:
655
+ #line 60 "http11_parser.rl"
584
656
  {
585
657
  if(parser->request_path != NULL)
586
658
  parser->request_path(parser->data, PTR_TO(mark), LEN(mark,p));
587
659
  }
588
- goto st30;
589
- st30:
590
- if ( ++p == pe )
591
- goto _out30;
592
- case 30:
593
- #line 594 "ext/http11/http11_parser.c"
594
- switch( (*p) ) {
595
- case 32: goto tr40;
596
- case 37: goto tr41;
597
- case 60: goto st1;
598
- case 62: goto st1;
599
- case 127: goto st1;
600
- }
601
- if ( (*p) > 31 ) {
602
- if ( 34 <= (*p) && (*p) <= 35 )
603
- goto st1;
604
- } else if ( (*p) >= 0 )
605
- goto st1;
606
- goto tr39;
607
- tr39:
608
- #line 43 "ext/http11/http11_parser.rl"
609
- {MARK(query_start, p); }
610
660
  goto st31;
611
661
  st31:
612
662
  if ( ++p == pe )
613
663
  goto _out31;
614
664
  case 31:
615
- #line 616 "ext/http11/http11_parser.c"
665
+ #line 666 "http11_parser.c"
616
666
  switch( (*p) ) {
617
- case 32: goto tr28;
667
+ case 32: goto tr8;
668
+ case 34: goto st0;
669
+ case 35: goto tr9;
618
670
  case 37: goto st32;
619
- case 60: goto st1;
620
- case 62: goto st1;
621
- case 127: goto st1;
671
+ case 60: goto st0;
672
+ case 62: goto st0;
673
+ case 63: goto st34;
674
+ case 127: goto st0;
622
675
  }
623
- if ( (*p) > 31 ) {
624
- if ( 34 <= (*p) && (*p) <= 35 )
625
- goto st1;
626
- } else if ( (*p) >= 0 )
627
- goto st1;
676
+ if ( 0 <= (*p) && (*p) <= 31 )
677
+ goto st0;
628
678
  goto st31;
629
- tr41:
630
- #line 43 "ext/http11/http11_parser.rl"
631
- {MARK(query_start, p); }
632
- goto st32;
633
679
  st32:
634
680
  if ( ++p == pe )
635
681
  goto _out32;
636
682
  case 32:
637
- #line 638 "ext/http11/http11_parser.c"
638
683
  if ( (*p) < 65 ) {
639
684
  if ( 48 <= (*p) && (*p) <= 57 )
640
685
  goto st33;
@@ -643,7 +688,7 @@ case 32:
643
688
  goto st33;
644
689
  } else
645
690
  goto st33;
646
- goto st1;
691
+ goto st0;
647
692
  st33:
648
693
  if ( ++p == pe )
649
694
  goto _out33;
@@ -656,85 +701,89 @@ case 33:
656
701
  goto st31;
657
702
  } else
658
703
  goto st31;
659
- goto st1;
704
+ goto st0;
705
+ tr44:
706
+ #line 60 "http11_parser.rl"
707
+ {
708
+ if(parser->request_path != NULL)
709
+ parser->request_path(parser->data, PTR_TO(mark), LEN(mark,p));
710
+ }
711
+ goto st34;
660
712
  st34:
661
713
  if ( ++p == pe )
662
714
  goto _out34;
663
715
  case 34:
716
+ #line 717 "http11_parser.c"
664
717
  switch( (*p) ) {
665
- case 32: goto tr17;
666
- case 36: goto st35;
667
- case 95: goto st35;
718
+ case 32: goto tr51;
719
+ case 34: goto st0;
720
+ case 35: goto tr52;
721
+ case 37: goto tr53;
722
+ case 60: goto st0;
723
+ case 62: goto st0;
724
+ case 127: goto st0;
668
725
  }
669
- if ( (*p) < 48 ) {
670
- if ( 45 <= (*p) && (*p) <= 46 )
671
- goto st35;
672
- } else if ( (*p) > 57 ) {
673
- if ( 65 <= (*p) && (*p) <= 90 )
674
- goto st35;
675
- } else
676
- goto st35;
677
- goto st1;
726
+ if ( 0 <= (*p) && (*p) <= 31 )
727
+ goto st0;
728
+ goto tr50;
729
+ tr50:
730
+ #line 49 "http11_parser.rl"
731
+ {MARK(query_start, p); }
732
+ goto st35;
678
733
  st35:
679
734
  if ( ++p == pe )
680
735
  goto _out35;
681
736
  case 35:
737
+ #line 738 "http11_parser.c"
682
738
  switch( (*p) ) {
683
- case 32: goto tr17;
684
- case 36: goto st36;
685
- case 95: goto st36;
739
+ case 32: goto tr55;
740
+ case 34: goto st0;
741
+ case 35: goto tr56;
742
+ case 37: goto st36;
743
+ case 60: goto st0;
744
+ case 62: goto st0;
745
+ case 127: goto st0;
686
746
  }
687
- if ( (*p) < 48 ) {
688
- if ( 45 <= (*p) && (*p) <= 46 )
689
- goto st36;
690
- } else if ( (*p) > 57 ) {
691
- if ( 65 <= (*p) && (*p) <= 90 )
692
- goto st36;
693
- } else
694
- goto st36;
695
- goto st1;
747
+ if ( 0 <= (*p) && (*p) <= 31 )
748
+ goto st0;
749
+ goto st35;
750
+ tr53:
751
+ #line 49 "http11_parser.rl"
752
+ {MARK(query_start, p); }
753
+ goto st36;
696
754
  st36:
697
755
  if ( ++p == pe )
698
756
  goto _out36;
699
757
  case 36:
700
- switch( (*p) ) {
701
- case 32: goto tr17;
702
- case 36: goto st37;
703
- case 95: goto st37;
704
- }
705
- if ( (*p) < 48 ) {
706
- if ( 45 <= (*p) && (*p) <= 46 )
758
+ #line 759 "http11_parser.c"
759
+ if ( (*p) < 65 ) {
760
+ if ( 48 <= (*p) && (*p) <= 57 )
707
761
  goto st37;
708
- } else if ( (*p) > 57 ) {
709
- if ( 65 <= (*p) && (*p) <= 90 )
762
+ } else if ( (*p) > 70 ) {
763
+ if ( 97 <= (*p) && (*p) <= 102 )
710
764
  goto st37;
711
765
  } else
712
766
  goto st37;
713
- goto st1;
767
+ goto st0;
714
768
  st37:
715
769
  if ( ++p == pe )
716
770
  goto _out37;
717
771
  case 37:
718
- switch( (*p) ) {
719
- case 32: goto tr17;
720
- case 36: goto st38;
721
- case 95: goto st38;
722
- }
723
- if ( (*p) < 48 ) {
724
- if ( 45 <= (*p) && (*p) <= 46 )
725
- goto st38;
726
- } else if ( (*p) > 57 ) {
727
- if ( 65 <= (*p) && (*p) <= 90 )
728
- goto st38;
772
+ if ( (*p) < 65 ) {
773
+ if ( 48 <= (*p) && (*p) <= 57 )
774
+ goto st35;
775
+ } else if ( (*p) > 70 ) {
776
+ if ( 97 <= (*p) && (*p) <= 102 )
777
+ goto st35;
729
778
  } else
730
- goto st38;
731
- goto st1;
779
+ goto st35;
780
+ goto st0;
732
781
  st38:
733
782
  if ( ++p == pe )
734
783
  goto _out38;
735
784
  case 38:
736
785
  switch( (*p) ) {
737
- case 32: goto tr17;
786
+ case 32: goto tr2;
738
787
  case 36: goto st39;
739
788
  case 95: goto st39;
740
789
  }
@@ -746,13 +795,13 @@ case 38:
746
795
  goto st39;
747
796
  } else
748
797
  goto st39;
749
- goto st1;
798
+ goto st0;
750
799
  st39:
751
800
  if ( ++p == pe )
752
801
  goto _out39;
753
802
  case 39:
754
803
  switch( (*p) ) {
755
- case 32: goto tr17;
804
+ case 32: goto tr2;
756
805
  case 36: goto st40;
757
806
  case 95: goto st40;
758
807
  }
@@ -764,13 +813,13 @@ case 39:
764
813
  goto st40;
765
814
  } else
766
815
  goto st40;
767
- goto st1;
816
+ goto st0;
768
817
  st40:
769
818
  if ( ++p == pe )
770
819
  goto _out40;
771
820
  case 40:
772
821
  switch( (*p) ) {
773
- case 32: goto tr17;
822
+ case 32: goto tr2;
774
823
  case 36: goto st41;
775
824
  case 95: goto st41;
776
825
  }
@@ -782,13 +831,13 @@ case 40:
782
831
  goto st41;
783
832
  } else
784
833
  goto st41;
785
- goto st1;
834
+ goto st0;
786
835
  st41:
787
836
  if ( ++p == pe )
788
837
  goto _out41;
789
838
  case 41:
790
839
  switch( (*p) ) {
791
- case 32: goto tr17;
840
+ case 32: goto tr2;
792
841
  case 36: goto st42;
793
842
  case 95: goto st42;
794
843
  }
@@ -800,13 +849,13 @@ case 41:
800
849
  goto st42;
801
850
  } else
802
851
  goto st42;
803
- goto st1;
852
+ goto st0;
804
853
  st42:
805
854
  if ( ++p == pe )
806
855
  goto _out42;
807
856
  case 42:
808
857
  switch( (*p) ) {
809
- case 32: goto tr17;
858
+ case 32: goto tr2;
810
859
  case 36: goto st43;
811
860
  case 95: goto st43;
812
861
  }
@@ -818,13 +867,13 @@ case 42:
818
867
  goto st43;
819
868
  } else
820
869
  goto st43;
821
- goto st1;
870
+ goto st0;
822
871
  st43:
823
872
  if ( ++p == pe )
824
873
  goto _out43;
825
874
  case 43:
826
875
  switch( (*p) ) {
827
- case 32: goto tr17;
876
+ case 32: goto tr2;
828
877
  case 36: goto st44;
829
878
  case 95: goto st44;
830
879
  }
@@ -836,13 +885,13 @@ case 43:
836
885
  goto st44;
837
886
  } else
838
887
  goto st44;
839
- goto st1;
888
+ goto st0;
840
889
  st44:
841
890
  if ( ++p == pe )
842
891
  goto _out44;
843
892
  case 44:
844
893
  switch( (*p) ) {
845
- case 32: goto tr17;
894
+ case 32: goto tr2;
846
895
  case 36: goto st45;
847
896
  case 95: goto st45;
848
897
  }
@@ -854,13 +903,13 @@ case 44:
854
903
  goto st45;
855
904
  } else
856
905
  goto st45;
857
- goto st1;
906
+ goto st0;
858
907
  st45:
859
908
  if ( ++p == pe )
860
909
  goto _out45;
861
910
  case 45:
862
911
  switch( (*p) ) {
863
- case 32: goto tr17;
912
+ case 32: goto tr2;
864
913
  case 36: goto st46;
865
914
  case 95: goto st46;
866
915
  }
@@ -872,13 +921,13 @@ case 45:
872
921
  goto st46;
873
922
  } else
874
923
  goto st46;
875
- goto st1;
924
+ goto st0;
876
925
  st46:
877
926
  if ( ++p == pe )
878
927
  goto _out46;
879
928
  case 46:
880
929
  switch( (*p) ) {
881
- case 32: goto tr17;
930
+ case 32: goto tr2;
882
931
  case 36: goto st47;
883
932
  case 95: goto st47;
884
933
  }
@@ -890,13 +939,13 @@ case 46:
890
939
  goto st47;
891
940
  } else
892
941
  goto st47;
893
- goto st1;
942
+ goto st0;
894
943
  st47:
895
944
  if ( ++p == pe )
896
945
  goto _out47;
897
946
  case 47:
898
947
  switch( (*p) ) {
899
- case 32: goto tr17;
948
+ case 32: goto tr2;
900
949
  case 36: goto st48;
901
950
  case 95: goto st48;
902
951
  }
@@ -908,13 +957,13 @@ case 47:
908
957
  goto st48;
909
958
  } else
910
959
  goto st48;
911
- goto st1;
960
+ goto st0;
912
961
  st48:
913
962
  if ( ++p == pe )
914
963
  goto _out48;
915
964
  case 48:
916
965
  switch( (*p) ) {
917
- case 32: goto tr17;
966
+ case 32: goto tr2;
918
967
  case 36: goto st49;
919
968
  case 95: goto st49;
920
969
  }
@@ -926,13 +975,13 @@ case 48:
926
975
  goto st49;
927
976
  } else
928
977
  goto st49;
929
- goto st1;
978
+ goto st0;
930
979
  st49:
931
980
  if ( ++p == pe )
932
981
  goto _out49;
933
982
  case 49:
934
983
  switch( (*p) ) {
935
- case 32: goto tr17;
984
+ case 32: goto tr2;
936
985
  case 36: goto st50;
937
986
  case 95: goto st50;
938
987
  }
@@ -944,13 +993,13 @@ case 49:
944
993
  goto st50;
945
994
  } else
946
995
  goto st50;
947
- goto st1;
996
+ goto st0;
948
997
  st50:
949
998
  if ( ++p == pe )
950
999
  goto _out50;
951
1000
  case 50:
952
1001
  switch( (*p) ) {
953
- case 32: goto tr17;
1002
+ case 32: goto tr2;
954
1003
  case 36: goto st51;
955
1004
  case 95: goto st51;
956
1005
  }
@@ -962,13 +1011,13 @@ case 50:
962
1011
  goto st51;
963
1012
  } else
964
1013
  goto st51;
965
- goto st1;
1014
+ goto st0;
966
1015
  st51:
967
1016
  if ( ++p == pe )
968
1017
  goto _out51;
969
1018
  case 51:
970
1019
  switch( (*p) ) {
971
- case 32: goto tr17;
1020
+ case 32: goto tr2;
972
1021
  case 36: goto st52;
973
1022
  case 95: goto st52;
974
1023
  }
@@ -980,16 +1029,88 @@ case 51:
980
1029
  goto st52;
981
1030
  } else
982
1031
  goto st52;
983
- goto st1;
1032
+ goto st0;
984
1033
  st52:
985
1034
  if ( ++p == pe )
986
1035
  goto _out52;
987
1036
  case 52:
1037
+ switch( (*p) ) {
1038
+ case 32: goto tr2;
1039
+ case 36: goto st53;
1040
+ case 95: goto st53;
1041
+ }
1042
+ if ( (*p) < 48 ) {
1043
+ if ( 45 <= (*p) && (*p) <= 46 )
1044
+ goto st53;
1045
+ } else if ( (*p) > 57 ) {
1046
+ if ( 65 <= (*p) && (*p) <= 90 )
1047
+ goto st53;
1048
+ } else
1049
+ goto st53;
1050
+ goto st0;
1051
+ st53:
1052
+ if ( ++p == pe )
1053
+ goto _out53;
1054
+ case 53:
1055
+ switch( (*p) ) {
1056
+ case 32: goto tr2;
1057
+ case 36: goto st54;
1058
+ case 95: goto st54;
1059
+ }
1060
+ if ( (*p) < 48 ) {
1061
+ if ( 45 <= (*p) && (*p) <= 46 )
1062
+ goto st54;
1063
+ } else if ( (*p) > 57 ) {
1064
+ if ( 65 <= (*p) && (*p) <= 90 )
1065
+ goto st54;
1066
+ } else
1067
+ goto st54;
1068
+ goto st0;
1069
+ st54:
1070
+ if ( ++p == pe )
1071
+ goto _out54;
1072
+ case 54:
1073
+ switch( (*p) ) {
1074
+ case 32: goto tr2;
1075
+ case 36: goto st55;
1076
+ case 95: goto st55;
1077
+ }
1078
+ if ( (*p) < 48 ) {
1079
+ if ( 45 <= (*p) && (*p) <= 46 )
1080
+ goto st55;
1081
+ } else if ( (*p) > 57 ) {
1082
+ if ( 65 <= (*p) && (*p) <= 90 )
1083
+ goto st55;
1084
+ } else
1085
+ goto st55;
1086
+ goto st0;
1087
+ st55:
1088
+ if ( ++p == pe )
1089
+ goto _out55;
1090
+ case 55:
1091
+ switch( (*p) ) {
1092
+ case 32: goto tr2;
1093
+ case 36: goto st56;
1094
+ case 95: goto st56;
1095
+ }
1096
+ if ( (*p) < 48 ) {
1097
+ if ( 45 <= (*p) && (*p) <= 46 )
1098
+ goto st56;
1099
+ } else if ( (*p) > 57 ) {
1100
+ if ( 65 <= (*p) && (*p) <= 90 )
1101
+ goto st56;
1102
+ } else
1103
+ goto st56;
1104
+ goto st0;
1105
+ st56:
1106
+ if ( ++p == pe )
1107
+ goto _out56;
1108
+ case 56:
988
1109
  if ( (*p) == 32 )
989
- goto tr17;
990
- goto st1;
1110
+ goto tr2;
1111
+ goto st0;
991
1112
  }
992
- _out1: cs = 1; goto _out;
1113
+ _out0: cs = 0; goto _out;
993
1114
  _out2: cs = 2; goto _out;
994
1115
  _out3: cs = 3; goto _out;
995
1116
  _out4: cs = 4; goto _out;
@@ -1005,7 +1126,7 @@ case 52:
1005
1126
  _out14: cs = 14; goto _out;
1006
1127
  _out15: cs = 15; goto _out;
1007
1128
  _out16: cs = 16; goto _out;
1008
- _out53: cs = 53; goto _out;
1129
+ _out57: cs = 57; goto _out;
1009
1130
  _out17: cs = 17; goto _out;
1010
1131
  _out18: cs = 18; goto _out;
1011
1132
  _out19: cs = 19; goto _out;
@@ -1042,10 +1163,14 @@ case 52:
1042
1163
  _out50: cs = 50; goto _out;
1043
1164
  _out51: cs = 51; goto _out;
1044
1165
  _out52: cs = 52; goto _out;
1166
+ _out53: cs = 53; goto _out;
1167
+ _out54: cs = 54; goto _out;
1168
+ _out55: cs = 55; goto _out;
1169
+ _out56: cs = 56; goto _out;
1045
1170
 
1046
1171
  _out: {}
1047
1172
  }
1048
- #line 149 "ext/http11/http11_parser.rl"
1173
+ #line 109 "http11_parser.rl"
1049
1174
 
1050
1175
  parser->cs = cs;
1051
1176
  parser->nread += p - (buffer + off);
@@ -1060,8 +1185,8 @@ case 52:
1060
1185
  if(parser->body_start) {
1061
1186
  /* final \r\n combo encountered so stop right here */
1062
1187
 
1063
- #line 1064 "ext/http11/http11_parser.c"
1064
- #line 163 "ext/http11/http11_parser.rl"
1188
+ #line 1189 "http11_parser.c"
1189
+ #line 123 "http11_parser.rl"
1065
1190
  parser->nread++;
1066
1191
  }
1067
1192
 
@@ -1073,8 +1198,8 @@ int http_parser_finish(http_parser *parser)
1073
1198
  int cs = parser->cs;
1074
1199
 
1075
1200
 
1076
- #line 1077 "ext/http11/http11_parser.c"
1077
- #line 174 "ext/http11/http11_parser.rl"
1201
+ #line 1202 "http11_parser.c"
1202
+ #line 134 "http11_parser.rl"
1078
1203
 
1079
1204
  parser->cs = cs;
1080
1205