passenger 3.0.2 → 3.0.3

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 (220) hide show
  1. data/NEWS +29 -0
  2. data/build/agents.rb +1 -0
  3. data/build/apache2.rb +2 -1
  4. data/build/cxx_tests.rb +7 -0
  5. data/build/rpm.rb +17 -22
  6. data/doc/cxxapi/Constants_8h_source.html +1 -1
  7. data/doc/cxxapi/Exceptions_8h_source.html +18 -4
  8. data/doc/cxxapi/Logging_8h_source.html +332 -262
  9. data/doc/cxxapi/annotated.html +1 -0
  10. data/doc/cxxapi/classes.html +4 -4
  11. data/doc/cxxapi/group__Exceptions.html +2 -0
  12. data/doc/cxxapi/hierarchy.html +1 -0
  13. data/doc/cxxapi/inherit__graph__35.map +1 -3
  14. data/doc/cxxapi/inherit__graph__35.md5 +1 -1
  15. data/doc/cxxapi/inherit__graph__35.png +0 -0
  16. data/doc/cxxapi/inherit__graph__36.map +3 -1
  17. data/doc/cxxapi/inherit__graph__36.md5 +1 -1
  18. data/doc/cxxapi/inherit__graph__36.png +0 -0
  19. data/doc/cxxapi/inherit__graph__37.map +1 -1
  20. data/doc/cxxapi/inherit__graph__37.md5 +1 -1
  21. data/doc/cxxapi/inherit__graph__37.png +0 -0
  22. data/doc/cxxapi/inherit__graph__38.map +1 -1
  23. data/doc/cxxapi/inherit__graph__38.md5 +1 -1
  24. data/doc/cxxapi/inherit__graph__38.png +0 -0
  25. data/doc/cxxapi/inherit__graph__39.map +1 -1
  26. data/doc/cxxapi/inherit__graph__39.md5 +1 -1
  27. data/doc/cxxapi/inherit__graph__39.png +0 -0
  28. data/doc/cxxapi/inherit__graph__40.map +1 -1
  29. data/doc/cxxapi/inherit__graph__40.md5 +1 -1
  30. data/doc/cxxapi/inherit__graph__40.png +0 -0
  31. data/doc/cxxapi/inherits.html +9 -6
  32. data/doc/cxxapi/namespacePassenger.html +2 -0
  33. data/doc/cxxapi/tree.html +2 -0
  34. data/doc/rdoc/classes/ConditionVariable.html +215 -0
  35. data/doc/rdoc/classes/Exception.html +120 -0
  36. data/doc/rdoc/classes/GC.html +113 -0
  37. data/doc/rdoc/classes/IO.html +221 -0
  38. data/doc/rdoc/classes/PhusionPassenger.html +397 -0
  39. data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +180 -0
  40. data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +647 -0
  41. data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +654 -0
  42. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/InvalidPassword.html +92 -0
  43. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerAlreadyStarted.html +97 -0
  44. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerError.html +96 -0
  45. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerNotStarted.html +97 -0
  46. data/doc/rdoc/classes/PhusionPassenger/AbstractServer/UnknownMessage.html +96 -0
  47. data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +619 -0
  48. data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +142 -0
  49. data/doc/rdoc/classes/PhusionPassenger/AdminTools/MemoryStats.html +368 -0
  50. data/doc/rdoc/classes/PhusionPassenger/AdminTools/MemoryStats/Process.html +231 -0
  51. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance.html +588 -0
  52. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/CorruptedDirectoryError.html +92 -0
  53. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/GenerationsAbsentError.html +92 -0
  54. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Group.html +147 -0
  55. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Process.html +279 -0
  56. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/RoleDeniedError.html +92 -0
  57. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/StaleDirectoryError.html +92 -0
  58. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/Stats.html +123 -0
  59. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ServerInstance/UnsupportedGenerationStructureVersionError.html +92 -0
  60. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger.html +368 -0
  61. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger/Log.html +299 -0
  62. data/doc/rdoc/classes/PhusionPassenger/AnalyticsLogger/SharedData.html +206 -0
  63. data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +155 -0
  64. data/doc/rdoc/classes/PhusionPassenger/AppProcess.html +367 -0
  65. data/doc/rdoc/classes/PhusionPassenger/ClassicRails.html +95 -0
  66. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/ApplicationSpawner.html +351 -0
  67. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/ApplicationSpawner/Error.html +98 -0
  68. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/CGIFixed.html +200 -0
  69. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/FrameworkSpawner.html +410 -0
  70. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/FrameworkSpawner/Error.html +98 -0
  71. data/doc/rdoc/classes/PhusionPassenger/ClassicRails/RequestHandler.html +156 -0
  72. data/doc/rdoc/classes/PhusionPassenger/ClassicRailsExtensions.html +115 -0
  73. data/doc/rdoc/classes/PhusionPassenger/ClassicRailsExtensions/AnalyticsLogging.html +202 -0
  74. data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +172 -0
  75. data/doc/rdoc/classes/PhusionPassenger/DebugLogging.html +273 -0
  76. data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +145 -0
  77. data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +162 -0
  78. data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +141 -0
  79. data/doc/rdoc/classes/PhusionPassenger/InvalidPath.html +92 -0
  80. data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +673 -0
  81. data/doc/rdoc/classes/PhusionPassenger/MessageChannel/InvalidHashError.html +92 -0
  82. data/doc/rdoc/classes/PhusionPassenger/MessageClient.html +415 -0
  83. data/doc/rdoc/classes/PhusionPassenger/NativeSupportLoader.html +134 -0
  84. data/doc/rdoc/classes/PhusionPassenger/Packaging.html +129 -0
  85. data/doc/rdoc/classes/PhusionPassenger/PlatformInfo.html +1972 -0
  86. data/doc/rdoc/classes/PhusionPassenger/Plugin.html +237 -0
  87. data/doc/rdoc/classes/PhusionPassenger/Rack.html +91 -0
  88. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +312 -0
  89. data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner/Error.html +98 -0
  90. data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +218 -0
  91. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions.html +114 -0
  92. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging.html +259 -0
  93. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ACExtension.html +139 -0
  94. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ASBenchmarkableExtension.html +118 -0
  95. data/doc/rdoc/classes/PhusionPassenger/Rails3Extensions/AnalyticsLogging/ExceptionLogger.html +135 -0
  96. data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +378 -0
  97. data/doc/rdoc/classes/PhusionPassenger/Standalone.html +111 -0
  98. data/doc/rdoc/classes/PhusionPassenger/Standalone/AppFinder.html +252 -0
  99. data/doc/rdoc/classes/PhusionPassenger/Standalone/Command.html +161 -0
  100. data/doc/rdoc/classes/PhusionPassenger/Standalone/ConfigFile.html +368 -0
  101. data/doc/rdoc/classes/PhusionPassenger/Standalone/ConfigFile/DisallowedContextError.html +132 -0
  102. data/doc/rdoc/classes/PhusionPassenger/Standalone/HelpCommand.html +151 -0
  103. data/doc/rdoc/classes/PhusionPassenger/Standalone/Main.html +189 -0
  104. data/doc/rdoc/classes/PhusionPassenger/Standalone/PackageRuntimeCommand.html +177 -0
  105. data/doc/rdoc/classes/PhusionPassenger/Standalone/RuntimeInstaller.html +341 -0
  106. data/doc/rdoc/classes/PhusionPassenger/Standalone/StartCommand.html +203 -0
  107. data/doc/rdoc/classes/PhusionPassenger/Standalone/StatusCommand.html +156 -0
  108. data/doc/rdoc/classes/PhusionPassenger/Standalone/StopCommand.html +168 -0
  109. data/doc/rdoc/classes/PhusionPassenger/Standalone/Utils.html +86 -0
  110. data/doc/rdoc/classes/PhusionPassenger/Standalone/VersionCommand.html +135 -0
  111. data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +125 -0
  112. data/doc/rdoc/classes/PhusionPassenger/Utils.html +1543 -0
  113. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher.html +204 -0
  114. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher/DirInfo.html +171 -0
  115. data/doc/rdoc/classes/PhusionPassenger/Utils/FileSystemWatcher/FileInfo.html +140 -0
  116. data/doc/rdoc/classes/PhusionPassenger/Utils/HostsFileParser.html +260 -0
  117. data/doc/rdoc/classes/PhusionPassenger/Utils/PseudoIO.html +194 -0
  118. data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput.html +265 -0
  119. data/doc/rdoc/classes/PhusionPassenger/Utils/RewindableInput/Tempfile.html +120 -0
  120. data/doc/rdoc/classes/PhusionPassenger/Utils/UnseekableSocket.html +561 -0
  121. data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +140 -0
  122. data/doc/rdoc/classes/PhusionPassenger/WSGI.html +89 -0
  123. data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +182 -0
  124. data/doc/rdoc/classes/Process.html +115 -0
  125. data/doc/rdoc/classes/Signal.html +139 -0
  126. data/doc/rdoc/created.rid +1 -0
  127. data/doc/rdoc/files/DEVELOPERS_TXT.html +280 -0
  128. data/doc/rdoc/files/README.html +157 -0
  129. data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +130 -0
  130. data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +135 -0
  131. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +126 -0
  132. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +128 -0
  133. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/memory_stats_rb.html +126 -0
  134. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/server_instance_rb.html +132 -0
  135. data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +122 -0
  136. data/doc/rdoc/files/lib/phusion_passenger/analytics_logger_rb.html +129 -0
  137. data/doc/rdoc/files/lib/phusion_passenger/app_process_rb.html +127 -0
  138. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/application_spawner_rb.html +141 -0
  139. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/cgi_fixed_rb.html +126 -0
  140. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/framework_spawner_rb.html +146 -0
  141. data/doc/rdoc/files/lib/phusion_passenger/classic_rails/request_handler_rb.html +125 -0
  142. data/doc/rdoc/files/lib/phusion_passenger/classic_rails_extensions/init_rb.html +132 -0
  143. data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +126 -0
  144. data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +122 -0
  145. data/doc/rdoc/files/lib/phusion_passenger/debug_logging_rb.html +122 -0
  146. data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +147 -0
  147. data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +122 -0
  148. data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +127 -0
  149. data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +120 -0
  150. data/doc/rdoc/files/lib/phusion_passenger/message_client_rb.html +127 -0
  151. data/doc/rdoc/files/lib/phusion_passenger/native_support_rb.html +132 -0
  152. data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +122 -0
  153. data/doc/rdoc/files/lib/phusion_passenger/platform_info/apache_rb.html +127 -0
  154. data/doc/rdoc/files/lib/phusion_passenger/platform_info/binary_compatibility_rb.html +129 -0
  155. data/doc/rdoc/files/lib/phusion_passenger/platform_info/compiler_rb.html +127 -0
  156. data/doc/rdoc/files/lib/phusion_passenger/platform_info/curl_rb.html +126 -0
  157. data/doc/rdoc/files/lib/phusion_passenger/platform_info/documentation_tools_rb.html +126 -0
  158. data/doc/rdoc/files/lib/phusion_passenger/platform_info/linux_rb.html +126 -0
  159. data/doc/rdoc/files/lib/phusion_passenger/platform_info/operating_system_rb.html +127 -0
  160. data/doc/rdoc/files/lib/phusion_passenger/platform_info/ruby_rb.html +128 -0
  161. data/doc/rdoc/files/lib/phusion_passenger/platform_info/zlib_rb.html +126 -0
  162. data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +122 -0
  163. data/doc/rdoc/files/lib/phusion_passenger/plugin_rb.html +127 -0
  164. data/doc/rdoc/files/lib/phusion_passenger/public_api_rb.html +127 -0
  165. data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +137 -0
  166. data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +125 -0
  167. data/doc/rdoc/files/lib/phusion_passenger/rails3_extensions/init_rb.html +127 -0
  168. data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +122 -0
  169. data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +160 -0
  170. data/doc/rdoc/files/lib/phusion_passenger/standalone/app_finder_rb.html +127 -0
  171. data/doc/rdoc/files/lib/phusion_passenger/standalone/command_rb.html +136 -0
  172. data/doc/rdoc/files/lib/phusion_passenger/standalone/config_file_rb.html +126 -0
  173. data/doc/rdoc/files/lib/phusion_passenger/standalone/help_command_rb.html +126 -0
  174. data/doc/rdoc/files/lib/phusion_passenger/standalone/main_rb.html +126 -0
  175. data/doc/rdoc/files/lib/phusion_passenger/standalone/package_runtime_command_rb.html +127 -0
  176. data/doc/rdoc/files/lib/phusion_passenger/standalone/runtime_installer_rb.html +133 -0
  177. data/doc/rdoc/files/lib/phusion_passenger/standalone/start_command_rb.html +136 -0
  178. data/doc/rdoc/files/lib/phusion_passenger/standalone/status_command_rb.html +126 -0
  179. data/doc/rdoc/files/lib/phusion_passenger/standalone/stop_command_rb.html +126 -0
  180. data/doc/rdoc/files/lib/phusion_passenger/standalone/utils_rb.html +126 -0
  181. data/doc/rdoc/files/lib/phusion_passenger/standalone/version_command_rb.html +127 -0
  182. data/doc/rdoc/files/lib/phusion_passenger/utils/file_system_watcher_rb.html +126 -0
  183. data/doc/rdoc/files/lib/phusion_passenger/utils/hosts_file_parser_rb.html +120 -0
  184. data/doc/rdoc/files/lib/phusion_passenger/utils/rewindable_input_rb.html +100 -0
  185. data/doc/rdoc/files/lib/phusion_passenger/utils/tmpdir_rb.html +122 -0
  186. data/doc/rdoc/files/lib/phusion_passenger/utils/unseekable_socket_rb.html +126 -0
  187. data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +179 -0
  188. data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +132 -0
  189. data/doc/rdoc/fr_class_index.html +139 -0
  190. data/doc/rdoc/fr_file_index.html +108 -0
  191. data/doc/rdoc/fr_method_index.html +439 -0
  192. data/doc/rdoc/index.html +26 -0
  193. data/doc/rdoc/rdoc-style.css +187 -0
  194. data/ext/apache2/Configuration.cpp +41 -0
  195. data/ext/apache2/Configuration.hpp +19 -0
  196. data/ext/apache2/Hooks.cpp +67 -5
  197. data/ext/common/Constants.h +1 -1
  198. data/ext/common/Exceptions.h +14 -0
  199. data/ext/common/Logging.h +76 -6
  200. data/ext/common/LoggingAgent/FilterSupport.h +1317 -0
  201. data/ext/common/LoggingAgent/LoggingServer.h +93 -4
  202. data/ext/common/LoggingAgent/RemoteSender.h +5 -5
  203. data/ext/common/Utils/StrIntUtils.cpp +12 -1
  204. data/ext/common/Utils/StrIntUtils.h +2 -1
  205. data/ext/common/Utils/StringMap.h +100 -0
  206. data/ext/nginx/Configuration.c +0 -1
  207. data/ext/nginx/ContentHandler.c +33 -7
  208. data/lib/phusion_passenger.rb +2 -2
  209. data/lib/phusion_passenger/abstract_request_handler.rb +5 -0
  210. data/lib/phusion_passenger/analytics_logger.rb +77 -11
  211. data/lib/phusion_passenger/dependencies.rb +11 -1
  212. data/lib/phusion_passenger/platform_info.rb +1 -1
  213. data/lib/phusion_passenger/utils.rb +9 -1
  214. data/test/cxx/FilterSupportTest.cpp +276 -0
  215. data/test/cxx/LoggingTest.cpp +28 -0
  216. data/test/cxx/StringMapTest.cpp +70 -0
  217. data/test/integration_tests/cgi_environment_spec.rb +10 -0
  218. metadata +170 -8
  219. data/ext/common/libboost_oxt/aggregate.cpp +0 -10
  220. data/ext/common/libpassenger_common/aggregate.cpp +0 -15
