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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aa4154bd37d4df0c510b9737d68ad939fd5168b8f96c5c4f627fbbe9916720ce
4
- data.tar.gz: 492eecaf69cd8e94539ad50a178183b5674d9e7960602f29b0dd63ae725499ff
3
+ metadata.gz: 2a605837988ce25b7b58d46ea460f0c286a95530140d5f23e3af035c6f151b33
4
+ data.tar.gz: 0e3ad2c032e729a00b19ee324a8b11f6da47d774c57bd6f364765fc0d4c1348b
5
5
  SHA512:
6
- metadata.gz: 63299394740124d99d1e5a83a4d384084682a026bc819a778467ac94325355fee31967c1c354b8cd001d93bb3ad3d9deedc3f22d5a9be88269349fadcde35bc6
7
- data.tar.gz: a5bc4d318e83bb949c2b6578f25c1fca7a34d8cabcd6c1047823dec67a2633db6b9128ae1d6169a9a004c217fe2935c30c6175d8bb51ba536d50d458b31c0133
6
+ metadata.gz: 0e35197c1bec028fc5c27926658a61babf5c69738438ab2e68f44f7aa8fcd039de7196cc00d75af96bbf3b4ac7084b0b0b671a325beefe3bf29c0fe3e2eb0949
7
+ data.tar.gz: 2e0d8a8a6a3200e4450c798d28d496f45d9829fb94221b0e8512faad52b8de1c89de34492872605d3980fb65a4da0f6f133de9befe637cb836735c1ba7365b21
@@ -28,7 +28,24 @@ namespace
28
28
  extern "C" void
29
29
  IceRuby_Communicator_free(void* p)
30
30
  {
31
- delete static_cast<Ice::CommunicatorPtr*>(p);
31
+ // The wrapper is collected only once no other object (such as a proxy) marks it. Erase the map
32
+ // entries so that the native communicator and slice loader can be released.
33
+ auto communicator = static_cast<Ice::CommunicatorPtr*>(p);
34
+ _communicatorMap.erase(*communicator);
35
+ _sliceLoaderMap.erase(*communicator);
36
+ delete communicator;
37
+ }
38
+
39
+ extern "C" void
40
+ IceRuby_Communicator_compact(void* p)
41
+ {
42
+ // Keep the map entry pointing at the wrapper's current location when GC compaction moves it.
43
+ auto communicator = static_cast<Ice::CommunicatorPtr*>(p);
44
+ CommunicatorMap::iterator q = _communicatorMap.find(*communicator);
45
+ if (q != _communicatorMap.end())
46
+ {
47
+ q->second = rb_gc_location(q->second);
48
+ }
32
49
  }
33
50
 
34
51
  static const rb_data_type_t IceRuby_CommunicatorType = {
@@ -36,6 +53,7 @@ static const rb_data_type_t IceRuby_CommunicatorType = {
36
53
  .function =
37
54
  {
38
55
  .dfree = IceRuby_Communicator_free,
56
+ .dcompact = IceRuby_Communicator_compact,
39
57
  },
40
58
  .flags = RUBY_TYPED_FREE_IMMEDIATELY,
41
59
  };
@@ -158,11 +176,6 @@ IceRuby_initialize(int argc, VALUE* argv, VALUE /*self*/)
158
176
  &IceRuby_CommunicatorType,
159
177
  new Ice::CommunicatorPtr(communicator));
160
178
 
161
- CommunicatorMap::iterator p = _communicatorMap.find(communicator);
162
- if (p != _communicatorMap.end())
163
- {
164
- _communicatorMap.erase(p);
165
- }
166
179
  _communicatorMap.insert(CommunicatorMap::value_type(communicator, reinterpret_cast<const VALUE&>(result)));
167
180
 
168
181
  _sliceLoaderMap[communicator] = sliceLoader;
@@ -223,8 +236,12 @@ IceRuby_identityToString(int argc, VALUE* argv, VALUE /*self*/)
223
236
  if (argc == 2)
224
237
  {
225
238
  volatile VALUE modeValue = callRuby(rb_funcall, argv[1], rb_intern("to_i"), 0);
226
- assert(TYPE(modeValue) == T_FIXNUM);
227
- toStringMode = static_cast<Ice::ToStringMode>(FIX2LONG(modeValue));
239
+ int32_t mode = getInteger(modeValue);
240
+ if (mode < 0 || mode > static_cast<int32_t>(Ice::ToStringMode::Compat))
241
+ {
242
+ throw RubyException(rb_eRangeError, "invalid enumerator %d for enum Ice::ToStringMode", mode);
243
+ }
244
+ toStringMode = static_cast<Ice::ToStringMode>(mode);
228
245
  }
