zeroc-ice 3.8.2 → 3.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. checksums.yaml +4 -4
  2. data/dist/IceRuby/Communicator.cpp +26 -9
  3. data/dist/IceRuby/Config.h +0 -12
  4. data/dist/IceRuby/Connection.cpp +18 -9
  5. data/dist/IceRuby/DefaultSliceLoader.h +1 -1
  6. data/dist/IceRuby/Endpoint.cpp +21 -8
  7. data/dist/IceRuby/Operation.cpp +7 -5
  8. data/dist/IceRuby/Properties.cpp +3 -4
  9. data/dist/IceRuby/Proxy.cpp +11 -19
  10. data/dist/IceRuby/RubySliceLoader.cpp +1 -1
  11. data/dist/IceRuby/RubySliceLoader.h +6 -0
  12. data/dist/IceRuby/Types.cpp +162 -138
  13. data/dist/IceRuby/Types.h +68 -28
  14. data/dist/IceRuby/Util.cpp +14 -78
  15. data/dist/IceRuby/Util.h +7 -17
  16. data/dist/ice/cpp/include/Ice/Communicator.h +31 -8
  17. data/dist/ice/cpp/include/Ice/Config.h +2 -2
  18. data/dist/ice/cpp/include/Ice/Connection.h +24 -8
  19. data/dist/ice/cpp/include/Ice/CtrlCHandler.h +1 -1
  20. data/dist/ice/cpp/include/Ice/Demangle.h +1 -1
  21. data/dist/ice/cpp/include/Ice/Endpoint.h +4 -4
  22. data/dist/ice/cpp/include/Ice/Initialize.h +4 -4
  23. data/dist/ice/cpp/include/Ice/InputStream.h +5 -5
  24. data/dist/ice/cpp/include/Ice/Instrumentation.h +13 -7
  25. data/dist/ice/cpp/include/Ice/LocalExceptions.h +5 -5
  26. data/dist/ice/cpp/include/Ice/Logger.h +7 -0
  27. data/dist/ice/cpp/include/Ice/LoggerUtil.h +1 -1
  28. data/dist/ice/cpp/include/Ice/Object.h +10 -8
  29. data/dist/ice/cpp/include/Ice/ObjectAdapter.h +1 -1
  30. data/dist/ice/cpp/include/Ice/OutgoingAsync.h +5 -2
  31. data/dist/ice/cpp/include/Ice/OutgoingResponse.h +2 -1
  32. data/dist/ice/cpp/include/Ice/OutputStream.h +7 -6
  33. data/dist/ice/cpp/include/Ice/PluginFactory.h +1 -1
  34. data/dist/ice/cpp/include/Ice/Properties.h +3 -3
  35. data/dist/ice/cpp/include/Ice/Proxy.h +192 -50
  36. data/dist/ice/cpp/include/Ice/SSL/ClientAuthenticationOptions.h +3 -3
  37. data/dist/ice/cpp/include/Ice/SSL/EndpointInfo.h +1 -1
  38. data/dist/ice/cpp/include/Ice/SSL/ServerAuthenticationOptions.h +5 -5
  39. data/dist/ice/cpp/include/Ice/ServantLocator.h +1 -1
  40. data/dist/ice/cpp/include/Ice/Service.h +2 -5
  41. data/dist/ice/cpp/include/Ice/SliceLoader.h +1 -1
  42. data/dist/ice/cpp/include/Ice/SlicedData.h +5 -3
  43. data/dist/ice/cpp/include/Ice/StreamHelpers.h +1 -1
  44. data/dist/ice/cpp/include/Ice/StreamableTraits.h +2 -2
  45. data/dist/ice/cpp/include/Ice/StringConverter.h +2 -3
  46. data/dist/ice/cpp/include/Ice/StringUtil.h +2 -7
  47. data/dist/ice/cpp/include/Ice/UUID.h +1 -0
  48. data/dist/ice/cpp/include/Ice/Value.h +2 -2
  49. data/dist/ice/cpp/include/generated/Ice/BuiltinSequences.h +2 -2
  50. data/dist/ice/cpp/include/generated/Ice/Context.h +2 -2
  51. data/dist/ice/cpp/include/generated/Ice/EndpointTypes.h +2 -2
  52. data/dist/ice/cpp/include/generated/Ice/Identity.h +2 -2
  53. data/dist/ice/cpp/include/generated/Ice/Locator.h +50 -14
  54. data/dist/ice/cpp/include/generated/Ice/LocatorRegistry.h +38 -11
  55. data/dist/ice/cpp/include/generated/Ice/Metrics.h +94 -39
  56. data/dist/ice/cpp/include/generated/Ice/OperationMode.h +2 -2
  57. data/dist/ice/cpp/include/generated/Ice/Process.h +34 -8
  58. data/dist/ice/cpp/include/generated/Ice/PropertiesAdmin.h +42 -11
  59. data/dist/ice/cpp/include/generated/Ice/PropertyDict.h +2 -2
  60. data/dist/ice/cpp/include/generated/Ice/RemoteLogger.h +93 -40
  61. data/dist/ice/cpp/include/generated/Ice/ReplyStatus.h +2 -2
  62. data/dist/ice/cpp/include/generated/Ice/Router.h +50 -14
  63. data/dist/ice/cpp/include/generated/Ice/SliceChecksumDict.h +2 -2
  64. data/dist/ice/cpp/include/generated/Ice/Version.h +2 -2
  65. data/dist/ice/cpp/include/generated/IceDiscovery/Lookup.h +66 -14
  66. data/dist/ice/cpp/include/generated/IceLocatorDiscovery/Lookup.h +34 -8
  67. data/dist/ice/cpp/src/Ice/AddDefaultPluginFactories_all.cpp +1 -1
  68. data/dist/ice/cpp/src/Ice/Base64.cpp +47 -137
  69. data/dist/ice/cpp/src/Ice/Base64.h +2 -2
  70. data/dist/ice/cpp/src/Ice/BatchRequestQueue.cpp +28 -13
  71. data/dist/ice/cpp/src/Ice/BatchRequestQueue.h +5 -1
  72. data/dist/ice/cpp/src/Ice/Buffer.cpp +1 -1
  73. data/dist/ice/cpp/src/Ice/CollocatedRequestHandler.cpp +1 -1
  74. data/dist/ice/cpp/src/Ice/CollocatedRequestHandler.h +1 -1
  75. data/dist/ice/cpp/src/Ice/Communicator.cpp +4 -3
  76. data/dist/ice/cpp/src/Ice/CommunicatorFlushBatchAsync.cpp +8 -0
  77. data/dist/ice/cpp/src/Ice/ConnectRequestHandler.cpp +5 -15
  78. data/dist/ice/cpp/src/Ice/ConnectRequestHandler.h +1 -1
  79. data/dist/ice/cpp/src/Ice/ConnectionFactory.cpp +6 -8
  80. data/dist/ice/cpp/src/Ice/ConnectionFactory.h +0 -3
  81. data/dist/ice/cpp/src/Ice/ConnectionI.cpp +94 -99
  82. data/dist/ice/cpp/src/Ice/ConnectionI.h +11 -8
  83. data/dist/ice/cpp/src/Ice/ConsoleUtil.cpp +1 -1
  84. data/dist/ice/cpp/src/Ice/DefaultsAndOverrides.cpp +10 -14
  85. data/dist/ice/cpp/src/Ice/EndpointI.h +1 -1
  86. data/dist/ice/cpp/src/Ice/FileUtil.cpp +12 -12
  87. data/dist/ice/cpp/src/Ice/FixedRequestHandler.cpp +1 -1
  88. data/dist/ice/cpp/src/Ice/FixedRequestHandler.h +1 -1
  89. data/dist/ice/cpp/src/Ice/HttpParser.h +0 -2
  90. data/dist/ice/cpp/src/Ice/IdleTimeoutTransceiverDecorator.cpp +6 -3
  91. data/dist/ice/cpp/src/Ice/IncomingRequest.cpp +1 -3
  92. data/dist/ice/cpp/src/Ice/InputStream.cpp +23 -19
  93. data/dist/ice/cpp/src/Ice/Instance.cpp +73 -50
  94. data/dist/ice/cpp/src/Ice/Instance.h +1 -6
  95. data/dist/ice/cpp/src/Ice/LocalExceptions.cpp +1 -1
  96. data/dist/ice/cpp/src/Ice/LocatorInfo.cpp +2 -2
  97. data/dist/ice/cpp/src/Ice/LoggerAdminI.cpp +13 -18
  98. data/dist/ice/cpp/src/Ice/LoggerI.cpp +1 -1
  99. data/dist/ice/cpp/src/Ice/LoggerI.h +2 -2
  100. data/dist/ice/cpp/src/Ice/MetricsAdminI.h +6 -1
  101. data/dist/ice/cpp/src/Ice/MetricsObserverI.h +22 -18
  102. data/dist/ice/cpp/src/Ice/NativePropertiesAdmin.cpp +5 -2
  103. data/dist/ice/cpp/src/Ice/Network.cpp +168 -103
  104. data/dist/ice/cpp/src/Ice/Network.h +12 -7
  105. data/dist/ice/cpp/src/Ice/NetworkProxy.cpp +17 -6
  106. data/dist/ice/cpp/src/Ice/NetworkProxy.h +2 -1
  107. data/dist/ice/cpp/src/Ice/Object.cpp +1 -1
  108. data/dist/ice/cpp/src/Ice/ObjectAdapterI.cpp +56 -19
  109. data/dist/ice/cpp/src/Ice/OpaqueEndpointI.cpp +10 -10
  110. data/dist/ice/cpp/src/Ice/Options.cpp +7 -2
  111. data/dist/ice/cpp/src/Ice/OutgoingAsync.cpp +1 -1
  112. data/dist/ice/cpp/src/Ice/OutputStream.cpp +4 -4
  113. data/dist/ice/cpp/src/Ice/PluginManagerI.cpp +7 -1
  114. data/dist/ice/cpp/src/Ice/Properties.cpp +26 -16
  115. data/dist/ice/cpp/src/Ice/PropertyUtil.cpp +1 -1
  116. data/dist/ice/cpp/src/Ice/ProtocolInstance.cpp +0 -11
  117. data/dist/ice/cpp/src/Ice/ProtocolInstance.h +1 -2
  118. data/dist/ice/cpp/src/Ice/Proxy.cpp +9 -1
  119. data/dist/ice/cpp/src/Ice/ProxyAsync.cpp +110 -13
  120. data/dist/ice/cpp/src/Ice/Random.cpp +68 -7
  121. data/dist/ice/cpp/src/Ice/Random.h +6 -2
  122. data/dist/ice/cpp/src/Ice/Reference.cpp +22 -11
  123. data/dist/ice/cpp/src/Ice/Reference.h +3 -0
  124. data/dist/ice/cpp/src/Ice/ReferenceFactory.cpp +10 -0
  125. data/dist/ice/cpp/src/Ice/RequestHandler.h +3 -1
  126. data/dist/ice/cpp/src/Ice/RequestHandlerCache.cpp +1 -1
  127. data/dist/ice/cpp/src/Ice/RequestHandlerCache.h +1 -1
  128. data/dist/ice/cpp/src/Ice/ResourceConfig.h +3 -3
  129. data/dist/ice/cpp/src/Ice/RetryQueue.cpp +8 -12
  130. data/dist/ice/cpp/src/Ice/SHA1.cpp +11 -11
  131. data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.cpp +0 -6
  132. data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.h +0 -6
  133. data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngine.cpp +15 -1
  134. data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.cpp +77 -27
  135. data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.h +2 -1
  136. data/dist/ice/cpp/src/Ice/SSL/RFC2253.cpp +2 -2
  137. data/dist/ice/cpp/src/Ice/SSL/SSLUtil.cpp +39 -34
  138. data/dist/ice/cpp/src/Ice/SSL/SchannelEngine.cpp +130 -52
  139. data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.cpp +64 -33
  140. data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.h +0 -1
  141. data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngine.cpp +3 -3
  142. data/dist/ice/cpp/src/Ice/SSL/SecureTransportTransceiverI.cpp +9 -3
  143. data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.cpp +73 -51
  144. data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.h +0 -8
  145. data/dist/ice/cpp/src/Ice/Selector.cpp +13 -11
  146. data/dist/ice/cpp/src/Ice/ServantManager.cpp +3 -3
  147. data/dist/ice/cpp/src/Ice/Service.cpp +33 -115
  148. data/dist/ice/cpp/src/Ice/StreamSocket.cpp +33 -40
  149. data/dist/ice/cpp/src/Ice/StreamSocket.h +4 -4
  150. data/dist/ice/cpp/src/Ice/StringConverter.cpp +1 -1
  151. data/dist/ice/cpp/src/Ice/StringUtil.cpp +12 -21
  152. data/dist/ice/cpp/src/Ice/SysLoggerI.cpp +136 -100
  153. data/dist/ice/cpp/src/Ice/SysLoggerI.h +7 -3
  154. data/dist/ice/cpp/src/Ice/SystemdJournalI.cpp +1 -1
  155. data/dist/ice/cpp/src/Ice/TcpAcceptor.cpp +7 -7
  156. data/dist/ice/cpp/src/Ice/TcpAcceptor.h +2 -1
  157. data/dist/ice/cpp/src/Ice/TcpBufSize.h +40 -0
  158. data/dist/ice/cpp/src/Ice/TcpConnector.cpp +5 -2
  159. data/dist/ice/cpp/src/Ice/TcpConnector.h +2 -0
  160. data/dist/ice/cpp/src/Ice/TcpTransceiver.cpp +6 -2
  161. data/dist/ice/cpp/src/Ice/ThreadPool.cpp +2 -8
  162. data/dist/ice/cpp/src/Ice/ThreadPool.h +0 -2
  163. data/dist/ice/cpp/src/Ice/Timer.cpp +7 -3
  164. data/dist/ice/cpp/src/Ice/UUID.cpp +1 -2
  165. data/dist/ice/cpp/src/Ice/UdpEndpointI.cpp +4 -1
  166. data/dist/ice/cpp/src/Ice/UdpTransceiver.cpp +136 -123
  167. data/dist/ice/cpp/src/Ice/UdpTransceiver.h +3 -4
  168. data/dist/ice/cpp/src/Ice/WSTransceiver.cpp +96 -27
  169. data/dist/ice/cpp/src/Ice/WSTransceiver.h +1 -1
  170. data/dist/ice/cpp/src/Ice/generated/BuiltinSequences.cpp +2 -2
  171. data/dist/ice/cpp/src/Ice/generated/Context.cpp +2 -2
  172. data/dist/ice/cpp/src/Ice/generated/EndpointTypes.cpp +2 -2
  173. data/dist/ice/cpp/src/Ice/generated/Identity.cpp +2 -2
  174. data/dist/ice/cpp/src/Ice/generated/Locator.cpp +2 -2
  175. data/dist/ice/cpp/src/Ice/generated/LocatorRegistry.cpp +2 -2
  176. data/dist/ice/cpp/src/Ice/generated/Metrics.cpp +2 -2
  177. data/dist/ice/cpp/src/Ice/generated/OperationMode.cpp +2 -2
  178. data/dist/ice/cpp/src/Ice/generated/Process.cpp +2 -2
  179. data/dist/ice/cpp/src/Ice/generated/PropertiesAdmin.cpp +2 -2
  180. data/dist/ice/cpp/src/Ice/generated/PropertyDict.cpp +2 -2
  181. data/dist/ice/cpp/src/Ice/generated/RemoteLogger.cpp +2 -2
  182. data/dist/ice/cpp/src/Ice/generated/ReplyStatus.cpp +2 -2
  183. data/dist/ice/cpp/src/Ice/generated/Router.cpp +2 -2
  184. data/dist/ice/cpp/src/Ice/generated/SliceChecksumDict.cpp +2 -2
  185. data/dist/ice/cpp/src/Ice/generated/Version.cpp +2 -2
  186. data/dist/ice/cpp/src/IceDiscovery/LookupI.cpp +47 -9
  187. data/dist/ice/cpp/src/IceDiscovery/LookupI.h +8 -3
  188. data/dist/ice/cpp/src/IceDiscovery/generated/Lookup.cpp +2 -2
  189. data/dist/ice/cpp/src/IceLocatorDiscovery/PluginI.cpp +43 -14
  190. data/dist/ice/cpp/src/IceLocatorDiscovery/generated/Lookup.cpp +2 -2
  191. data/dist/ice/cpp/src/Slice/DocCommentParser.cpp +26 -20
  192. data/dist/ice/cpp/src/Slice/DocCommentParser.h +2 -2
  193. data/dist/ice/cpp/src/Slice/FileTracker.cpp +3 -11
  194. data/dist/ice/cpp/src/Slice/FileTracker.h +0 -2
  195. data/dist/ice/cpp/src/Slice/Grammar.cpp +211 -210
  196. data/dist/ice/cpp/src/Slice/MetadataValidation.cpp +10 -9
  197. data/dist/ice/cpp/src/Slice/Parser.cpp +28 -20
  198. data/dist/ice/cpp/src/Slice/Parser.h +3 -4
  199. data/dist/ice/cpp/src/Slice/Preprocessor.cpp +3 -11
  200. data/dist/ice/cpp/src/Slice/Preprocessor.h +0 -2
  201. data/dist/ice/cpp/src/Slice/Scanner.cpp +3 -3
  202. data/dist/ice/cpp/src/Slice/SliceUtil.cpp +197 -114
  203. data/dist/ice/cpp/src/Slice/StringLiteralUtil.cpp +0 -2
  204. data/dist/ice/cpp/src/Slice/Util.h +21 -9
  205. data/dist/ice/cpp/src/slice2rb/Ruby.cpp +7 -3
  206. data/dist/ice/cpp/src/slice2rb/RubyUtil.cpp +16 -12
  207. data/dist/ice/cpp/src/slice2rb/RubyUtil.h +3 -3
  208. data/dist/ice/slice/Glacier2/Router.ice +3 -3
  209. data/dist/ice/slice/Ice/Metrics.ice +6 -5
  210. data/dist/ice/slice/Ice/RemoteLogger.ice +5 -5
  211. data/dist/ice/slice/IceGrid/Admin.ice +9 -9
  212. data/dist/ice/slice/IceGrid/Descriptor.ice +5 -5
  213. data/dist/ice/slice/IceStorm/Metrics.ice +1 -1
  214. data/dist/lib/Glacier2/Metrics.rb +1 -1
  215. data/dist/lib/Glacier2/PermissionsVerifier.rb +1 -1
  216. data/dist/lib/Glacier2/Router.rb +2 -2
  217. data/dist/lib/Glacier2/SSLInfo.rb +1 -1
  218. data/dist/lib/Glacier2/Session.rb +1 -1
  219. data/dist/lib/Ice/BuiltinSequences.rb +1 -1
  220. data/dist/lib/Ice/CompressBatch.rb +1 -2
  221. data/dist/lib/Ice/Context.rb +1 -1
  222. data/dist/lib/Ice/EndpointSelectionType.rb +1 -2
  223. data/dist/lib/Ice/EndpointTypes.rb +1 -1
  224. data/dist/lib/Ice/Identity.rb +1 -1
  225. data/dist/lib/Ice/IdentitySpaceship.rb +1 -0
  226. data/dist/lib/Ice/Locator.rb +1 -1
  227. data/dist/lib/Ice/LocatorRegistry.rb +1 -1
  228. data/dist/lib/Ice/Metrics.rb +1 -1
  229. data/dist/lib/Ice/OperationMode.rb +2 -3
  230. data/dist/lib/Ice/Process.rb +1 -1
  231. data/dist/lib/Ice/PropertiesAdmin.rb +1 -1
  232. data/dist/lib/Ice/PropertyDict.rb +1 -1
  233. data/dist/lib/Ice/RemoteLogger.rb +2 -3
  234. data/dist/lib/Ice/ReplyStatus.rb +2 -3
  235. data/dist/lib/Ice/Router.rb +1 -1
  236. data/dist/lib/Ice/SliceChecksumDict.rb +1 -1
  237. data/dist/lib/Ice/SliceUtil.rb +2 -2
  238. data/dist/lib/Ice/Struct.rb +1 -0
  239. data/dist/lib/Ice/ToStringMode.rb +1 -2
  240. data/dist/lib/Ice/Value.rb +2 -2
  241. data/dist/lib/Ice/Version.rb +1 -1
  242. data/dist/lib/IceBox/ServiceManager.rb +1 -1
  243. data/dist/lib/IceGrid/Admin.rb +3 -4
  244. data/dist/lib/IceGrid/Descriptor.rb +1 -1
  245. data/dist/lib/IceGrid/Exception.rb +1 -1
  246. data/dist/lib/IceGrid/FileParser.rb +1 -1
  247. data/dist/lib/IceGrid/Registry.rb +2 -3
  248. data/dist/lib/IceGrid/Session.rb +2 -2
  249. data/dist/lib/IceGrid/UserAccountMapper.rb +1 -1
  250. data/dist/lib/IceStorm/IceStorm.rb +1 -1
  251. data/dist/lib/IceStorm/Metrics.rb +1 -1
  252. data/extconf.rb +1 -1
  253. data/ice.gemspec +3 -3
  254. metadata +4 -5
  255. data/dist/ice/cpp/src/Ice/DLLMain.cpp +0 -40
  256. data/dist/ice/cpp/src/Ice/UndefSysMacros.h +0 -37