@@ -0,0 +1,26 @@
1
+
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
5
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
+ <head>
7
+ <title>Passenger Ruby API</title>
8
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
+ </head>
10
+
11
+ <frameset cols="20%,*">
12
+ <frameset rows="15%,55%,30%">
13
+ <frame src="fr_file_index.html" title="Files" name="Files" />
14
+ <frame src="fr_class_index.html" name="Classes" />
15
+ <frame src="fr_method_index.html" name="Methods" />
16
+ </frameset>
17
+ <frame src="files/README.html" name="docwin" />
18
+ <noframes>
19
+ <body bgcolor="white">
20
+ Click <a href="html/index.html">here</a> for a non-frames
21
+ version of this page.
22
+ </body>
23
+ </noframes>
24
+ </frameset>
25
+
26
+ </html>
@@ -0,0 +1,187 @@
1
+ a {
2
+ color: #00F;
3
+ text-decoration: none;
4
+ }
5
+
6
+ a:hover {
7
+ color: #77F;
8
+ text-decoration: underline;
9
+ }
10
+
11
+ body, td, p {
12
+ font-family: "Bitstream Vera Sans", Verdana, Arial, Helvetica, sans-serif;
13
+ background: #FFF;
14
+ color: #000;
15
+ margin: 0px;
16
+ font-size: small;
17
+ }
18
+
19
+ p {
20
+ margin-top: 0.5em;
21
+ margin-bottom: 0.5em;
22
+ }
23
+
24
+ #content {
25
+ margin: 2em;
26
+ margin-left: 3.5em;
27
+ margin-right: 3.5em;
28
+ }
29
+
30
+ #description p {
31
+ margin-bottom: 0.5em;
32
+ }
33
+
34
+ .sectiontitle {
35
+ margin-top: 1em;
36
+ margin-bottom: 1em;
37
+ padding: 0.5em;
38
+ padding-left: 2em;
39
+ background: #005;
40
+ color: #FFF;
41
+ font-weight: bold;
42
+ }
43
+
44
+ .attr-rw {
45
+ padding-left: 1em;
46
+ padding-right: 1em;
47
+ text-align: center;
48
+ color: #055;
49
+ }
50
+
51
+ .attr-name {
52
+ font-weight: bold;
53
+ }
54
+
55
+ .attr-desc {
56
+ }
57
+
58
+ .attr-value {
59
+ font-family: monospace;
60
+ }
61
+
62
+ .file-title-prefix {
63
+ font-size: large;
64
+ }
65
+
66
+ .file-title {
67
+ font-size: large;
68
+ font-weight: bold;
69
+ background: #005;
70
+ color: #FFF;
71
+ }
72
+
73
+ .banner {
74
+ background: #005;
75
+ color: #FFF;
76
+ border: 1px solid black;
77
+ padding: 1em;
78
+ }
79
+
80
+ .banner td {
81
+ background: transparent;
82
+ color: #FFF;
83
+ }
84
+
85
+ h1 a, h2 a, .sectiontitle a, .banner a {
86
+ color: #FF0;
87
+ }
88
+
89
+ h1 a:hover, h2 a:hover, .sectiontitle a:hover, .banner a:hover {
90
+ color: #FF7;
91
+ }
92
+
93
+ .dyn-source {
94
+ display: none;
95
+ background: #fffde8;
96
+ color: #000;
97
+ border: #ffe0bb dotted 1px;
98
+ margin: 0.5em 2em 0.5em 2em;
99
+ padding: 0.5em;
100
+ }
101
+
102
+ .dyn-source .cmt {
103
+ color: #00F;
104
+ font-style: italic;
105
+ }
106
+
107
+ .dyn-source .kw {
108
+ color: #070;
109
+ font-weight: bold;
110
+ }
111
+
112
+ .method {
113
+ margin-left: 1em;
114
+ margin-right: 1em;
115
+ margin-bottom: 1em;
116
+ }
117
+
118
+ .description pre {
119
+ padding: 0.5em;
120
+ border: #ffe0bb dotted 1px;
121
+ background: #fffde8;
122
+ }
123
+
124
+ .method .title {
125
+ font-family: monospace;
126
+ font-size: large;
127
+ border-bottom: 1px dashed black;
128
+ margin-bottom: 0.3em;
129
+ padding-bottom: 0.1em;
130
+ }
131
+
132
+ .method .description, .method .sourcecode {
133
+ margin-left: 1em;
134
+ }
135
+
136
+ .description p, .sourcecode p {
137
+ margin-bottom: 0.5em;
138
+ }
139
+
140
+ .method .sourcecode p.source-link {
141
+ text-indent: 0em;
142
+ margin-top: 0.5em;
143
+ }
144
+
145
+ .method .aka {
146
+ margin-top: 0.3em;
147
+ margin-left: 1em;
148
+ font-style: italic;
149
+ text-indent: 2em;
150
+ }
151
+
152
+ h1 {
153
+ padding: 1em;
154
+ margin-left: -1.5em;
155
+ font-size: x-large;
156
+ font-weight: bold;
157
+ color: #FFF;
158
+ background: #007;
159
+ }
160
+
161
+ h2 {
162
+ padding: 0.5em 1em 0.5em 1em;
163
+ margin-left: -1.5em;
164
+ font-size: large;
165
+ font-weight: bold;
166
+ color: #FFF;
167
+ background: #009;
168
+ }
169
+
170
+ h3, h4, h5, h6 {
171
+ color: #220088;
172
+ border-bottom: #5522bb solid 1px;
173
+ }
174
+
175
+ .sourcecode > pre {
176
+ padding: 0.5em;
177
+ border: 1px dotted black;
178
+ background: #FFE;
179
+ }
180
+
181
+ dt {
182
+ font-weight: bold
183
+ }
184
+
185
+ dd {
186
+ margin-bottom: 0.7em;
187
+ }
@@ -36,6 +36,7 @@
36
36
 