229
246
 
230
247
  string str = Ice::identityToString(ident, toStringMode);
@@ -386,7 +403,7 @@ IceRuby_Communicator_getImplicitContext(VALUE self)
386
403
  {
387
404
  Ice::CommunicatorPtr p = getCommunicator(self);
388
405
  Ice::ImplicitContextPtr implicitContext = p->getImplicitContext();
389
- return createImplicitContext(implicitContext);
406
+ return implicitContext ? createImplicitContext(implicitContext) : Qnil;
390
407
  }
391
408
  ICE_RUBY_CATCH
392
409
  return Qnil;
@@ -55,18 +55,6 @@
55
55
  # pragma GCC diagnostic pop
56
56
  #endif
57
57
 
58
- //
59
- // The Ruby header file win32/win32.h defines a number of macros for
60
- // functions like shutdown() and close() that wreak havoc.
61
- //
62
- #ifdef _WIN32
63
- # undef shutdown
64
- # undef close
65
- # undef read
66
- # undef write
67
- # undef sleep
68
- #endif
69
-
70
58
  extern "C"
71
59
  {
72
60
  typedef VALUE (*ICE_RUBY_ENTRY_POINT)(...);
@@ -148,10 +148,7 @@ IceRuby_Connection_setBufferSize(VALUE self, VALUE r, VALUE s)
148
148
  Ice::ConnectionPtr* p = reinterpret_cast<Ice::ConnectionPtr*>(DATA_PTR(self));
149
149
  assert(p);
150
150
 
151
- int rcvSize = static_cast<int>(getInteger(r));
152
- int sndSize = static_cast<int>(getInteger(s));
153
-
154
- (*p)->setBufferSize(rcvSize, sndSize);
151
+ (*p)->setBufferSize(getInteger(r), getInteger(s));
155
152
  }
156
153
  ICE_RUBY_CATCH
157
154
  return Qnil;
@@ -191,14 +188,11 @@ IceRuby_Connection_equals(VALUE self, VALUE other)
191
188
  {
192
189
  ICE_RUBY_TRY
193
190
  {
194
- if (NIL_P(other))
191
+ // eql? returns false for a non-Connection argument: Ruby calls it with arbitrary keys on a Hash collision.
192
+ if (NIL_P(other) || callRuby(rb_obj_is_kind_of, other, _connectionClass) != Qtrue)
195
193
  {
196
194
  return Qfalse;
197
195
  }
198
- if (callRuby(rb_obj_is_kind_of, other, _connectionClass) != Qtrue)
199
- {
200
- throw RubyException(rb_eTypeError, "argument must be a connection");
201
- }
202
196
  Ice::ConnectionPtr* p1 = reinterpret_cast<Ice::ConnectionPtr*>(DATA_PTR(self));
203
197
  Ice::ConnectionPtr* p2 = reinterpret_cast<Ice::ConnectionPtr*>(DATA_PTR(other));
204
198
  return *p1 == *p2 ? Qtrue : Qfalse;
@@ -207,6 +201,19 @@ IceRuby_Connection_equals(VALUE self, VALUE other)
207
201
  return Qnil;
208
202
  }
209
203
 
204
+ extern "C" VALUE
205
+ IceRuby_Connection_hash(VALUE self)
206
+ {
207
+ ICE_RUBY_TRY
208
+ {
209
+ Ice::ConnectionPtr* p = reinterpret_cast<Ice::ConnectionPtr*>(DATA_PTR(self));
210
+ // Hash the native pointer, which is exactly what eql? compares.
211
+ return INT2FIX(std::hash<Ice::ConnectionPtr>{}(*p));
212
+ }
213
+ ICE_RUBY_CATCH
214
+ return Qnil;
215
+ }
216
+
210
217
  // ConnectionInfo
211
218
 
212
219
  extern "C" void
@@ -303,6 +310,7 @@ IceRuby::createConnectionInfo(const Ice::ConnectionInfoPtr& p)
303
310
  rb_ivar_set(info, rb_intern("@underlying"), createConnectionInfo(p->underlying));
304
311
  rb_ivar_set(info, rb_intern("@incoming"), p->incoming ? Qtrue : Qfalse);
305
312
  rb_ivar_set(info, rb_intern("@adapterName"), createString(p->adapterName));
313
+ rb_ivar_set(info, rb_intern("@connectionId"), createString(p->connectionId));
306
314
  return info;
307
315
  }
308
316
 
@@ -336,6 +344,7 @@ IceRuby::initConnection(VALUE iceModule)
336
344
  rb_define_method(_connectionClass, "inspect", CAST_METHOD(IceRuby_Connection_toString), 0);