@@ -10,6 +10,7 @@
10
10
  #include <cctype>
11
11
  #include <climits>
12
12
  #include <cstring>
13
+ #include <iomanip>
13
14
 
14
15
  #ifndef _MSC_VER
15
16
  # include <unistd.h> // For readlink()
@@ -19,6 +20,112 @@ using namespace std;
19
20
  using namespace Slice;
20
21
  using namespace IceInternal;
21
22
 
23
+ namespace
24
+ {
25
+ void writeDependencies(const string& dependencies, const string& dependFile)
26
+ {
27
+ if (dependFile.empty())
28
+ {
29
+ consoleOut << dependencies << flush;
30
+ }
31
+ else
32
+ {
33
+ ofstream of(IceInternal::streamFilename(dependFile).c_str()); // dependFile is a UTF-8 string
34
+ if (!of)
35
+ {
36
+ ostringstream os;
37
+ os << "cannot open file '" << dependFile << "': " << IceInternal::errorToString(errno);
38
+ throw Slice::FileException(os.str());
39
+ }
40
+ of << dependencies;
41
+ of.close();
42
+ }
43
+ }
44
+
45
+ // Escapes a file name and wraps it in double quotes, to produce a JSON string.
46
+ string toJSONString(string_view name)
47
+ {
48
+ ostringstream os;
49
+ os << '"';
50
+ for (char c : name)
51
+ {
52
+ switch (c)
53
+ {
54
+ case '"':
55
+ os << "\\\"";
56
+ break;
57
+ case '\\':
58
+ os << "\\\\";
59
+ break;
60
+ case '\b':
61
+ os << "\\b";
62
+ break;
63
+ case '\f':
64
+ os << "\\f";
65
+ break;
66
+ case '\n':
67
+ os << "\\n";
68
+ break;
69
+ case '\r':
70
+ os << "\\r";
71
+ break;
72
+ case '\t':
73
+ os << "\\t";
74
+ break;
75
+ default:
76
+ if (static_cast<unsigned char>(c) < 0x20)
77
+ {
78
+ // The remaining control characters have no short escape sequence.
79
+ os << "\\u" << setfill('0') << setw(4) << hex << static_cast<int>(static_cast<unsigned char>(c))
80
+ << dec;
81
+ }
82
+ else
83
+ {
84
+ // Any other character is written as is, including the bytes of a multi-byte UTF-8 sequence.
85
+ os << c;
86
+ }
87
+ break;
88
+ }
89
+ }
90
+ os << '"';
91
+ return os.str();
92
+ }
93
+
94
+ // Escapes a file name for use in a Makefile rule, following the escaping rules GCC uses in the dependency
95
+ // files it emits: '$' becomes '$$'; '#', space, and tab get a preceding backslash; and backslashes
96
+ // immediately preceding a space or tab are doubled.
97
+ string escapeMakefilePath(string_view name)
98
+ {
99
+ ostringstream os;
100
+ size_t backslashes = 0;
101
+ for (char c : name)
102
+ {
103
+ switch (c)
104
+ {
105
+ case ' ':
106
+ case '\t':
107
+ for (size_t i = 0; i < backslashes; ++i)
108
+ {
109
+ os << '\\';
110
+ }
111
+ os << '\\';
112
+ break;
113
+ case '#':
114
+ os << '\\';
115
+ break;
116
+ case '$':
117
+ os << '$';
118
+ break;
119
+ default:
120
+ break;
121
+ }
122
+ backslashes = (c == '\\') ? backslashes + 1 : 0;
123
+ os << c;
124
+ }
125
+ return os.str();
126
+ }
127
+ }
128
+
22
129
  string