37
37
  #include "Configuration.hpp"
38
38
  #include "Utils.h"
39
+ #include <LoggingAgent/FilterSupport.h>
39
40
 
40
41
  /* The APR headers must come after the Passenger headers. See Hooks.cpp
41
42
  * to learn why.
@@ -159,6 +160,17 @@ destroy_config_struct(void *x) {
159
160
  return APR_SUCCESS;
160
161
  }
161
162
 
163
+ template<typename Collection, typename T> static bool
164
+ contains(const Collection &coll, const T &item) {
165
+ typename Collection::const_iterator it;
166
+ for (it = coll.begin(); it != coll.end(); it++) {
167
+ if (*it == item) {
168
+ return true;
169
+ }
170
+ }
171
+ return false;
172
+ }
173
+
162
174
 
163
175
  extern "C" {
164
176
 
@@ -237,6 +249,12 @@ passenger_config_merge_dir(apr_pool_t *p, void *basev, void *addv) {
237
249
  MERGE_STR_CONFIG(restartDir);
238
250
  MERGE_STR_CONFIG(uploadBufferDir);
239
251
  MERGE_STRING_CONFIG(unionStationKey);
252
+ config->unionStationFilters = base->unionStationFilters;
253
+ for (vector<string>::const_iterator it = add->unionStationFilters.begin(); it != add->unionStationFilters.end(); it++) {
254
+ if (!contains(config->unionStationFilters, *it)) {
255
+ config->unionStationFilters.push_back(*it);
256
+ }
257
+ }
240
258
  MERGE_THREEWAY_CONFIG(resolveSymlinksInDocRoot);
241
259
  MERGE_THREEWAY_CONFIG(allowEncodedSlashes);
242
260
  MERGE_THREEWAY_CONFIG(friendlyErrorPages);
@@ -309,6 +327,24 @@ cmd_passenger_spawn_method(cmd_parms *cmd, void *pcfg, const char *arg) {
309
327
  return NULL;
310
328
  }
311
329
 
330
+ static const char *
331
+ cmd_union_station_filter(cmd_parms *cmd, void *pcfg, const char *arg) {
332
+ DirConfig *config = (DirConfig *) pcfg;
333
+ if (strlen(arg) == 0) {
334
+ return "UnionStationFilter may not be set to the empty string";
335
+ } else {
336
+ try {
337
+ FilterSupport::Filter f(arg);
338
+ config->unionStationFilters.push_back(arg);
339
+ return NULL;
340
+ } catch (const SyntaxError &e) {
341
+ string message = "Syntax error in Union Station filter: ";
342
+ message.append(e.what());
343
+ return strdup(message.c_str());
344
+ }
345
+ }
346
+ }
347
+
312
348
 
313
349
  /*************************************************
314
350
  * Rails-specific settings
@@ -543,6 +579,11 @@ const command_rec passenger_commands[] = {
543
579
  NULL,
544
580
  OR_ALL,
545
581
  "The Union Station key."),
582
+ AP_INIT_TAKE1("UnionStationFilter",
583
+ (Take1Func) cmd_union_station_filter,
584
+ NULL,
585
+ OR_ALL,
586
+ "A filter for Union Station data."),
546
587
  AP_INIT_FLAG("PassengerResolveSymlinksInDocumentRoot",
547
588
  (FlagFunc) cmd_passenger_resolve_symlinks_in_document_root,
548
589
  NULL,
@@ -185,6 +185,8 @@ struct DirConfig {
185
185
 
186
186
  string unionStationKey;
187
187
 
188
+ vector<string> unionStationFilters;
189
+
188
190
  /**
189
191
  * Whether Phusion Passenger should show friendly error pages.
190
192
  */
