passenger 3.0.7 → 3.0.8

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (439) hide show
  1. data/NEWS +27 -0
  2. data/README +1 -1
  3. data/bin/passenger-install-nginx-module +3 -1
  4. data/build/config.rb +2 -1
  5. data/build/cxx_tests.rb +7 -3
  6. data/build/documentation.rb +5 -40
  7. data/build/nginx.rb +0 -1
  8. data/build/packaging.rb +0 -6
  9. data/build/rake_extensions.rb +5 -0
  10. data/doc/Architectural overview.html +344 -77
  11. data/doc/Security of user switching support.html +338 -71
  12. data/doc/Users guide Apache with comments.html +4830 -0
  13. data/doc/Users guide Apache.html +695 -428
  14. data/doc/Users guide Apache.idmap.txt +80 -0
  15. data/doc/Users guide Apache.txt +5 -5
  16. data/doc/Users guide Nginx.html +591 -313
  17. data/doc/Users guide Nginx.txt +9 -3
  18. data/doc/Users guide Standalone.html +344 -77
  19. data/ext/boost/src/pthread/thread.cpp +1 -1
  20. data/ext/common/AccountsDatabase.h +1 -1
  21. data/ext/common/Constants.h +2 -2
  22. data/ext/common/Logging.h +2 -1
  23. data/ext/common/LoggingAgent/FilterSupport.h +107 -3
  24. data/ext/common/Session.h +1 -1
  25. data/ext/common/Utils.cpp +2 -0
  26. data/ext/common/Utils/Dechunker.h +232 -0
  27. data/ext/common/Utils/HttpHeaderBufferer.h +165 -0
  28. data/ext/common/Utils/StrIntUtils.cpp +51 -15
  29. data/ext/common/Utils/StrIntUtils.h +3 -0
  30. data/ext/common/Utils/StreamBoyerMooreHorspool.h +506 -0
  31. data/ext/nginx/Configuration.c +36 -282
  32. data/ext/nginx/ContentHandler.c +17 -0
  33. data/ext/nginx/HelperAgent.cpp +397 -39
  34. data/ext/oxt/tracable_exception.cpp +3 -1
  35. data/ext/ruby/extconf.rb +1 -0
  36. data/ext/ruby/passenger_native_support.c +3 -0
  37. data/helper-scripts/prespawn +113 -31
  38. data/lib/phusion_passenger.rb +2 -2
  39. data/lib/phusion_passenger/standalone/runtime_installer.rb +3 -2
  40. data/lib/phusion_passenger/standalone/start_command.rb +12 -12
  41. data/test/cxx/DechunkerTest.cpp +216 -0
  42. data/test/cxx/FilterSupportTest.cpp +31 -4
  43. data/test/cxx/HttpHeaderBuffererTest.cpp +203 -0
  44. data/test/cxx/UtilsTest.cpp +46 -3
  45. data/test/integration_tests/hello_world_rack_spec.rb +7 -0
  46. data/test/stub/rack/config.ru +6 -1
  47. data/test/stub/rails_apps/1.2/empty/public/dispatch.cgi +1 -1
  48. data/test/stub/rails_apps/1.2/empty/public/dispatch.fcgi +1 -1
  49. data/test/stub/rails_apps/1.2/empty/public/dispatch.rb +1 -1
  50. data/test/stub/rails_apps/2.0/empty/public/dispatch.cgi +1 -1
  51. data/test/stub/rails_apps/2.0/empty/public/dispatch.fcgi +1 -1
  52. data/test/stub/rails_apps/2.0/empty/public/dispatch.rb +1 -1
  53. data/test/stub/rails_apps/2.2/empty/public/dispatch.cgi +1 -1
  54. data/test/stub/rails_apps/2.2/empty/public/dispatch.fcgi +1 -1
  55. data/test/stub/rails_apps/2.2/empty/public/dispatch.rb +1 -1
  56. metadata +20 -403
  57. data/doc/Doxyfile +0 -241
  58. data/doc/cxxapi/AbstractSpawnManager_8h_source.html +0 -141
  59. data/doc/cxxapi/Account_8h_source.html +0 -206
  60. data/doc/cxxapi/AccountsDatabase_8h_source.html +0 -161
  61. data/doc/cxxapi/AgentBase_8h_source.html +0 -70
  62. data/doc/cxxapi/AgentsStarter_8h_source.html +0 -112
  63. data/doc/cxxapi/BCrypt_8h_source.html +0 -104
  64. data/doc/cxxapi/Blowfish_8h_source.html +0 -134
  65. data/doc/cxxapi/Bucket_8h_source.html +0 -118
  66. data/doc/cxxapi/Constants_8h_source.html +0 -79
  67. data/doc/cxxapi/ContentHandler_8h_source.html +0 -95
  68. data/doc/cxxapi/DirectoryMapper_8h_source.html +0 -311
  69. data/doc/cxxapi/EventedClient_8h_source.html +0 -733
  70. data/doc/cxxapi/EventedMessageServer_8h_source.html +0 -358
  71. data/doc/cxxapi/EventedServer_8h_source.html +0 -326
  72. data/doc/cxxapi/Exceptions_8h_source.html +0 -393
  73. data/doc/cxxapi/FileDescriptor_8h_source.html +0 -324
  74. data/doc/cxxapi/Hooks_8h_source.html +0 -76
  75. data/doc/cxxapi/HttpStatusExtractor_8h_source.html +0 -382
  76. data/doc/cxxapi/IniFile_8h_source.html +0 -527
  77. data/doc/cxxapi/Logging_8h_source.html +0 -796
  78. data/doc/cxxapi/MessageChannel_8h_source.html +0 -776
  79. data/doc/cxxapi/MessageClient_8h_source.html +0 -328
  80. data/doc/cxxapi/MessageReadersWriters_8h_source.html +0 -539
  81. data/doc/cxxapi/MessageServer_8h_source.html +0 -612
  82. data/doc/cxxapi/PoolOptions_8h_source.html +0 -549
  83. data/doc/cxxapi/Process_8h_source.html +0 -286
  84. data/doc/cxxapi/RandomGenerator_8h_source.html +0 -191
  85. data/doc/cxxapi/ResourceLocator_8h_source.html +0 -166
  86. data/doc/cxxapi/SafeLibev_8h_source.html +0 -180
  87. data/doc/cxxapi/ScgiRequestParser_8h_source.html +0 -406
  88. data/doc/cxxapi/ServerInstanceDir_8h_source.html +0 -378
  89. data/doc/cxxapi/Session_8h_source.html +0 -501
  90. data/doc/cxxapi/SpawnManager_8h_source.html +0 -647
  91. data/doc/cxxapi/StaticContentHandler_8h_source.html +0 -69
  92. data/doc/cxxapi/StaticString_8h_source.html +0 -329
  93. data/doc/cxxapi/StringListCreator_8h_source.html +0 -114
  94. data/doc/cxxapi/Utils_8h_source.html +0 -469
  95. data/doc/cxxapi/annotated.html +0 -87
  96. data/doc/cxxapi/apache2_2Configuration_8h_source.html +0 -82
  97. data/doc/cxxapi/classAgentWatcher-members.html +0 -54
  98. data/doc/cxxapi/classAgentWatcher.html +0 -419
  99. data/doc/cxxapi/classClient-members.html +0 -38
  100. data/doc/cxxapi/classClient.html +0 -123
  101. data/doc/cxxapi/classHooks-members.html +0 -40
  102. data/doc/cxxapi/classHooks.html +0 -153
  103. data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager-members.html +0 -40
  104. data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager.html +0 -187
  105. data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager__inherit__graph.map +0 -3
  106. data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager__inherit__graph.md5 +0 -1
  107. data/doc/cxxapi/classPassenger_1_1AbstractSpawnManager__inherit__graph.png +0 -0
  108. data/doc/cxxapi/classPassenger_1_1ArgumentException-members.html +0 -36
  109. data/doc/cxxapi/classPassenger_1_1ArgumentException.html +0 -56
  110. data/doc/cxxapi/classPassenger_1_1ArrayMessage-members.html +0 -37
  111. data/doc/cxxapi/classPassenger_1_1ArrayMessage.html +0 -113
  112. data/doc/cxxapi/classPassenger_1_1BufferedUpload-members.html +0 -38
  113. data/doc/cxxapi/classPassenger_1_1BufferedUpload.html +0 -112
  114. data/doc/cxxapi/classPassenger_1_1BusyException-members.html +0 -36
  115. data/doc/cxxapi/classPassenger_1_1BusyException.html +0 -54
  116. data/doc/cxxapi/classPassenger_1_1ConfigurationException-members.html +0 -36
  117. data/doc/cxxapi/classPassenger_1_1ConfigurationException.html +0 -51
  118. data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +0 -41
  119. data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +0 -223
  120. data/doc/cxxapi/classPassenger_1_1EOFException-members.html +0 -36
  121. data/doc/cxxapi/classPassenger_1_1EOFException.html +0 -61
  122. data/doc/cxxapi/classPassenger_1_1EOFException__inherit__graph.map +0 -3
  123. data/doc/cxxapi/classPassenger_1_1EOFException__inherit__graph.md5 +0 -1
  124. data/doc/cxxapi/classPassenger_1_1EOFException__inherit__graph.png +0 -0
  125. data/doc/cxxapi/classPassenger_1_1EventFd-members.html +0 -36
  126. data/doc/cxxapi/classPassenger_1_1EventFd.html +0 -52
  127. data/doc/cxxapi/classPassenger_1_1EventedClient-members.html +0 -59
  128. data/doc/cxxapi/classPassenger_1_1EventedClient.html +0 -531
  129. data/doc/cxxapi/classPassenger_1_1EventedMessageServer-members.html +0 -37
  130. data/doc/cxxapi/classPassenger_1_1EventedMessageServer.html +0 -59
  131. data/doc/cxxapi/classPassenger_1_1EventedMessageServer__inherit__graph.map +0 -3
  132. data/doc/cxxapi/classPassenger_1_1EventedMessageServer__inherit__graph.md5 +0 -1
  133. data/doc/cxxapi/classPassenger_1_1EventedMessageServer__inherit__graph.png +0 -0
  134. data/doc/cxxapi/classPassenger_1_1EventedServer-members.html +0 -37
  135. data/doc/cxxapi/classPassenger_1_1EventedServer.html +0 -93
  136. data/doc/cxxapi/classPassenger_1_1EventedServer__inherit__graph.map +0 -3
  137. data/doc/cxxapi/classPassenger_1_1EventedServer__inherit__graph.md5 +0 -1
  138. data/doc/cxxapi/classPassenger_1_1EventedServer__inherit__graph.png +0 -0
  139. data/doc/cxxapi/classPassenger_1_1FileDescriptor-members.html +0 -41
  140. data/doc/cxxapi/classPassenger_1_1FileDescriptor.html +0 -178
  141. data/doc/cxxapi/classPassenger_1_1FileDescriptorPair-members.html +0 -36
  142. data/doc/cxxapi/classPassenger_1_1FileDescriptorPair.html +0 -52
  143. data/doc/cxxapi/classPassenger_1_1FileNotFoundException-members.html +0 -36
  144. data/doc/cxxapi/classPassenger_1_1FileNotFoundException.html +0 -58
  145. data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.map +0 -3
  146. data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.md5 +0 -1
  147. data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.png +0 -0
  148. data/doc/cxxapi/classPassenger_1_1FileSystemException-members.html +0 -41
  149. data/doc/cxxapi/classPassenger_1_1FileSystemException.html +0 -66
  150. data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.map +0 -3
  151. data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.md5 +0 -1
  152. data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.png +0 -0
  153. data/doc/cxxapi/classPassenger_1_1HttpStatusExtractor-members.html +0 -39
  154. data/doc/cxxapi/classPassenger_1_1HttpStatusExtractor.html +0 -128
  155. data/doc/cxxapi/classPassenger_1_1IOException-members.html +0 -36
  156. data/doc/cxxapi/classPassenger_1_1IOException.html +0 -61
  157. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.map +0 -4
  158. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.md5 +0 -1
  159. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.png +0 -0
  160. data/doc/cxxapi/classPassenger_1_1MessageChannel-members.html +0 -57
  161. data/doc/cxxapi/classPassenger_1_1MessageChannel.html +0 -839
  162. data/doc/cxxapi/classPassenger_1_1MessageServer-members.html +0 -49
  163. data/doc/cxxapi/classPassenger_1_1MessageServer.html +0 -407
  164. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext-members.html +0 -36
  165. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext.html +0 -58
  166. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext__inherit__graph.map +0 -3
  167. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext__inherit__graph.md5 +0 -1
  168. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1ClientContext__inherit__graph.png +0 -0
  169. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext-members.html +0 -41
  170. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext.html +0 -165
  171. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext__inherit__graph.map +0 -3
  172. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext__inherit__graph.md5 +0 -1
  173. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1CommonClientContext__inherit__graph.png +0 -0
  174. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1Handler-members.html +0 -39
  175. data/doc/cxxapi/classPassenger_1_1MessageServer_1_1Handler.html +0 -173
  176. data/doc/cxxapi/classPassenger_1_1Process-members.html +0 -44
  177. data/doc/cxxapi/classPassenger_1_1Process.html +0 -290
  178. data/doc/cxxapi/classPassenger_1_1RandomGenerator-members.html +0 -37
  179. data/doc/cxxapi/classPassenger_1_1RandomGenerator.html +0 -79
  180. data/doc/cxxapi/classPassenger_1_1ResourceLocator-members.html +0 -36
  181. data/doc/cxxapi/classPassenger_1_1ResourceLocator.html +0 -51
  182. data/doc/cxxapi/classPassenger_1_1RuntimeException-members.html +0 -36
  183. data/doc/cxxapi/classPassenger_1_1RuntimeException.html +0 -54
  184. data/doc/cxxapi/classPassenger_1_1SafeLibev-members.html +0 -36
  185. data/doc/cxxapi/classPassenger_1_1SafeLibev.html +0 -51
  186. data/doc/cxxapi/classPassenger_1_1ScalarMessage-members.html +0 -37
  187. data/doc/cxxapi/classPassenger_1_1ScalarMessage.html +0 -76
  188. data/doc/cxxapi/classPassenger_1_1ScgiRequestParser-members.html +0 -50
  189. data/doc/cxxapi/classPassenger_1_1ScgiRequestParser.html +0 -285
  190. data/doc/cxxapi/classPassenger_1_1SecurityException-members.html +0 -36
  191. data/doc/cxxapi/classPassenger_1_1SecurityException.html +0 -56
  192. data/doc/cxxapi/classPassenger_1_1Session-members.html +0 -53
  193. data/doc/cxxapi/classPassenger_1_1Session.html +0 -556
  194. data/doc/cxxapi/classPassenger_1_1Session__inherit__graph.map +0 -3
  195. data/doc/cxxapi/classPassenger_1_1Session__inherit__graph.md5 +0 -1
  196. data/doc/cxxapi/classPassenger_1_1Session__inherit__graph.png +0 -0
  197. data/doc/cxxapi/classPassenger_1_1SpawnException-members.html +0 -39
  198. data/doc/cxxapi/classPassenger_1_1SpawnException.html +0 -101
  199. data/doc/cxxapi/classPassenger_1_1SpawnManager-members.html +0 -42
  200. data/doc/cxxapi/classPassenger_1_1SpawnManager.html +0 -292
  201. data/doc/cxxapi/classPassenger_1_1SpawnManager__inherit__graph.map +0 -3
  202. data/doc/cxxapi/classPassenger_1_1SpawnManager__inherit__graph.md5 +0 -1
  203. data/doc/cxxapi/classPassenger_1_1SpawnManager__inherit__graph.png +0 -0
  204. data/doc/cxxapi/classPassenger_1_1StandardSession-members.html +0 -54
  205. data/doc/cxxapi/classPassenger_1_1StandardSession.html +0 -394
  206. data/doc/cxxapi/classPassenger_1_1StandardSession__inherit__graph.map +0 -3
  207. data/doc/cxxapi/classPassenger_1_1StandardSession__inherit__graph.md5 +0 -1
  208. data/doc/cxxapi/classPassenger_1_1StandardSession__inherit__graph.png +0 -0
  209. data/doc/cxxapi/classPassenger_1_1StaticString-members.html +0 -36
  210. data/doc/cxxapi/classPassenger_1_1StaticString.html +0 -56
  211. data/doc/cxxapi/classPassenger_1_1SyntaxError-members.html +0 -36
  212. data/doc/cxxapi/classPassenger_1_1SyntaxError.html +0 -54
  213. data/doc/cxxapi/classPassenger_1_1SystemException-members.html +0 -40
  214. data/doc/cxxapi/classPassenger_1_1SystemException.html +0 -155
  215. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.map +0 -4
  216. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.md5 +0 -1
  217. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.png +0 -0
  218. data/doc/cxxapi/classPassenger_1_1TimeRetrievalException-members.html +0 -40
  219. data/doc/cxxapi/classPassenger_1_1TimeRetrievalException.html +0 -61
  220. data/doc/cxxapi/classPassenger_1_1TimeRetrievalException__inherit__graph.map +0 -3
  221. data/doc/cxxapi/classPassenger_1_1TimeRetrievalException__inherit__graph.md5 +0 -1
  222. data/doc/cxxapi/classPassenger_1_1TimeRetrievalException__inherit__graph.png +0 -0
  223. data/doc/cxxapi/classPassenger_1_1TimeoutException-members.html +0 -36
  224. data/doc/cxxapi/classPassenger_1_1TimeoutException.html +0 -54
  225. data/doc/cxxapi/classPassenger_1_1Uint16Message-members.html +0 -36
  226. data/doc/cxxapi/classPassenger_1_1Uint16Message.html +0 -51
  227. data/doc/cxxapi/classPassenger_1_1Uint32Message-members.html +0 -36
  228. data/doc/cxxapi/classPassenger_1_1Uint32Message.html +0 -51
  229. data/doc/cxxapi/classServer-members.html +0 -36
  230. data/doc/cxxapi/classServer.html +0 -49
  231. data/doc/cxxapi/classServerInstanceDirToucher-members.html +0 -36
  232. data/doc/cxxapi/classServerInstanceDirToucher.html +0 -47
  233. data/doc/cxxapi/classes.html +0 -52
  234. data/doc/cxxapi/definitions_8h_source.html +0 -36
  235. data/doc/cxxapi/doxygen.css +0 -532
  236. data/doc/cxxapi/doxygen.png +0 -0
  237. data/doc/cxxapi/files.html +0 -76
  238. data/doc/cxxapi/ftv2blank.png +0 -0
  239. data/doc/cxxapi/ftv2doc.png +0 -0
  240. data/doc/cxxapi/ftv2folderclosed.png +0 -0
  241. data/doc/cxxapi/ftv2folderopen.png +0 -0
  242. data/doc/cxxapi/ftv2lastnode.png +0 -0
  243. data/doc/cxxapi/ftv2link.png +0 -0
  244. data/doc/cxxapi/ftv2mlastnode.png +0 -0
  245. data/doc/cxxapi/ftv2mnode.png +0 -0
  246. data/doc/cxxapi/ftv2node.png +0 -0
  247. data/doc/cxxapi/ftv2plastnode.png +0 -0
  248. data/doc/cxxapi/ftv2pnode.png +0 -0
  249. data/doc/cxxapi/ftv2vertline.png +0 -0
  250. data/doc/cxxapi/functions.html +0 -103
  251. data/doc/cxxapi/functions_0x62.html +0 -82
  252. data/doc/cxxapi/functions_0x63.html +0 -102
  253. data/doc/cxxapi/functions_0x64.html +0 -102
  254. data/doc/cxxapi/functions_0x65.html +0 -88
  255. data/doc/cxxapi/functions_0x66.html +0 -100
  256. data/doc/cxxapi/functions_0x67.html +0 -167
  257. data/doc/cxxapi/functions_0x68.html +0 -88
  258. data/doc/cxxapi/functions_0x69.html +0 -96
  259. data/doc/cxxapi/functions_0x6b.html +0 -80
  260. data/doc/cxxapi/functions_0x6c.html +0 -88
  261. data/doc/cxxapi/functions_0x6d.html +0 -88
  262. data/doc/cxxapi/functions_0x6e.html +0 -86
  263. data/doc/cxxapi/functions_0x6f.html +0 -94
  264. data/doc/cxxapi/functions_0x70.html +0 -94
  265. data/doc/cxxapi/functions_0x72.html +0 -110
  266. data/doc/cxxapi/functions_0x73.html +0 -171
  267. data/doc/cxxapi/functions_0x74.html +0 -85
  268. data/doc/cxxapi/functions_0x75.html +0 -85
  269. data/doc/cxxapi/functions_0x77.html +0 -92
  270. data/doc/cxxapi/functions_0x7e.html +0 -79
  271. data/doc/cxxapi/functions_enum.html +0 -49
  272. data/doc/cxxapi/functions_eval.html +0 -67
  273. data/doc/cxxapi/functions_func.html +0 -531
  274. data/doc/cxxapi/functions_vars.html +0 -278
  275. data/doc/cxxapi/graph_legend.dot +0 -22
  276. data/doc/cxxapi/graph_legend.html +0 -92
  277. data/doc/cxxapi/graph_legend.png +0 -0
  278. data/doc/cxxapi/group__Core.html +0 -46
  279. data/doc/cxxapi/group__Core.map +0 -3
  280. data/doc/cxxapi/group__Core.png +0 -0
  281. data/doc/cxxapi/group__Exceptions.html +0 -53
  282. data/doc/cxxapi/group__Hooks.html +0 -42
  283. data/doc/cxxapi/group__Hooks.map +0 -3
  284. data/doc/cxxapi/group__Hooks.png +0 -0
  285. data/doc/cxxapi/group__Support.html +0 -538
  286. data/doc/cxxapi/hierarchy.html +0 -101
  287. data/doc/cxxapi/index.html +0 -16
  288. data/doc/cxxapi/inherit__graph__0.map +0 -3
  289. data/doc/cxxapi/inherit__graph__0.md5 +0 -1
  290. data/doc/cxxapi/inherit__graph__0.png +0 -0
  291. data/doc/cxxapi/inherit__graph__1.map +0 -3
  292. data/doc/cxxapi/inherit__graph__1.md5 +0 -1
  293. data/doc/cxxapi/inherit__graph__1.png +0 -0
  294. data/doc/cxxapi/inherit__graph__10.map +0 -3
  295. data/doc/cxxapi/inherit__graph__10.md5 +0 -1
  296. data/doc/cxxapi/inherit__graph__10.png +0 -0
  297. data/doc/cxxapi/inherit__graph__11.map +0 -4
  298. data/doc/cxxapi/inherit__graph__11.md5 +0 -1
  299. data/doc/cxxapi/inherit__graph__11.png +0 -0
  300. data/doc/cxxapi/inherit__graph__12.map +0 -3
  301. data/doc/cxxapi/inherit__graph__12.md5 +0 -1
  302. data/doc/cxxapi/inherit__graph__12.png +0 -0
  303. data/doc/cxxapi/inherit__graph__13.map +0 -3
  304. data/doc/cxxapi/inherit__graph__13.md5 +0 -1
  305. data/doc/cxxapi/inherit__graph__13.png +0 -0
  306. data/doc/cxxapi/inherit__graph__14.map +0 -3
  307. data/doc/cxxapi/inherit__graph__14.md5 +0 -1
  308. data/doc/cxxapi/inherit__graph__14.png +0 -0
  309. data/doc/cxxapi/inherit__graph__15.map +0 -3
  310. data/doc/cxxapi/inherit__graph__15.md5 +0 -1
  311. data/doc/cxxapi/inherit__graph__15.png +0 -0
  312. data/doc/cxxapi/inherit__graph__16.map +0 -5
  313. data/doc/cxxapi/inherit__graph__16.md5 +0 -1
  314. data/doc/cxxapi/inherit__graph__16.png +0 -0
  315. data/doc/cxxapi/inherit__graph__17.map +0 -3
  316. data/doc/cxxapi/inherit__graph__17.md5 +0 -1
  317. data/doc/cxxapi/inherit__graph__17.png +0 -0
  318. data/doc/cxxapi/inherit__graph__18.map +0 -3
  319. data/doc/cxxapi/inherit__graph__18.md5 +0 -1
  320. data/doc/cxxapi/inherit__graph__18.png +0 -0
  321. data/doc/cxxapi/inherit__graph__19.map +0 -4
  322. data/doc/cxxapi/inherit__graph__19.md5 +0 -1
  323. data/doc/cxxapi/inherit__graph__19.png +0 -0
  324. data/doc/cxxapi/inherit__graph__2.map +0 -3
  325. data/doc/cxxapi/inherit__graph__2.md5 +0 -1
  326. data/doc/cxxapi/inherit__graph__2.png +0 -0
  327. data/doc/cxxapi/inherit__graph__20.map +0 -3
  328. data/doc/cxxapi/inherit__graph__20.md5 +0 -1
  329. data/doc/cxxapi/inherit__graph__20.png +0 -0
  330. data/doc/cxxapi/inherit__graph__21.map +0 -3
  331. data/doc/cxxapi/inherit__graph__21.md5 +0 -1
  332. data/doc/cxxapi/inherit__graph__21.png +0 -0
  333. data/doc/cxxapi/inherit__graph__22.map +0 -3
  334. data/doc/cxxapi/inherit__graph__22.md5 +0 -1
  335. data/doc/cxxapi/inherit__graph__22.png +0 -0
  336. data/doc/cxxapi/inherit__graph__23.map +0 -3
  337. data/doc/cxxapi/inherit__graph__23.md5 +0 -1
  338. data/doc/cxxapi/inherit__graph__23.png +0 -0
  339. data/doc/cxxapi/inherit__graph__24.map +0 -3
  340. data/doc/cxxapi/inherit__graph__24.md5 +0 -1
  341. data/doc/cxxapi/inherit__graph__24.png +0 -0
  342. data/doc/cxxapi/inherit__graph__25.map +0 -3
  343. data/doc/cxxapi/inherit__graph__25.md5 +0 -1
  344. data/doc/cxxapi/inherit__graph__25.png +0 -0
  345. data/doc/cxxapi/inherit__graph__26.map +0 -3
  346. data/doc/cxxapi/inherit__graph__26.md5 +0 -1
  347. data/doc/cxxapi/inherit__graph__26.png +0 -0
  348. data/doc/cxxapi/inherit__graph__27.map +0 -3
  349. data/doc/cxxapi/inherit__graph__27.md5 +0 -1
  350. data/doc/cxxapi/inherit__graph__27.png +0 -0
  351. data/doc/cxxapi/inherit__graph__28.map +0 -3
  352. data/doc/cxxapi/inherit__graph__28.md5 +0 -1
  353. data/doc/cxxapi/inherit__graph__28.png +0 -0
  354. data/doc/cxxapi/inherit__graph__29.map +0 -3
  355. data/doc/cxxapi/inherit__graph__29.md5 +0 -1
  356. data/doc/cxxapi/inherit__graph__29.png +0 -0
  357. data/doc/cxxapi/inherit__graph__3.map +0 -4
  358. data/doc/cxxapi/inherit__graph__3.md5 +0 -1
  359. data/doc/cxxapi/inherit__graph__3.png +0 -0
  360. data/doc/cxxapi/inherit__graph__30.map +0 -3
  361. data/doc/cxxapi/inherit__graph__30.md5 +0 -1
  362. data/doc/cxxapi/inherit__graph__30.png +0 -0
  363. data/doc/cxxapi/inherit__graph__31.map +0 -4
  364. data/doc/cxxapi/inherit__graph__31.md5 +0 -1
  365. data/doc/cxxapi/inherit__graph__31.png +0 -0
  366. data/doc/cxxapi/inherit__graph__32.map +0 -3
  367. data/doc/cxxapi/inherit__graph__32.md5 +0 -1
  368. data/doc/cxxapi/inherit__graph__32.png +0 -0
  369. data/doc/cxxapi/inherit__graph__33.map +0 -3
  370. data/doc/cxxapi/inherit__graph__33.md5 +0 -1
  371. data/doc/cxxapi/inherit__graph__33.png +0 -0
  372. data/doc/cxxapi/inherit__graph__34.map +0 -3
  373. data/doc/cxxapi/inherit__graph__34.md5 +0 -1
  374. data/doc/cxxapi/inherit__graph__34.png +0 -0
  375. data/doc/cxxapi/inherit__graph__35.map +0 -3
  376. data/doc/cxxapi/inherit__graph__35.md5 +0 -1
  377. data/doc/cxxapi/inherit__graph__35.png +0 -0
  378. data/doc/cxxapi/inherit__graph__36.map +0 -5
  379. data/doc/cxxapi/inherit__graph__36.md5 +0 -1
  380. data/doc/cxxapi/inherit__graph__36.png +0 -0
  381. data/doc/cxxapi/inherit__graph__37.map +0 -3
  382. data/doc/cxxapi/inherit__graph__37.md5 +0 -1
  383. data/doc/cxxapi/inherit__graph__37.png +0 -0
  384. data/doc/cxxapi/inherit__graph__38.map +0 -3
  385. data/doc/cxxapi/inherit__graph__38.md5 +0 -1
  386. data/doc/cxxapi/inherit__graph__38.png +0 -0
  387. data/doc/cxxapi/inherit__graph__39.map +0 -3
  388. data/doc/cxxapi/inherit__graph__39.md5 +0 -1
  389. data/doc/cxxapi/inherit__graph__39.png +0 -0
  390. data/doc/cxxapi/inherit__graph__4.map +0 -3
  391. data/doc/cxxapi/inherit__graph__4.md5 +0 -1
  392. data/doc/cxxapi/inherit__graph__4.png +0 -0
  393. data/doc/cxxapi/inherit__graph__40.map +0 -3
  394. data/doc/cxxapi/inherit__graph__40.md5 +0 -1
  395. data/doc/cxxapi/inherit__graph__40.png +0 -0
  396. data/doc/cxxapi/inherit__graph__41.map +0 -3
  397. data/doc/cxxapi/inherit__graph__41.md5 +0 -1
  398. data/doc/cxxapi/inherit__graph__41.png +0 -0
  399. data/doc/cxxapi/inherit__graph__5.map +0 -3
  400. data/doc/cxxapi/inherit__graph__5.md5 +0 -1
  401. data/doc/cxxapi/inherit__graph__5.png +0 -0
  402. data/doc/cxxapi/inherit__graph__6.map +0 -3
  403. data/doc/cxxapi/inherit__graph__6.md5 +0 -1
  404. data/doc/cxxapi/inherit__graph__6.png +0 -0
  405. data/doc/cxxapi/inherit__graph__7.map +0 -3
  406. data/doc/cxxapi/inherit__graph__7.md5 +0 -1
  407. data/doc/cxxapi/inherit__graph__7.png +0 -0
  408. data/doc/cxxapi/inherit__graph__8.map +0 -3
  409. data/doc/cxxapi/inherit__graph__8.md5 +0 -1
  410. data/doc/cxxapi/inherit__graph__8.png +0 -0
  411. data/doc/cxxapi/inherit__graph__9.map +0 -3
  412. data/doc/cxxapi/inherit__graph__9.md5 +0 -1
  413. data/doc/cxxapi/inherit__graph__9.png +0 -0
  414. data/doc/cxxapi/inherits.html +0 -165
  415. data/doc/cxxapi/main.html +0 -28
  416. data/doc/cxxapi/modules.html +0 -36
  417. data/doc/cxxapi/namespacePassenger.html +0 -585
  418. data/doc/cxxapi/namespacemembers.html +0 -190
  419. data/doc/cxxapi/namespacemembers_enum.html +0 -48
  420. data/doc/cxxapi/namespacemembers_eval.html +0 -57
  421. data/doc/cxxapi/namespacemembers_func.html +0 -114
  422. data/doc/cxxapi/namespacemembers_type.html +0 -54
  423. data/doc/cxxapi/namespaces.html +0 -37
  424. data/doc/cxxapi/nginx_2Configuration_8h_source.html +0 -126
  425. data/doc/cxxapi/ngx__http__passenger__module_8h_source.html +0 -95
  426. data/doc/cxxapi/structPassenger_1_1MessageServer_1_1DisconnectEventBroadcastGuard-members.html +0 -36
  427. data/doc/cxxapi/structPassenger_1_1MessageServer_1_1DisconnectEventBroadcastGuard.html +0 -51
  428. data/doc/cxxapi/structPassenger_1_1PoolOptions-members.html +0 -67
  429. data/doc/cxxapi/structPassenger_1_1PoolOptions.html +0 -647
  430. data/doc/cxxapi/structPassenger_1_1StaticString_1_1Hash-members.html +0 -36
  431. data/doc/cxxapi/structPassenger_1_1StaticString_1_1Hash.html +0 -51
  432. data/doc/cxxapi/tab_b.gif +0 -0
  433. data/doc/cxxapi/tab_l.gif +0 -0
  434. data/doc/cxxapi/tab_r.gif +0 -0
  435. data/doc/cxxapi/tabs.css +0 -105
  436. data/doc/cxxapi/tree.html +0 -249
  437. data/doc/template/horo.rb +0 -613
  438. data/ext/libev/config.h +0 -122
  439. data/ext/nginx/HttpStatusExtractor.h +0 -351