23
130
  Slice::normalizePath(const string& path)
24
131
  {
@@ -172,7 +279,9 @@ Slice::changeInclude(const string& p, const vector<string>& includePaths)
172
279
  {
173
280
  for (const auto& includePath : includePaths)
174
281
  {
175
- if (i.compare(0, includePath.length(), includePath) == 0)
282
+ // The prefix test needs a path boundary, or "/a/b" would cover a file under "/a/bc".
283
+ if (i.length() > includePath.length() + 1 && i[includePath.length()] == '/' &&
284
+ i.compare(0, includePath.length(), includePath) == 0)
176
285
  {
177
286
  string s = i.substr(includePath.length() + 1); // + 1 for the '/'
178
287
  if (s.size() < result.size())
@@ -316,8 +425,6 @@ Slice::emitRaw(const char* message)
316
425
  vector<string>
317
426
  Slice::filterMcppWarnings(const string& message)
318
427
  {
319
- static const char* messages[] = {"Converted [CR+LF] to [LF]", "no newline, supplemented newline", nullptr};
320
-
321
428
  constexpr string_view warningPrefix = "warning:";
322
429
  constexpr string_view fromPrefix = "from";
323
430
  constexpr string_view separators = "\n\t ";
@@ -330,60 +437,34 @@ Slice::filterMcppWarnings(const string& message)
330
437
  in.push_back(message.substr(start, end - start));
331
438
  start = end + 1;
332
439
  }
440
+
333
441
  vector<string> out;
334
- bool skipped;
335
- for (auto i = in.begin(); i != in.end(); i++)
442
+ for (auto i = in.begin(); i != in.end();)
336
443
  {
337
- skipped = false;
444
+ bool hasWarningPrefix = i->find(warningPrefix) != string::npos;
445
+ bool hasFilterableWarning = i->find("Converted [CR+LF] to [LF]") != string::npos ||
446
+ i->find("no newline, supplemented newline") != string::npos;
338
447
 
339
- if (i->find(warningPrefix) != string::npos)
448
+ if (hasWarningPrefix && hasFilterableWarning)
340
449
  {
341
- for (int j = 0; messages[j] != nullptr; ++j)
450
+ // MCPP warnings are multi-line. The first line contains the warning message, followed by a single-line text
451
+ // snippet of the code that produced the warning. After this can follow any number of "from" lines.
452
+ assert(std::distance(i, in.end()) >= 2); // Assert there's at least 2 lines to skip (message & snippet).
453
+
454
+ // Immediately skip 2 lines (the message and the snippet). Then skip any "from" lines that followed them.
455
+ for (i += 2; i != in.end(); i++)
342
456
  {
343
- if (i->find(messages[j]) != string::npos)
457
+ string::size_type index = i->find_first_not_of(separators);
458
+ if (index == string::npos || i->find(fromPrefix, index) != index)
344
459
  {
345
- // This line should be skipped it contains the unwanted mcpp warning
346
- // next line should also be skipped it contains the slice line that
347
- // produces the skipped warning
348
- i++;
349
- skipped = true;
350
- //
351
- // Check if next lines are still the same warning
352
- //
353
- i++;
354
- while (i != in.end())
355
- {
356
- string token = *i;
357
- string::size_type index = token.find_first_not_of(separators);
358
- if (index != string::npos)
359
- {
360
- token = token.substr(index);
361
- }
362
- if (token.find(fromPrefix) != 0)
363
- {
364
- //
365
- // First line not of this warning
366
- //
367
- i--;
368
- break;
369
- }
370
- else
371
- {
372
- i++;
373
- }
374
- }
375
- break;
460
+ break; // This line isn't part of the warning we're skipping. Break, and go back to the outer loop.
376
461
  }
377
462
  }
378
- if (i == in.end())
379
- {
380
- break;
381
- }
382
- }
383
- if (!skipped)
384
- {
385
- out.push_back(*i + "\n");
463
+ continue; // Continue to the next loop iteration, to check if it's a warning that should be filtered out.
386
464
  }
465
+
466
+ // Add this line to the output, and move to the next line. We only reach here if the line wasn't filtered out.
467
+ out.push_back(*i++ + "\n");
387
468
  }
388
469
  return out;
389
470
  }
@@ -401,27 +482,6 @@ Slice::printGeneratedHeader(IceInternal::Output& out, string_view path, string_v
401
482
  out << nl << commentStyle << " <auto-generated>Generated from Slice file '" << path << "'.</auto-generated>";
402
483
  }
403
484
 
404
- void
405
- Slice::writeDependencies(const string& dependencies, const string& dependFile)
406
- {
407
- if (dependFile.empty())
408
- {
409
- consoleOut << dependencies << flush;
410
- }
411
- else
412
- {
413
- ofstream of(IceInternal::streamFilename(dependFile).c_str()); // dependFile is a UTF-8 string
414
- if (!of)
415
- {
416
- ostringstream os;
417
- os << "cannot open file '" << dependFile << "': " << IceInternal::errorToString(errno);
418
- throw Slice::FileException(os.str());
419
- }
420
- of << dependencies;
421
- of.close();
422
- }
423
- }
424
-
425
485
  #ifdef _WIN32
426
486
  vector<string>
427
487
  Slice::argvToArgs(int argc, wchar_t* argv[])
@@ -451,33 +511,20 @@ Slice::argvToArgs(int argc, char* argv[])
451
511
  // Split a scoped name into its components and return the components as a list of (unscoped) identifiers.
452
512
  //
453
513
  vector<string>
454
- Slice::splitScopedName(const string& scoped, bool allowEmpty)
514
+ Slice::splitScopedName(const string& scoped)
455
515
  {
456
- assert(scoped[0] == ':');
516
+ assert(scoped.compare(0, 2, "::") == 0); // must be a fully-scoped identifier
517
+ assert(scoped.back() != ':'); // must end with an identifier (not just "::")
518
+
457
519
  vector<string> ids;
458
- string::size_type next = 0;
520
+ string::size_type next = 2; // skip the leading "::"
459
521
  string::size_type pos;
460
522
  while ((pos = scoped.find("::", next)) != string::npos)
461
523
  {
462
- pos += 2;
463
- if (pos != scoped.size())
464
- {
465
- string::size_type endpos = scoped.find("::", pos);
466
- if (endpos != string::npos)
467
- {
468
- ids.push_back(scoped.substr(pos, endpos - pos));
469
- }
470
- }
471
- next = pos;
472
- }
473
- if (next != scoped.size())
474
- {
475
- ids.push_back(scoped.substr(next));
476
- }
477
- else if (allowEmpty)
478
- {
479
- ids.emplace_back("");
524
+ ids.push_back(scoped.substr(next, pos - next));
525
+ next = pos + 2;
480
526
  }
527
+ ids.push_back(scoped.substr(next));
481
528
 
482
529
  return ids;
483
530
  }
@@ -667,6 +714,45 @@ Slice::relativePath(const string& path1, const string& path2)
667
714
  return newPath;
668
715
  }
669
716
 
717
+ string
718
+ Slice::escapeXMLAttribute(string_view name)
719
+ {
720
+ ostringstream os;
721
+ for (char c : name)
722
+ {
723
+ switch (c)
724
+ {
725
+ case '&':
726
+ os << "&amp;";
727
+ break;
728
+ case '<':
729
+ os << "&lt;";
730
+ break;
731
+ case '>':
732
+ os << "&gt;";
733
+ break;
734
+ case '"':
735
+ os << "&quot;";
736
+ break;
737
+ // An XML parser replaces a literal tab, line feed or carriage return in an attribute value by a
738
+ // space. Character references survive this normalization.
739
+ case '\t':
740
+ os << "&#x9;";
741
+ break;
742
+ case '\n':
743
+ os << "&#xA;";
744
+ break;
745
+ case '\r':
746
+ os << "&#xD;";
747
+ break;
748
+ default:
749
+ os << c;
750
+ break;
751
+ }
752
+ }
753
+ return os.str();
754
+ }
755
+
670
756
  void
671
757
  Slice::DependencyGenerator::addDependenciesFor(const UnitPtr& unit)
672
758
  {
@@ -674,30 +760,23 @@ Slice::DependencyGenerator::addDependenciesFor(const UnitPtr& unit)
674
760
  }
675
761
 
676
762
  void
677
- Slice::DependencyGenerator::writeMakefileDependencies(
678
- const string& dependFile,
679
- const string& source,
680
- const string& target)
763
+ Slice::DependencyGenerator::addMakefileRule(const string& source, const string& target)
764
+ {
765
+ _makefileRules.emplace_back(source, target);
766
+ }
767
+
768
+ void
769
+ Slice::DependencyGenerator::writeMakefileDependencies(const string& dependFile)
681
770
  {
682
771
  ostringstream os;
683
- StringList dependencies = _dependencyMap[source];
684
- // Write the target
685
- if (dependencies.empty())
772
+ for (const auto& [source, target] : _makefileRules)
686
773
  {
687
- os << target << ":" << std::endl;
688
- }
689
- else
690
- {
691
- os << target << ": \\" << std::endl;
692
- for (const auto& dependency : dependencies)
774
+ os << escapeMakefilePath(target) << ":";
775
+ for (const auto& dependency : _dependencyMap[source])
693
776
  {
694
- os << " " << dependency;
695
- if (dependency != dependencies.back())
696
- {
697
- os << " \\";
698
- }
699
- os << std::endl;
777
+ os << " \\" << endl << " " << escapeMakefilePath(dependency);
700
778
  }
779
+ os << endl;
701
780
  }
702
781
  writeDependencies(os.str(), dependFile);
703
782
  }
@@ -712,11 +791,10 @@ Slice::DependencyGenerator::writeXMLDependencies(const string& dependFile)
712
791
  {
713
792
  string source = dependencies.front();
714
793
  dependencies.pop_front();
715
- string dirName = Slice::dirName(source);
716
- os << endl << " <source name=\"" << source << "\">";
794
+ os << endl << " <source name=\"" << escapeXMLAttribute(source) << "\">";
717
795
  for (const auto& dependency : dependencies)
718
796
  {
719
- os << endl << " <dependsOn name=\"" << dependency << "\" />";
797
+ os << endl << " <dependsOn name=\"" << escapeXMLAttribute(dependency) << "\" />";
720
798
  }
721
799
  os << endl << " </source>";
722
800
  }
@@ -729,14 +807,19 @@ Slice::DependencyGenerator::writeJSONDependencies(const string& dependFile)
729
807
  {
730
808
  ostringstream os;
731
809
  os << "{";
810
+ bool firstSource = true;
732
811
  for (auto [_, dependencies] : _dependencyMap)
733
812
  {
734
813
  string source = dependencies.front();
735
814
  dependencies.pop_front();
736
- os << endl << " \"" << source << "\" : [";
815
+ os << (firstSource ? "" : ",") << endl << " " << toJSONString(source) << " : [";
816
+ firstSource = false;
817
+
818
+ bool firstDependency = true;
737
819
  for (const auto& dependency : dependencies)
738
820
  {
739
- os << endl << " \"" << dependency << "\"";
821
+ os << (firstDependency ? "" : ",") << endl << " " << toJSONString(dependency);
822
+ firstDependency = false;
740
823
  }
741
824
  os << endl << " ]";
742
825
  }
@@ -384,8 +384,6 @@ Slice::toStringLiteral(
384
384
  }
385
385
  else
386
386
  {
387
- assert(escapeMode == Octal);
388
-
389
387
  for (size_t i = 0; i < value.size(); ++i)
390
388
  {
391
389
  char c = value[i];
@@ -59,9 +59,7 @@ namespace Slice
59
59
  EscapeMode escapeMode,
60
60
  unsigned char cutOff);
61
61
 
62
- void writeDependencies(const std::string& dependencies, const std::string& dependFile);
63
-
64
- std::vector<std::string> splitScopedName(const std::string& scoped, bool allowEmpty = true);
62
+ std::vector<std::string> splitScopedName(const std::string& scoped);
65
63
 
66
64
  /// Returns "an" if @p s starts with a vowel and "a" otherwise.
67
65
  std::string getArticleFor(const std::string& s);
@@ -92,25 +90,36 @@ namespace Slice
92
90
 
93
91
  [[nodiscard]] std::string relativePath(const std::string& path1, const std::string& path2);
94
92
 
93
+ /// Escapes a file name for use in a double-quoted XML attribute value.
94
+ /// @param name The file name to escape.
95
+ /// @return The escaped file name.
96
+ [[nodiscard]] std::string escapeXMLAttribute(std::string_view name);
97
+
95
98
  /// The DependencyGenerator class is used to collect dependencies of Slice units.
96
99
  class DependencyGenerator final
97
100
  {
98
101
  public:
99
102
  void addDependenciesFor(const UnitPtr& unit);
100
103
 
104
+ /// Records a Makefile rule for a file that is generated from the specified source. The rule's prerequisites
105
+ /// are the dependencies recorded for the source by addDependenciesFor.
106
+ ///
107
+ /// @param source The source file that the target is generated from.
108
+ /// @param target The generated file, used as the Makefile target.
109
+ void addMakefileRule(const std::string& source, const std::string& target);
110
+
101
111
  /// Writes the dependencies in Makefile format to the specified file. If 'dependFile' is empty, it writes the
102
112
  /// dependencies to standard output instead.
103
113
  ///
114
+ /// This method writes one rule for each target recorded with addMakefileRule.
115
+ ///
104
116
  /// @param dependFile The file to write the dependencies to or empty to write to standard output.
105
- /// @param source The source file for which dependencies are being written.
106
- /// @param target The target file that is generated from the source. This is used as the Makefile target.
107
- void
108
- writeMakefileDependencies(const std::string& dependFile, const std::string& source, const std::string& target);
117
+ void writeMakefileDependencies(const std::string& dependFile);
109
118
 
110
119
  /// Writes the dependencies in XML format to the specified file. If 'dependFile' is empty, it writes the
111
120
  /// dependencies to standard output instead.
112
121
  ///
113
- /// This method write the dependencies for all visited units in a single XML document.
122
+ /// This method writes the dependencies for all visited units in a single XML document.
114
123
  ///
115
124
  /// @param dependFile The file to write the dependencies to or empty to write to standard output.
116
125
  void writeXMLDependencies(const std::string& dependFile);
@@ -118,13 +127,16 @@ namespace Slice
118
127
  /// Writes the dependencies in JSON format to the specified file. If 'dependFile' is empty, it writes the
119
128
  /// dependencies to standard output instead.
120
129
  ///
121
- /// This method write the dependencies for all visited units in a single JSON document.
130
+ /// This method writes the dependencies for all visited units in a single JSON document.
122
131
  ///
123
132
  /// @param dependFile The file to write the dependencies to or empty to write to standard output.
124
133
  void writeJSONDependencies(const std::string& dependFile);
125
134
 
126
135
  private:
127
136
  std::map<std::string, StringList> _dependencyMap;
137
+
138
+ // The rules recorded by addMakefileRule: (source, target) pairs, in recording order.
139
+ std::vector<std::pair<std::string, std::string>> _makefileRules;
128
140
  };
129
141
 
130
142
  /// Helper method to create the directory structure for a package path.
@@ -171,9 +171,9 @@ Slice::Ruby::compile(const vector<string>& argv)
171
171
  if (depend)
172
172
  {
173
173
  string target = removeExtension(baseName(fileName)) + ".rb";
174
- dependencyGenerator.writeMakefileDependencies(dependFile, unit->topLevelFile(), target);
174
+ dependencyGenerator.addMakefileRule(unit->topLevelFile(), target);
175
175
  }
176
- // Else XML dependencies are written below after all units have been processed.
176
+ // The dependencies are written below, after all units have been processed.
177
177
  }
178
178
  else
179
179
  {
@@ -241,7 +241,11 @@ Slice::Ruby::compile(const vector<string>& argv)
241
241
  return status;
242
242
  }
243
243
 
244
- if (dependXML)
244
+ if (depend)
245
+ {
246
+ dependencyGenerator.writeMakefileDependencies(dependFile);
247
+ }
248
+ else if (dependXML)
245
249
  {
246
250
  dependencyGenerator.writeXMLDependencies(dependFile);
247
251
  }
@@ -15,16 +15,19 @@ using namespace IceInternal;
15
15
 
16
16
  namespace
17
17
  {
18
- string getEscapedRubyParamName(const OperationPtr& p, const string& name)
18
+ // Returns the name of the synthesized trailing 'context' parameter for a generated proxy method. It is escaped
19
+ // to 'context_' when an in-parameter's lower-cased mapped name is already 'context' (e.g. a parameter named
20
+ // 'Context'), to avoid emitting a duplicate parameter name in the method signature.
21
+ string getEscapedContextParam(const OperationPtr& p)
19
22
  {
20
- for (const auto& param : p->parameters())
23
+ for (const auto& param : p->inParameters())
21
24
  {
22
- if (Slice::Ruby::getMappedName(param) == name)
25
+ if (Slice::Ruby::getMappedName(param, Slice::Ruby::IdentToLower) == "context")
23
26
  {
24
- return name + "_";
27
+ return "context_";
25
28
  }
26
29
  }
27
- return name;
30
+ return "context";
28
31
  }
29
32
  }
30
33
 
@@ -319,7 +322,7 @@ Slice::Ruby::CodeVisitor::visitInterfaceDefStart(const InterfaceDefPtr& p)
319
322
  {
320
323
  _out << inParams << ", ";
321
324
  }
322
- const string contextParamName = getEscapedRubyParamName(op, "context");
325
+ const string contextParamName = getEscapedContextParam(op);
323
326
  _out << contextParamName << "=nil)";
324
327
  _out.inc();
325
328
  _out << nl << proxyName << "_mixin::OP_" << op->name() << ".invoke(self, [" << inParams;
@@ -463,8 +466,9 @@ Slice::Ruby::CodeVisitor::visitInterfaceDefStart(const InterfaceDefPtr& p)
463
466
  if (op->isDeprecated())
464
467
  {
465
468
  // Get the deprecation reason if present, or default to an empty string.
466
- string reason = op->getDeprecationReason().value_or("");
467
- _out << nl << proxyName << "_mixin::OP_" << opName << ".deprecate(\"" << reason << "\")";
469
+ const string reason = op->getDeprecationReason().value_or("");
470
+ const string escapedReason = toStringLiteral(reason, "\a\b\f\n\r\t\v\x20\x1b", "#", EC6UCN, 0);
471
+ _out << nl << proxyName << "_mixin::OP_" << opName << ".deprecate(\"" << escapedReason << "\")";
468
472
  }
469
473
  }
470
474
 
@@ -778,9 +782,7 @@ Slice::Ruby::CodeVisitor::visitEnum(const EnumPtr& p)
778
782
  //
779
783
  _out << sp << nl << "def <=>(other)";
780
784
  _out.inc();
781
- _out << nl << "other.is_a?(" << name << ") or raise ArgumentError, \"value must be " << getArticleFor(name) << ' '
782
- << name << "\"";
783
- _out << nl << "@value <=> other.to_i";
785
+ _out << nl << "@value <=> other.to_i if other.is_a?(" << name << ")";
784
786
  _out.dec();
785
787
  _out << nl << "end";
786
788
 
@@ -1002,7 +1004,9 @@ Slice::Ruby::CodeVisitor::writeConstantValue(
1002
1004
  case Builtin::KindString:
1003
1005
  {
1004
1006
  // RubyUCN available in Ruby 1.9 or greater
1005
- _out << "\"" << toStringLiteral(value, "\a\b\f\n\r\t\v\x20\x1b", "", EC6UCN, 0) << "\"";
1007
+ // Escape '#' so that '#{', '#@', and '#$' are not interpreted as interpolation in the
1008
+ // double-quoted Ruby string literal.
1009
+ _out << "\"" << toStringLiteral(value, "\a\b\f\n\r\t\v\x20\x1b", "#", EC6UCN, 0) << "\"";
1006
1010
  break;
1007
1011
  }
1008
1012
 
@@ -31,13 +31,13 @@ namespace Slice::Ruby
31
31
  std::string getMappedName(const ContainedPtr& p, IdentStyle style = IdentNormal);
32
32
 
33
33
  /// Returns the fully-qualified mapped-identifier of the provided Slice element.
34
- /// This is equivalent to calling `getMappedName` on @p p and all it's containers.
34
+ /// This is equivalent to calling `getMappedName` on @p p and all its containers.
35
35
  std::string getAbsolute(const ContainedPtr& p);
36
36
 
37
- /// Equivalent to `getMappedName` but with "T_" preprended to the name.
37
+ /// Equivalent to `getMappedName` but with "T_" prepended to the name.
38
38
  std::string getMetaTypeName(const ContainedPtr& p);
39
39
 
40
- /// Equivalent to `getAbsolute` but with "T_" preprended to the name.
40
+ /// Equivalent to `getAbsolute` but with "T_" prepended to the name.
41
41
  std::string getMetaTypeReference(const ContainedPtr& p);
42
42
 
43
43
  /// Emits a comment header for a generated file.
@@ -64,14 +64,14 @@ module Glacier2
64
64
  /// @throws PermissionDeniedException Thrown when an authentication or authorization failure occurs.
65
65
  /// @throws CannotCreateSessionException Thrown when the session cannot be created.
66
66
  /// @see Session
67
- /// @see SessionManager
68
- /// @see PermissionsVerifier
67
+ /// @see SSLSessionManager
68
+ /// @see SSLPermissionsVerifier
69
69
  Session* createSessionFromSecureConnection()
70
70
  throws PermissionDeniedException, CannotCreateSessionException;
71
71
 
72
72
  /// Keeps the session with this router alive.
73
73
  /// @throws SessionNotExistException Thrown when no session exists for the caller (client).
74
- ["deprecated:As of Ice 3.8, this operation does nothing."]
74
+ ["deprecated:As of Ice 3.8, this operation no longer keeps the session alive; it only verifies that the session exists."]
75
75
  void refreshSession()
76
76
  throws SessionNotExistException;
77
77
 
@@ -18,7 +18,7 @@ module IceMX
18
18
  /// A dictionary of strings to integers.
19
19
  dictionary<string, int> StringIntDict;
20
20
 
21
- /// The base class for metrics. A metrics object represents a collection of measurements associated to a given a
21
+ /// The base class for metrics. A metrics object represents a collection of measurements associated with a given
22
22
  /// system.
23
23
  class Metrics
24
24
  {
@@ -32,7 +32,7 @@ module IceMX
32
32
  /// The number of objects currently observed by this metrics.
33
33
  int current = 0;
34
34
 
35
- /// The sum of the lifetime of each observed objects. This does not include the lifetime of objects which are
35
+ /// The sum of the lifetimes of each observed object. This does not include the lifetimes of objects which are
36
36
  /// currently observed, only the objects observed in the past.
37
37
  long totalLifetime = 0;
38
38
 
@@ -71,7 +71,7 @@ module IceMX
71
71
  /// metrics of an application that enabled the Ice administrative facility and configured one or more metrics views.
72
72
  interface MetricsAdmin
73
73
  {
74
- /// Gets the names of enabled and disabled metrics.
74
+ /// Gets the names of the enabled and disabled metrics views.
75
75
  /// @param disabledViews The names of the disabled views.
76
76
  /// @return The names of the enabled views.
77
77
  Ice::StringSeq getMetricsViewNames(out Ice::StringSeq disabledViews);
@@ -107,7 +107,7 @@ module IceMX
107
107
  MetricsFailuresSeq getMapMetricsFailures(string view, string map)
108
108
  throws UnknownMetricsView;
109
109
 
110
- /// Gets the metrics failure associated for the given metrics.
110
+ /// Gets the metrics failures associated with the given metrics.
111
111
  /// @param view The name of the metrics view.
112
112
  /// @param map The name of the metrics map.
113
113
  /// @param id The ID of the metrics.
@@ -170,7 +170,8 @@ module IceMX
170
170
  {
171
171
  }
172
172
 
173
- /// Provide measurements for proxy invocations. Proxy invocations can either be sent over the wire or be collocated.
173
+ /// Provides measurements for proxy invocations. Proxy invocations can either be sent over the wire or be
174
+ /// collocated.
174
175
  class InvocationMetrics extends Metrics
175
176
  {
176
177
  /// The number of retries for the invocations.