@@ -331,6 +333,23 @@ struct DirConfig {
331
333
  return analytics == ENABLED;
332
334
  }
333
335
 
336
+ string getUnionStationFilterString() const {
337
+ if (unionStationFilters.empty()) {
338
+ return string();
339
+ } else {
340
+ string result;
341
+ vector<string>::const_iterator it;
342
+
343
+ for (it = unionStationFilters.begin(); it != unionStationFilters.end(); it++) {
344
+ if (it != unionStationFilters.begin()) {
345
+ result.append(1, '\1');
346
+ }
347
+ result.append(*it);
348
+ }
349
+ return result;
350
+ }
351
+ }
352
+
334
353
  /*************************************/
335
354
  };
336
355
 
@@ -570,7 +570,8 @@ private:
570
570
  log = analyticsLogger->newTransaction(
571
571
  config->getAppGroupName(appRoot),
572
572
  "requests",
573
- config->unionStationKey);
573
+ config->unionStationKey,
574
+ config->getUnionStationFilterString());
574
575
  log->message(string("URI: ") + r->uri);
575
576
  } else {
576
577
  log.reset(new AnalyticsLog());
@@ -874,6 +875,55 @@ private:
874
875
  }
875
876
  }
876
877
 
878
+ unsigned int
879
+ escapeUri(unsigned char *dst, const unsigned char *src, size_t size) {
880
+ static const char hex[] = "0123456789abcdef";
881
+ /* " ", "#", "%", "?", %00-%1F, %7F-%FF */
882
+ static uint32_t escape[] = {
883
+ 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
884
+
885
+ /* ?>=< ;:98 7654 3210 /.-, +*)( '&%$ #"! */
886
+ 0x80000029, /* 1000 0000 0000 0000 0000 0000 0010 1001 */
887
+
888
+ /* _^]\ [ZYX WVUT SRQP ONML KJIH GFED CBA@ */
889
+ 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */
890
+
891
+ /* ~}| {zyx wvut srqp onml kjih gfed cba` */
892
+ 0x80000000, /* 1000 0000 0000 0000 0000 0000 0000 0000 */
893
+
894
+ 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
895
+ 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
896
+ 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
897
+ 0xffffffff /* 1111 1111 1111 1111 1111 1111 1111 1111 */
898
+ };
899
+
900
+ if (dst == NULL) {
901
+ /* find the number of the characters to be escaped */
902
+ unsigned int n = 0;
903
+ while (size > 0) {
904
+ if (escape[*src >> 5] & (1 << (*src & 0x1f))) {
905
+ n++;
906
+ }
907
+ src++;
908
+ size--;
909
+ }
910
+ return n;
911
+ }
912
+
913
+ while (size > 0) {
914
+ if (escape[*src >> 5] & (1 << (*src & 0x1f))) {
915
+ *dst++ = '%';
916
+ *dst++ = hex[*src >> 4];
917
+ *dst++ = hex[*src & 0xf];
918
+ src++;
919
+ } else {
920
+ *dst++ = *src++;
921
+ }
922
+ size--;
923
+ }
924
+ return 0;
925
+ }
926
+
877
927
  /**
878
928
  * Convert an HTTP header name to a CGI environment name.
879
929
  */