337
345
  rb_define_method(_connectionClass, "==", CAST_METHOD(IceRuby_Connection_equals), 1);
338
346
  rb_define_method(_connectionClass, "eql?", CAST_METHOD(IceRuby_Connection_equals), 1);
347
+ rb_define_method(_connectionClass, "hash", CAST_METHOD(IceRuby_Connection_hash), 0);
339
348
 
340
349
  //
341
350
  // ConnectionInfo.
@@ -8,7 +8,7 @@
8
8
 
9
9
  namespace IceRuby
10
10
  {
11
- /// Instantiates generated Python classes/exceptions based on the Slice type ID.
11
+ /// Instantiates generated Ruby classes/exceptions based on the Slice type ID.
12
12
  class DefaultSliceLoader final : public Ice::SliceLoader
13
13
  {
14
14
  public:
@@ -76,13 +76,9 @@ IceRuby_Endpoint_cmp(VALUE self, VALUE other)
76
76
  {
77
77
  ICE_RUBY_TRY
78
78
  {
79
- if (NIL_P(other))
80
- {
81
- return INT2NUM(1);
82
- }
83
79
  if (!checkEndpoint(other))
84
80
  {
85
- throw RubyException(rb_eTypeError, "argument must be a endpoint");
81
+ return Qnil;
86
82
  }
87
83
  Ice::EndpointPtr p1 = Ice::EndpointPtr(*reinterpret_cast<Ice::EndpointPtr*>(DATA_PTR(self)));
88
84
  Ice::EndpointPtr p2 = Ice::EndpointPtr(*reinterpret_cast<Ice::EndpointPtr*>(DATA_PTR(other)));
@@ -90,7 +86,7 @@ IceRuby_Endpoint_cmp(VALUE self, VALUE other)
90
86
  {
91
87
  return INT2NUM(-1);
92
88
  }
93
- else if (Ice::targetEqualTo(p1, p1))
89
+ else if (Ice::targetEqualTo(p1, p2))
94
90
  {
95
91
  return INT2NUM(0);
96
92
  }
@@ -109,6 +105,22 @@ IceRuby_Endpoint_equals(VALUE self, VALUE other)
109
105
  return IceRuby_Endpoint_cmp(self, other) == INT2NUM(0) ? Qtrue : Qfalse;
110
106
  }
111
107
 
108
+ extern "C" VALUE
109
+ IceRuby_Endpoint_hash(VALUE self)
110
+ {
111
+ ICE_RUBY_TRY
112
+ {
113
+ Ice::EndpointPtr* p = reinterpret_cast<Ice::EndpointPtr*>(DATA_PTR(self));
114
+ assert(p);
115
+
116
+ // Hash the string representation, which encodes exactly the fields used by operator== (and hence eql?),
117
+ // so equal endpoints produce equal hashes.
118
+ return INT2FIX(std::hash<string>{}((*p)->toString()));
119
+ }
120
+ ICE_RUBY_CATCH
121
+ return Qnil;
122
+ }
123
+
112
124
  // EndpointInfo
113
125
 
114
126
  extern "C" void
@@ -159,8 +171,8 @@ IceRuby::createEndpointInfo(const Ice::EndpointInfoPtr& p)
159
171
  info = TypedData_Wrap_Struct(_opaqueEndpointInfoClass, &IceRuby_EndpointInfoType, new Ice::EndpointInfoPtr(p));
160
172
 
161
173
  Ice::OpaqueEndpointInfoPtr opaque = dynamic_pointer_cast<Ice::OpaqueEndpointInfo>(p);
162
- auto b = opaque->rawBytes;
163
- volatile VALUE v = callRuby(rb_str_new, reinterpret_cast<const char*>(&b[0]), static_cast<long>(b.size()));
174
+ const auto& b = opaque->rawBytes;
175
+ volatile VALUE v = callRuby(rb_str_new, reinterpret_cast<const char*>(b.data()), static_cast<long>(b.size()));
164
176
  rb_ivar_set(info, rb_intern("@rawBytes"), v);
165
177
  rb_ivar_set(info, rb_intern("@rawEncoding"), createEncodingVersion(opaque->rawEncoding));
166
178
  }
@@ -254,6 +266,7 @@ IceRuby::initEndpoint(VALUE iceModule)
254
266
  rb_define_method(_endpointClass, "<=>", CAST_METHOD(IceRuby_Endpoint_cmp), 1);
255
267
  rb_define_method(_endpointClass, "==", CAST_METHOD(IceRuby_Endpoint_equals), 1);
256
268
  rb_define_method(_endpointClass, "eql?", CAST_METHOD(IceRuby_Endpoint_equals), 1);
269
+ rb_define_method(_endpointClass, "hash", CAST_METHOD(IceRuby_Endpoint_hash), 0);
257
270
 
258
271
  //
259
272
  // EndpointInfo.
@@ -25,7 +25,7 @@ namespace IceRuby
25
25
  class ParamInfo final : public UnmarshalCallback
26
26
  {
27
27
  public:
28
- void unmarshaled(VALUE, VALUE, void*) final;
28
+ void unmarshaled(VALUE, VALUE, void*, StreamUtil*) final;
29
29
 
30
30
  TypeInfoPtr type;
31
31
  bool optional;
@@ -146,7 +146,7 @@ IceRuby::Operation::~Operation() = default;
146
146
  // ParamInfo implementation.
147
147
  //
148
148
  void
149
- IceRuby::ParamInfo::unmarshaled(VALUE val, VALUE target, void* closure)
149
+ IceRuby::ParamInfo::unmarshaled(VALUE val, VALUE target, void* closure, StreamUtil*)
150
150
  {
151
151
  assert(TYPE(target) == T_ARRAY);
152
152
  static_assert(sizeof(long) == sizeof(void*), "long and void* must have the same size");
@@ -267,7 +267,9 @@ IceRuby::OperationI::invoke(const Ice::ObjectPrx& proxy, VALUE args, VALUE hctx)
267
267
 
268
268
  if (!_deprecateMessage.empty())
269
269
  {
270
- rb_warning("%s", _deprecateMessage.c_str());
270
+ // Route the warning through the rb_protect discipline: rb_warning dispatches to the overridable
271
+ // Warning.warn, and a raising override would otherwise longjmp past the live C++ locals above.
272
+ callRubyVoid([this] { rb_warning("%s", _deprecateMessage.c_str()); });
271
273
  _deprecateMessage.clear(); // Only show the warning once.
272
274
  }
273
275
 
@@ -366,7 +368,7 @@ IceRuby::OperationI::convertParam(VALUE v, long pos)
366
368
  ParamInfoPtr param = make_shared<ParamInfo>();
367
369
  param->type = getType(RARRAY_AREF(v, 0));
368
370
  param->optional = static_cast<bool>(RTEST(RARRAY_AREF(v, 1)));
369
- param->tag = static_cast<int>(getInteger(RARRAY_AREF(v, 2)));
371
+ param->tag = getInteger(RARRAY_AREF(v, 2));
370
372
  param->pos = static_cast<int>(pos);
371
373
  return param;
372
374
  }
@@ -467,7 +469,7 @@ IceRuby::OperationI::unmarshalResults(const vector<byte>& bytes, const Ice::Comm
467
469
 
468
470
  //
469
471
  // Unmarshal the results. If there is more than one value to be returned, then return them
470
- // in a tuple of the form (result, outParam1, ...). Otherwise just return the value.
472
+ // in an array of the form [result, outParam1, ...]. Otherwise just return the value.
471
473
  //
472
474
  Ice::InputStream is{communicator, bytes, lookupSliceLoader(communicator)};
473
475
 
@@ -37,9 +37,9 @@ IceRuby_createProperties(int argc, VALUE* argv, VALUE /*self*/)
37
37
  }
38
38
 
39
39
  Ice::PropertiesPtr defaults;
40
- if (argc == 2)
40
+ if (argc == 2 && !NIL_P(argv[1]))
41
41
  {
42
- if (!NIL_P(argv[1]) && callRuby(rb_obj_is_instance_of, argv[1], _propertiesClass) == Qfalse)
42
+ if (callRuby(rb_obj_is_instance_of, argv[1], _propertiesClass) == Qfalse)
43
43
  {
44
44
  throw RubyException(rb_eTypeError, "invalid properties argument to Ice::createProperties");
45
45
  }
@@ -156,8 +156,7 @@ IceRuby_Properties_getPropertyAsIntWithDefault(VALUE self, VALUE key, VALUE def)
156
156
  {
157
157
  Ice::PropertiesPtr p = getProperties(self);
158
158
  string k = getString(key);
159
- int32_t d = static_cast<int32_t>(getInteger(def));
160
- int32_t v = p->getPropertyAsIntWithDefault(k, d);
159
+ int32_t v = p->getPropertyAsIntWithDefault(k, getInteger(def));
161
160
  return INT2FIX(v);
162
161
  }
163
162
  ICE_RUBY_CATCH
@@ -248,7 +248,7 @@ IceRuby_ObjectPrx_ice_endpoints(VALUE self, VALUE seq)
248
248
  if (!NIL_P(seq))
249
249
  {
250
250
  volatile VALUE arr = callRuby(rb_check_array_type, seq);
251
- if (NIL_P(seq))
251
+ if (NIL_P(arr))
252
252
  {
253
253
  throw RubyException(rb_eTypeError, "unable to convert value to an array of endpoints");
254
254
  }
@@ -316,8 +316,7 @@ IceRuby_ObjectPrx_ice_locatorCacheTimeout(VALUE self, VALUE timeout)
316
316
  try
317
317
  {
318
318
  Ice::ObjectPrx p = getProxy(self);
319
- long t = getInteger(timeout);
320
- return createProxy(p->ice_locatorCacheTimeout(static_cast<int32_t>(t)), rb_class_of(self));
319
+ return createProxy(p->ice_locatorCacheTimeout(getInteger(timeout)), rb_class_of(self));
321
320
  }
322
321
  catch (const invalid_argument& ex)
323
322
  {
@@ -336,8 +335,7 @@ IceRuby_ObjectPrx_ice_invocationTimeout(VALUE self, VALUE timeout)
336
335
  try
337
336
  {
338
337
  Ice::ObjectPrx p = getProxy(self);
339
- long t = getInteger(timeout);
340
- return createProxy(p->ice_invocationTimeout(static_cast<int32_t>(t)), rb_class_of(self));
338
+ return createProxy(p->ice_invocationTimeout(getInteger(timeout)), rb_class_of(self));
341
339
  }
342
340
  catch (const invalid_argument& ex)
343
341
  {
@@ -425,17 +423,15 @@ IceRuby_ObjectPrx_ice_getEncodingVersion(VALUE self)
425
423
  extern "C" VALUE
426
424
  IceRuby_ObjectPrx_ice_encodingVersion(VALUE self, VALUE v)
427
425
  {
428
- Ice::EncodingVersion val;
429
- if (getEncodingVersion(v, val))
426
+ ICE_RUBY_TRY
430
427
  {
431
- ICE_RUBY_TRY
432
- {
433
- Ice::ObjectPrx p = getProxy(self);
434
- return createProxy(p->ice_encodingVersion(val), rb_class_of(self));
435
- }
436
- ICE_RUBY_CATCH
437
- }
428
+ Ice::EncodingVersion val;
429
+ getEncodingVersion(v, val);
438
430
 
431
+ Ice::ObjectPrx p = getProxy(self);
432
+ return createProxy(p->ice_encodingVersion(val), rb_class_of(self));
433
+ }
434
+ ICE_RUBY_CATCH
439
435
  return Qnil;
440
436
  }
441
437
 
@@ -766,13 +762,9 @@ IceRuby_ObjectPrx_cmp(VALUE self, VALUE other)
766
762
  {
767
763
  ICE_RUBY_TRY
768
764
  {
769
- if (NIL_P(other))
770
- {
771
- return INT2NUM(1);
772
- }
773
765
  if (!checkProxy(other))
774
766
  {
775
- throw RubyException(rb_eTypeError, "argument must be a proxy");
767
+ return Qnil;
776
768
  }
777
769
  Ice::ObjectPrx p1 = getProxy(self);
778
770
  Ice::ObjectPrx p2 = getProxy(other);
@@ -10,7 +10,7 @@ using namespace std;
10
10
  IceRuby::RubySliceLoader::RubySliceLoader(VALUE sliceLoader) : _sliceLoader{sliceLoader}
11
11
  {
12
12
  // Mark the object as in use for the lifetime of this wrapper.
13
- rb_gc_register_address(&sliceLoader);
13
+ rb_gc_register_address(&_sliceLoader);
14
14
  }
15
15
 
16
16
  IceRuby::RubySliceLoader::~RubySliceLoader() { rb_gc_unregister_address(&_sliceLoader); }
@@ -15,6 +15,12 @@ namespace IceRuby
15
15
  explicit RubySliceLoader(VALUE sliceLoader);
16
16
  ~RubySliceLoader() final;
17
17
 
18
+ // Registers a GC root tied to the address of _sliceLoader, so it's neither copyable nor movable.
19
+ RubySliceLoader(const RubySliceLoader&) = delete;
20
+ RubySliceLoader(RubySliceLoader&&) = delete;
21
+ RubySliceLoader& operator=(const RubySliceLoader&) = delete;
22
+ RubySliceLoader& operator=(RubySliceLoader&&) = delete;
23
+
18
24
  [[nodiscard]] Ice::ValuePtr newClassInstance(std::string_view typeId) const final;
19
25
 
20
26
  // TODO: we currently don't support loading of custom Slice exceptions from Ruby.