@@ -52,7 +52,9 @@ tracable_exception::tracable_exception() {
52
52
  }
53
53
  }
54
54
 
55
- tracable_exception::tracable_exception(const tracable_exception &other) {
55
+ tracable_exception::tracable_exception(const tracable_exception &other)
56
+ : std::exception()
57
+ {
56
58
  list<trace_point *>::const_iterator it;
57
59
  for (it = other.backtrace_copy.begin(); it != other.backtrace_copy.end(); it++) {
58
60
  trace_point *p = new trace_point(
@@ -35,6 +35,7 @@ end
35
35
 
36
36
  have_header('alloca.h')
37
37
  have_header('ruby/io.h')
38
+ have_func('rb_reserved_fd_p')
38
39
 
39
40
  with_cflags($CFLAGS) do
40
41
  create_makefile('passenger_native_support')
@@ -276,6 +276,9 @@ close_all_file_descriptors(VALUE self, VALUE exceptions) {
276
276
 
277
277
  for (i = sysconf(_SC_OPEN_MAX) - 1; i >= 0; i--) {
278
278
  int is_exception = 0;
279
+ #ifdef HAVE_RB_RESERVED_FD_P
280
+ is_exception = rb_reserved_fd_p(i);
281
+ #endif
279
282
  for (j = 0; j < RARRAY_LEN(exceptions) && !is_exception; j++) {
280
283
  long fd = NUM2INT(rb_ary_entry(exceptions, j));
281
284
  is_exception = i == fd;
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # Phusion Passenger - http://www.modrails.com/
3
- # Copyright (c) 2010 Phusion
3
+ # Copyright (c) 2010, 2011 Phusion
4
4
  #
5
5
  # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
6
6
  #
@@ -26,38 +26,120 @@ STDOUT.sync = true
26
26
  STDERR.sync = true
27
27
 
28
28
  require 'uri'
29
- url = ARGV[0]
30
- begin
31
- uri = URI.parse(url)
32
- rescue URI::InvaludURIError
33
- STDERR.puts "*** ERROR: '#{url}' is not a valid URL."
34
- exit 1
29
+ require 'socket'
30
+
31
+ class PrespawnLocation
32
+ class InvalidURLError < RuntimeError
33
+ def initialize(url)
34
+ @url = url
35
+ end
36
+
37
+ def to_s
38
+ message
39
+ end
40
+
41
+ def message
42
+ "'#{@url}' is not a valid URL."
43
+ end
44
+ end
45
+
46
+ def self.parse(url)
47
+ uri = uri_for(url)
48
+
49
+ location = if uri.host == 'unix'
50
+ UNIXPrespawnLocation.new(uri)
51
+ else
52
+ case uri.scheme
53
+ when 'http'
54
+ TCPPrespawnLocation.new(uri)
55
+ when 'https'
56
+ SSLPrespawnLocation.new(uri)
57
+ end
58
+ end
59
+
60
+ unless location
61
+ raise InvalidURLError, url
62
+ end
63
+
64
+ location
65
+ end
66
+
67
+ def self.uri_for(url)
68
+ URI.parse(url)
69
+ rescue URI::InvalidURIError
70
+ raise InvalidURLError, url
71
+ end
72
+
73
+ def initialize(uri)
74
+ @uri = uri
75
+ end
76
+
77
+ def request_path
78
+ @uri.path.empty? ? '/' : @uri.path
79
+ end
80
+
81
+ def request_host
82
+ @uri.host
83
+ end
84
+
85
+ def socket
86
+ @socket ||= connect
87
+ end
88
+
89
+ def head_request
90
+ socket.write("HEAD #{request_path} HTTP/1.1\r\n")
91
+ socket.write("Host: #{request_host}\r\n")
92
+ socket.write("Connection: close\r\n")
93
+ socket.write("\r\n")
94
+
95
+ socket.read
96
+ end
35
97
  end
36
- if uri.scheme.nil? || uri.host.nil? || uri.port.nil? || uri.path.nil?
37
- STDERR.puts "*** ERROR: '#{url}' is not a valid URL."
38
- exit 1
98
+
99
+ class TCPPrespawnLocation < PrespawnLocation
100
+ def request_port
101
+ @uri.port
102
+ end
103
+
104
+ def connect
105
+ TCPSocket.new(request_host, request_port)
106
+ end
39
107
  end
40
108
 
41
- require 'socket'
42
- path = uri.path.empty? ? "/" : uri.path
43
- socket = TCPSocket.new('127.0.0.1', uri.port)
44
- if uri.scheme == 'https'
45
- require 'openssl'
46
- socket = OpenSSL::SSL::SSLSocket.new(socket)
47
- socket.sync_close = true
48
- socket.connect
109
+ class SSLPrespawnLocation < TCPPrespawnLocation
110
+ def connect
111
+ require 'openssl'
112
+ socket = OpenSSL::SSL::SSLSocket.new(super)
113
+ socket.sync_close = true
114
+ socket.connect
115
+ socket
116
+ end
49
117
  end
50
- begin
51
- socket.write("HEAD #{path} HTTP/1.1\r\n")
52
- socket.write("Host: #{uri.host}\r\n")
53
- socket.write("Connection: close\r\n")
54
- socket.write("\r\n")
55
- if socket.respond_to?(:close_write)
56
- socket.close_write
57
- socket.read
58
- else
59
- socket.readline
118
+
119
+ class UNIXPrespawnLocation < PrespawnLocation
120
+ def request_path
121
+ super.split(':', 2).last
60
122
  end
61
- ensure
62
- socket.close
63
- end
123
+
124
+ def request_host
125
+ '_'
126
+ end
127
+
128
+ def socket_path
129
+ @uri.path.split(':', 2).first
130
+ end
131
+
132
+ def connect
133
+ UNIXSocket.new(socket_path)
134
+ end
135
+ end
136
+
137
+ url = ARGV[0]
138
+ begin
139
+ prespawn_location = PrespawnLocation.parse(url)
140
+ rescue PrespawnLocation::InvalidURLError => e
141
+ STDERR.puts "*** ERROR: #{e}"
142
+ exit 1
143
+ end
144
+
145
+ prespawn_location.head_request
@@ -25,9 +25,9 @@ module PhusionPassenger
25
25
  ###### Version numbers ######
26
26
 
27
27
  # Phusion Passenger version number. Don't forget to edit ext/common/Constants.h too.
28
- VERSION_STRING = '3.0.7'
28
+ VERSION_STRING = '3.0.8'
29
29
 
30
- PREFERRED_NGINX_VERSION = '1.0.0'
30
+ PREFERRED_NGINX_VERSION = '1.0.5'
31
31
  PREFERRED_PCRE_VERSION = '8.12'
32
32
  STANDALONE_INTERFACE_VERSION = 1
33
33
 
@@ -307,7 +307,7 @@ private
307
307
  if !File.directory?(dir)
308
308
  FileUtils.mkdir_p(dir)
309
309
  end
310
- FileUtils.install(filename, "#{target}/#{filename}")
310
+ FileUtils.install(filename, "#{target}/#{filename}", :mode => File.stat(filename).mode)
311
311
  yield(i + 1, files.size)
312
312
  end
313
313
  end
@@ -317,7 +317,7 @@ private
317
317
  end
318
318
 
319
319
  def run_rake_task!(target)
320
- total_lines = `#{rake} #{target} --dry-run`.split("\n").size - 1
320
+ total_lines = `#{rake} #{target} --dry-run STDERR_TO_STDOUT=1`.split("\n").size - 1
321
321
  backlog = ""
322
322
 
323
323
  IO.popen("#{rake} #{target} --trace STDERR_TO_STDOUT=1", "r") do |io|
@@ -437,6 +437,7 @@ private
437
437
  # work around the problem by configure Nginx with prefix
438
438
  # /tmp.
439
439
  command = "sh ./configure --prefix=/tmp " <<
440
+ "--with-cc-opt='-Wno-error' " <<
440
441
  "--without-pcre " <<
441
442
  "--without-http_rewrite_module " <<
442
443
  "--without-http_fastcgi_module " <<
@@ -267,10 +267,6 @@ private
267
267
  return !@options[:daemonize] && @options[:log_file] != "/dev/null"
268
268
  end
269
269
 
270
- def listening_on_unix_domain_socket?
271
- return !!@options[:socket_file]
272
- end
273
-
274
270
  # Returns the URL that Nginx will be listening on.
275
271
  def listen_url
276
272
  if @options[:socket_file]
@@ -408,16 +404,20 @@ private
408
404
  end
409
405
 
410
406
  IO.popen("tail -f -n #{backward} \"#{log_file}\"", "rb") do |f|
411
- while true
412
- begin
413
- line = f.readline
414
- @console_mutex.synchronize do
415
- STDOUT.write(line)
416
- STDOUT.flush
407
+ begin
408
+ while true
409
+ begin
410
+ line = f.readline
411
+ @console_mutex.synchronize do
412
+ STDOUT.write(line)
413
+ STDOUT.flush
414
+ end
415
+ rescue EOFError
416
+ break
417
417
  end
418
- rescue EOFError
419
- break
420
418
  end
419
+ ensure
420
+ Process.kill('TERM', f.pid)
421
421
  end
422
422
  end
423
423
  end
@@ -0,0 +1,216 @@
1
+ #include "TestSupport.h"
2
+ #include <algorithm>
3
+ #include <string>
4
+ #include <Utils/Dechunker.h>
5
+ #include <Utils/StrIntUtils.h>
6
+
7
+ using namespace Passenger;
8
+ using namespace std;
9
+
10
+ namespace tut {
11
+ struct DechunkerTest {
12
+ Dechunker dechunker;
13
+ string input;
14
+ vector<string> chunks;
15
+
16
+ DechunkerTest() {
17
+ dechunker.onData = onData;
18
+ dechunker.userData = this;
19
+ }
20
+
21
+ void addChunk(const string &data) {
22
+ input.append(integerToHex(data.size()));
23
+ input.append("\r\n");
24
+ input.append(data);
25
+ input.append("\r\n");
26
+ }
27
+
28
+ static void onData(const char *data, size_t len, void *userData) {
29
+ DechunkerTest *self = (DechunkerTest *) userData;
30
+ self->chunks.push_back(string(data, len));
31
+ }
32
+ };
33
+
34
+ DEFINE_TEST_GROUP(DechunkerTest);
35
+
36
+ TEST_METHOD(1) {
37
+ // Test initial state.
38
+ ensure(dechunker.acceptingInput());
39
+ ensure(!dechunker.hasError());
40
+ ensure_equals(dechunker.getErrorMessage(), (const char *) NULL);
41
+ }
42
+
43
+ TEST_METHOD(2) {
44
+ // Test feeding a complete stream everything in one go.
45
+ addChunk("hello");
46
+ addChunk("world");
47
+ addChunk("");
48
+ ensure_equals(dechunker.feed(input.data(), input.size()), input.size());
49
+ ensure(!dechunker.acceptingInput());
50
+ ensure(!dechunker.hasError());
51
+ ensure_equals(chunks.size(), 2u);
52
+ ensure_equals(chunks[0], "hello");
53
+ ensure_equals(chunks[1], "world");
54
+ }
55
+
56
+ TEST_METHOD(3) {
57
+ // Test feeding a complete stream byte by byte.
58
+ addChunk("hel");
59
+ addChunk("lo");
60
+ addChunk("");
61
+
62
+ const char *pos = input.data();
63
+ const char *end = input.data() + input.size();
64
+ while (pos < end) {
65
+ ensure(dechunker.acceptingInput());
66
+ ensure(!dechunker.hasError());
67
+ ensure_equals(dechunker.feed(pos, 1), 1u);
68
+ pos++;
69
+ }
70
+
71
+ ensure(!dechunker.acceptingInput());
72
+ ensure(!dechunker.hasError());
73
+ ensure_equals(chunks.size(), 5u);
74
+ ensure_equals(chunks[0], "h");
75
+ ensure_equals(chunks[1], "e");
76
+ ensure_equals(chunks[2], "l");
77
+ ensure_equals(chunks[3], "l");
78
+ ensure_equals(chunks[4], "o");
79
+ }
80
+
81
+ TEST_METHOD(4) {
82
+ // Test feeding a complete stream in pieces of 2 bytes.
83
+ addChunk("hello");
84
+ addChunk("world");
85
+ addChunk("");
86
+
87
+ const char *pos = input.data();
88
+ const char *end = input.data() + input.size();
89
+ while (pos < end) {
90
+ ensure(dechunker.acceptingInput());
91
+ ensure(!dechunker.hasError());
92
+ size_t size = std::min<size_t>(2, end - pos);
93
+ ensure_equals(dechunker.feed(pos, size), size);
94
+ pos += 2;
95
+ }
96
+
97
+ ensure(!dechunker.acceptingInput());
98
+ ensure(!dechunker.hasError());
99
+ ensure_equals(chunks.size(), 6u);
100
+ ensure_equals(chunks[0], "h");
101
+ ensure_equals(chunks[1], "el");
102
+ ensure_equals(chunks[2], "lo");
103
+ ensure_equals(chunks[3], "w");
104
+ ensure_equals(chunks[4], "or");
105
+ ensure_equals(chunks[5], "ld");
106
+ }
107
+
108
+ TEST_METHOD(5) {
109
+ // Test feeding a complete stream in pieces of 3 bytes.
110
+ addChunk("hello");
111
+ addChunk("world");
112
+ addChunk("");
113
+
114
+ const char *pos = input.data();
115
+ const char *end = input.data() + input.size();
116
+ while (pos < end) {
117
+ ensure(dechunker.acceptingInput());
118
+ ensure(!dechunker.hasError());
119
+ size_t size = std::min<size_t>(3, end - pos);
120
+ ensure_equals(dechunker.feed(pos, size), size);
121
+ pos += 3;
122
+ }
123
+
124
+ ensure(!dechunker.acceptingInput());
125
+ ensure(!dechunker.hasError());
126
+ ensure_equals(chunks.size(), 4u);
127
+ ensure_equals(chunks[0], "hel");
128
+ ensure_equals(chunks[1], "lo");
129
+ ensure_equals(chunks[2], "wo");
130
+ ensure_equals(chunks[3], "rld");
131
+ }
132
+
133
+ TEST_METHOD(6) {
134
+ // Test support for chunk extensions.
135
+ input = "2;foobar\r\n"
136
+ "xy\r\n"
137
+ "0\r\n"
138
+ "\r\n";
139
+ ensure_equals(dechunker.feed(input.data(), input.size()), input.size());
140
+ ensure(!dechunker.acceptingInput());
141
+ ensure(!dechunker.hasError());
142
+ ensure_equals(chunks.size(), 1u);
143
+ ensure_equals(chunks[0], "xy");
144
+ }
145
+
146
+ TEST_METHOD(20) {
147
+ // It refuses to accept any more data after EOF until reset is called.
148
+ addChunk("hello");
149
+ addChunk("");
150
+
151
+ dechunker.feed(input.data(), input.size());
152
+ ensure_equals(dechunker.feed(input.data(), input.size()), 0u);
153
+ dechunker.reset();
154
+ ensure_equals(dechunker.feed(input.data(), input.size()), input.size());
155
+ ensure(!dechunker.acceptingInput());
156
+ ensure(!dechunker.hasError());
157
+
158
+ ensure_equals(chunks.size(), 2u);
159
+ ensure_equals(chunks[0], "hello");
160
+ ensure_equals(chunks[1], "hello");
161
+ }
162
+
163
+ TEST_METHOD(21) {
164
+ // Test invalid size string.
165
+ input = "12x\r\n";
166
+ ensure_equals(dechunker.feed(input.data(), input.size()), 2u);
167
+ ensure(!dechunker.acceptingInput());
168
+ ensure(dechunker.hasError());
169
+ }
170
+
171
+ TEST_METHOD(22) {
172
+ // Test invalid chunk header terminator.
173
+ input = "12\r\t";
174
+ ensure_equals(dechunker.feed(input.data(), input.size()), 3u);
175
+ ensure(!dechunker.acceptingInput());
176
+ ensure(dechunker.hasError());
177
+ }
178
+
179
+ TEST_METHOD(23) {
180
+ // Test invalid chunk header terminator when chunk extensions are involved.
181
+ input = "12;foo\r\t";
182
+ ensure_equals(dechunker.feed(input.data(), input.size()), 7u);
183
+ ensure(!dechunker.acceptingInput());
184
+ ensure(dechunker.hasError());
185
+ }
186
+
187
+ TEST_METHOD(24) {
188
+ // Test invalid chunk terminator.
189
+ input = "2\r\n"
190
+ "xyz";
191
+ ensure_equals(dechunker.feed(input.data(), input.size()), 5u);
192
+ ensure(!dechunker.acceptingInput());
193
+ ensure(dechunker.hasError());
194
+ }
195
+
196
+ TEST_METHOD(25) {
197
+ // Test invalid terminating chunk terminator.
198
+ input = "2\r\n"
199
+ "xy\r\n"
200
+ "0\r\n"
201
+ "\rx";
202
+ ensure_equals(dechunker.feed(input.data(), input.size()), 11u);
203
+ ensure(!dechunker.acceptingInput());
204
+ ensure(dechunker.hasError());
205
+ }
206
+
207
+ TEST_METHOD(26) {
208
+ // Test garbage.
209
+ for (int i = 0; i < 256; i++) {
210
+ input.append(1, (char) i);
211
+ }
212
+ dechunker.feed(input.data(), input.size());
213
+ ensure(!dechunker.acceptingInput());
214
+ ensure(dechunker.hasError());
215
+ }
216
+ }