@@ -928,6 +978,17 @@ private:
928
978
  return APR_ENOMEM;
929
979
  }
930
980
 
981
+ /*
982
+ * Apache unescapes URI's before passing them to Phusion Passenger,
983
+ * but backend processes expect the escaped version.
984
+ * http://code.google.com/p/phusion-passenger/issues/detail?id=404
985
+ */
986
+ size_t uriLen = strlen(r->uri);
987
+ unsigned int escaped = escapeUri(NULL, (const unsigned char *) r->uri, uriLen);
988
+ char escapedUri[uriLen + 2 * escaped + 1];
989
+ escapeUri((unsigned char *) escapedUri, (const unsigned char *) r->uri, uriLen);
990
+ escapedUri[uriLen + 2 * escaped] = '\0';
991
+
931
992
 
932
993
  // Set standard CGI variables.
933
994
  addHeader(headers, "SERVER_SOFTWARE", ap_get_server_version());
@@ -959,19 +1020,19 @@ private:
959
1020
  } else {
960
1021
  const char *request_uri;
961
1022
  if (r->args != NULL) {
962
- request_uri = apr_pstrcat(r->pool, r->uri, "?", r->args, NULL);
1023
+ request_uri = apr_pstrcat(r->pool, escapedUri, "?", r->args, NULL);
963
1024
  } else {
964
- request_uri = r->uri;
1025
+ request_uri = escapedUri;
965
1026
  }
966
1027
  addHeader(headers, "REQUEST_URI", request_uri);
967
1028
  }
968
1029
 
969
1030
  if (strcmp(baseURI, "/") == 0) {
970
1031
  addHeader(headers, "SCRIPT_NAME", "");
971
- addHeader(headers, "PATH_INFO", r->uri);
1032
+ addHeader(headers, "PATH_INFO", escapedUri);
972
1033
  } else {
973
1034
  addHeader(headers, "SCRIPT_NAME", baseURI);
974
- addHeader(headers, "PATH_INFO", r->uri + strlen(baseURI));
1035
+ addHeader(headers, "PATH_INFO", escapedUri + strlen(baseURI));
975
1036
  }
976
1037
 
977
1038
  // Set HTTP headers.
@@ -1001,6 +1062,7 @@ private:
1001
1062
  addHeader(headers, "PASSENGER_GROUP_NAME",
1002
1063
  config->getAppGroupName(appRoot).c_str());
1003
1064
  addHeader(headers, "PASSENGER_TXN_ID", log->getTxnId().c_str());
1065
+ addHeader(headers, "PASSENGER_UNION_STATION_KEY", config->unionStationKey.c_str());
1004
1066
  }
1005
1067
 
1006
1068
  // Now send the headers.
@@ -26,7 +26,7 @@
26
26
  #define _PASSENGER_CONSTANTS_H_
27
27
 
28
28
  /* Don't forget to update lib/phusion_passenger.rb too. */
29
- #define PASSENGER_VERSION "3.0.2"
29
+ #define PASSENGER_VERSION "3.0.3"
30
30
 
31
31
  #define FEEDBACK_FD 3
32
32
 
@@ -343,6 +343,20 @@ public:
343
343
  virtual const char *what() const throw() { return msg.c_str(); }
344
344
  };
345
345
 
346
+ /**
347
+ * A parser detected a syntax error.
348
+ *
349
+ * @ingroup Exceptions
350
+ */
351
+ class SyntaxError: public oxt::tracable_exception {
352
+ private:
353
+ string msg;
354
+ public:
355
+ SyntaxError(const string &message): msg(message) {}
356
+ virtual ~SyntaxError() throw() {}
357
+ virtual const char *what() const throw() { return msg.c_str(); }
358
+ };
359
+
346
360
  } // namespace Passenger
347
361
 
348
362
  #endif /* _PASSENGER_EXCEPTIONS_H_ */