zeroc-ice 3.8.1 → 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 (280) 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 +29 -11
  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 +26 -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 +14 -11
  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 +57 -23
  54. data/dist/ice/cpp/include/generated/Ice/LocatorRegistry.h +38 -11
  55. data/dist/ice/cpp/include/generated/Ice/Metrics.h +99 -44
  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 +8 -4
  62. data/dist/ice/cpp/include/generated/Ice/Router.h +55 -19
  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 +6 -4
  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 +121 -108
  82. data/dist/ice/cpp/src/Ice/ConnectionI.h +12 -9
  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 +15 -79
  87. data/dist/ice/cpp/src/Ice/FileUtil.h +0 -3
  88. data/dist/ice/cpp/src/Ice/FixedRequestHandler.cpp +1 -1
  89. data/dist/ice/cpp/src/Ice/FixedRequestHandler.h +1 -1
  90. data/dist/ice/cpp/src/Ice/HttpParser.h +0 -2
  91. data/dist/ice/cpp/src/Ice/IPEndpointI.cpp +4 -0
  92. data/dist/ice/cpp/src/Ice/IdleTimeoutTransceiverDecorator.cpp +6 -3
  93. data/dist/ice/cpp/src/Ice/IncomingRequest.cpp +2 -4
  94. data/dist/ice/cpp/src/Ice/InputStream.cpp +50 -33
  95. data/dist/ice/cpp/src/Ice/Instance.cpp +73 -50
  96. data/dist/ice/cpp/src/Ice/Instance.h +1 -6
  97. data/dist/ice/cpp/src/Ice/LocalExceptions.cpp +7 -1
  98. data/dist/ice/cpp/src/Ice/LocatorInfo.cpp +2 -2
  99. data/dist/ice/cpp/src/Ice/LoggerAdminI.cpp +13 -18
  100. data/dist/ice/cpp/src/Ice/LoggerI.cpp +1 -1
  101. data/dist/ice/cpp/src/Ice/LoggerI.h +2 -2
  102. data/dist/ice/cpp/src/Ice/MetricsAdminI.h +6 -1
  103. data/dist/ice/cpp/src/Ice/MetricsObserverI.h +22 -18
  104. data/dist/ice/cpp/src/Ice/NativePropertiesAdmin.cpp +5 -2
  105. data/dist/ice/cpp/src/Ice/Network.cpp +168 -103
  106. data/dist/ice/cpp/src/Ice/Network.h +12 -7
  107. data/dist/ice/cpp/src/Ice/NetworkProxy.cpp +17 -6
  108. data/dist/ice/cpp/src/Ice/NetworkProxy.h +2 -1
  109. data/dist/ice/cpp/src/Ice/Object.cpp +1 -1
  110. data/dist/ice/cpp/src/Ice/ObjectAdapterI.cpp +56 -19
  111. data/dist/ice/cpp/src/Ice/OpaqueEndpointI.cpp +10 -10
  112. data/dist/ice/cpp/src/Ice/Options.cpp +7 -2
  113. data/dist/ice/cpp/src/Ice/OutgoingAsync.cpp +2 -2
  114. data/dist/ice/cpp/src/Ice/OutgoingResponse.cpp +127 -127
  115. data/dist/ice/cpp/src/Ice/OutgoingResponseInternal.h +21 -0
  116. data/dist/ice/cpp/src/Ice/OutputStream.cpp +50 -65
  117. data/dist/ice/cpp/src/Ice/PluginManagerI.cpp +7 -1
  118. data/dist/ice/cpp/src/Ice/Properties.cpp +26 -16
  119. data/dist/ice/cpp/src/Ice/PropertyNames.cpp +2 -1
  120. data/dist/ice/cpp/src/Ice/PropertyUtil.cpp +1 -1
  121. data/dist/ice/cpp/src/Ice/ProtocolInstance.cpp +0 -11
  122. data/dist/ice/cpp/src/Ice/ProtocolInstance.h +1 -2
  123. data/dist/ice/cpp/src/Ice/Proxy.cpp +9 -1
  124. data/dist/ice/cpp/src/Ice/ProxyAsync.cpp +110 -13
  125. data/dist/ice/cpp/src/Ice/ProxyFunctions.cpp +4 -4
  126. data/dist/ice/cpp/src/Ice/Random.cpp +68 -7
  127. data/dist/ice/cpp/src/Ice/Random.h +6 -2
  128. data/dist/ice/cpp/src/Ice/Reference.cpp +37 -26
  129. data/dist/ice/cpp/src/Ice/Reference.h +3 -0
  130. data/dist/ice/cpp/src/Ice/ReferenceFactory.cpp +26 -13
  131. data/dist/ice/cpp/src/Ice/RequestHandler.h +3 -1
  132. data/dist/ice/cpp/src/Ice/RequestHandlerCache.cpp +1 -1
  133. data/dist/ice/cpp/src/Ice/RequestHandlerCache.h +1 -1
  134. data/dist/ice/cpp/src/Ice/ResourceConfig.h +3 -3
  135. data/dist/ice/cpp/src/Ice/RetryQueue.cpp +8 -12
  136. data/dist/ice/cpp/src/Ice/SHA1.cpp +11 -11
  137. data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.cpp +0 -6
  138. data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.h +0 -6
  139. data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngine.cpp +27 -12
  140. data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngine.h +1 -2
  141. data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.cpp +77 -27
  142. data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.h +2 -1
  143. data/dist/ice/cpp/src/Ice/SSL/RFC2253.cpp +2 -2
  144. data/dist/ice/cpp/src/Ice/SSL/SSLEndpointI.cpp +1 -1
  145. data/dist/ice/cpp/src/Ice/SSL/SSLEngine.h +1 -4
  146. data/dist/ice/cpp/src/Ice/SSL/SSLUtil.cpp +39 -34
  147. data/dist/ice/cpp/src/Ice/SSL/SchannelEngine.cpp +165 -80
  148. data/dist/ice/cpp/src/Ice/SSL/SchannelEngine.h +1 -5
  149. data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.cpp +73 -33
  150. data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.h +0 -1
  151. data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngine.cpp +110 -17
  152. data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngine.h +7 -2
  153. data/dist/ice/cpp/src/Ice/SSL/SecureTransportTransceiverI.cpp +9 -3
  154. data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.cpp +73 -51
  155. data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.h +0 -8
  156. data/dist/ice/cpp/src/Ice/Selector.cpp +13 -11
  157. data/dist/ice/cpp/src/Ice/ServantManager.cpp +3 -3
  158. data/dist/ice/cpp/src/Ice/Service.cpp +33 -115
  159. data/dist/ice/cpp/src/Ice/StreamSocket.cpp +33 -40
  160. data/dist/ice/cpp/src/Ice/StreamSocket.h +4 -4
  161. data/dist/ice/cpp/src/Ice/StringConverter.cpp +1 -1
  162. data/dist/ice/cpp/src/Ice/StringUtil.cpp +12 -21
  163. data/dist/ice/cpp/src/Ice/SysLoggerI.cpp +136 -100
  164. data/dist/ice/cpp/src/Ice/SysLoggerI.h +7 -3
  165. data/dist/ice/cpp/src/Ice/SystemdJournalI.cpp +1 -1
  166. data/dist/ice/cpp/src/Ice/TcpAcceptor.cpp +7 -7
  167. data/dist/ice/cpp/src/Ice/TcpAcceptor.h +2 -1
  168. data/dist/ice/cpp/src/Ice/TcpBufSize.h +40 -0
  169. data/dist/ice/cpp/src/Ice/TcpConnector.cpp +5 -2
  170. data/dist/ice/cpp/src/Ice/TcpConnector.h +2 -0
  171. data/dist/ice/cpp/src/Ice/TcpEndpointI.cpp +2 -2
  172. data/dist/ice/cpp/src/Ice/TcpTransceiver.cpp +6 -2
  173. data/dist/ice/cpp/src/Ice/ThreadPool.cpp +2 -8
  174. data/dist/ice/cpp/src/Ice/ThreadPool.h +0 -2
  175. data/dist/ice/cpp/src/Ice/Timer.cpp +7 -3
  176. data/dist/ice/cpp/src/Ice/UUID.cpp +1 -2
  177. data/dist/ice/cpp/src/Ice/UdpEndpointI.cpp +6 -3
  178. data/dist/ice/cpp/src/Ice/UdpTransceiver.cpp +136 -123
  179. data/dist/ice/cpp/src/Ice/UdpTransceiver.h +3 -4
  180. data/dist/ice/cpp/src/Ice/WSAcceptor.cpp +8 -3
  181. data/dist/ice/cpp/src/Ice/WSAcceptor.h +5 -1
  182. data/dist/ice/cpp/src/Ice/WSEndpoint.cpp +45 -2
  183. data/dist/ice/cpp/src/Ice/WSTransceiver.cpp +214 -34
  184. data/dist/ice/cpp/src/Ice/WSTransceiver.h +13 -2
  185. data/dist/ice/cpp/src/Ice/generated/BuiltinSequences.cpp +2 -2
  186. data/dist/ice/cpp/src/Ice/generated/Context.cpp +2 -2
  187. data/dist/ice/cpp/src/Ice/generated/EndpointTypes.cpp +2 -2
  188. data/dist/ice/cpp/src/Ice/generated/Identity.cpp +2 -2
  189. data/dist/ice/cpp/src/Ice/generated/Locator.cpp +2 -2
  190. data/dist/ice/cpp/src/Ice/generated/LocatorRegistry.cpp +2 -2
  191. data/dist/ice/cpp/src/Ice/generated/Metrics.cpp +2 -2
  192. data/dist/ice/cpp/src/Ice/generated/OperationMode.cpp +2 -2
  193. data/dist/ice/cpp/src/Ice/generated/Process.cpp +2 -2
  194. data/dist/ice/cpp/src/Ice/generated/PropertiesAdmin.cpp +2 -2
  195. data/dist/ice/cpp/src/Ice/generated/PropertyDict.cpp +2 -2
  196. data/dist/ice/cpp/src/Ice/generated/RemoteLogger.cpp +2 -2
  197. data/dist/ice/cpp/src/Ice/generated/ReplyStatus.cpp +4 -2
  198. data/dist/ice/cpp/src/Ice/generated/Router.cpp +2 -2
  199. data/dist/ice/cpp/src/Ice/generated/SliceChecksumDict.cpp +2 -2
  200. data/dist/ice/cpp/src/Ice/generated/Version.cpp +2 -2
  201. data/dist/ice/cpp/src/IceDiscovery/LookupI.cpp +47 -9
  202. data/dist/ice/cpp/src/IceDiscovery/LookupI.h +8 -3
  203. data/dist/ice/cpp/src/IceDiscovery/generated/Lookup.cpp +2 -2
  204. data/dist/ice/cpp/src/IceLocatorDiscovery/PluginI.cpp +43 -14
  205. data/dist/ice/cpp/src/IceLocatorDiscovery/generated/Lookup.cpp +2 -2
  206. data/dist/ice/cpp/src/Slice/DocCommentParser.cpp +32 -26
  207. data/dist/ice/cpp/src/Slice/DocCommentParser.h +6 -4
  208. data/dist/ice/cpp/src/Slice/FileTracker.cpp +3 -11
  209. data/dist/ice/cpp/src/Slice/FileTracker.h +0 -2
  210. data/dist/ice/cpp/src/Slice/Grammar.cpp +211 -210
  211. data/dist/ice/cpp/src/Slice/MetadataValidation.cpp +34 -14
  212. data/dist/ice/cpp/src/Slice/MetadataValidation.h +3 -2
  213. data/dist/ice/cpp/src/Slice/Parser.cpp +145 -97
  214. data/dist/ice/cpp/src/Slice/Parser.h +22 -8
  215. data/dist/ice/cpp/src/Slice/Preprocessor.cpp +77 -29
  216. data/dist/ice/cpp/src/Slice/Preprocessor.h +0 -3
  217. data/dist/ice/cpp/src/Slice/Scanner.cpp +3 -3
  218. data/dist/ice/cpp/src/Slice/SliceUtil.cpp +203 -172
  219. data/dist/ice/cpp/src/Slice/StringLiteralUtil.cpp +0 -2
  220. data/dist/ice/cpp/src/Slice/Util.h +21 -12
  221. data/dist/ice/cpp/src/slice2rb/Ruby.cpp +7 -3
  222. data/dist/ice/cpp/src/slice2rb/RubyUtil.cpp +26 -20
  223. data/dist/ice/cpp/src/slice2rb/RubyUtil.h +10 -13
  224. data/dist/ice/slice/Glacier2/Router.ice +3 -3
  225. data/dist/ice/slice/Ice/Identity.ice +3 -0
  226. data/dist/ice/slice/Ice/Locator.ice +6 -5
  227. data/dist/ice/slice/Ice/LocatorRegistry.ice +3 -0
  228. data/dist/ice/slice/Ice/Metrics.ice +7 -6
  229. data/dist/ice/slice/Ice/OperationMode.ice +8 -0
  230. data/dist/ice/slice/Ice/Process.ice +3 -0
  231. data/dist/ice/slice/Ice/RemoteLogger.ice +5 -5
  232. data/dist/ice/slice/Ice/ReplyStatus.ice +13 -0
  233. data/dist/ice/slice/IceGrid/Admin.ice +9 -9
  234. data/dist/ice/slice/IceGrid/Descriptor.ice +5 -5
  235. data/dist/ice/slice/IceStorm/Metrics.ice +1 -1
  236. data/dist/lib/Glacier2/Metrics.rb +1 -1
  237. data/dist/lib/Glacier2/PermissionsVerifier.rb +3 -3
  238. data/dist/lib/Glacier2/Router.rb +9 -9
  239. data/dist/lib/Glacier2/SSLInfo.rb +1 -1
  240. data/dist/lib/Glacier2/Session.rb +15 -15
  241. data/dist/lib/Ice/BuiltinSequences.rb +1 -1
  242. data/dist/lib/Ice/CompressBatch.rb +1 -2
  243. data/dist/lib/Ice/Context.rb +1 -1
  244. data/dist/lib/Ice/EndpointSelectionType.rb +1 -2
  245. data/dist/lib/Ice/EndpointTypes.rb +1 -1
  246. data/dist/lib/Ice/Identity.rb +1 -1
  247. data/dist/lib/Ice/IdentitySpaceship.rb +1 -0
  248. data/dist/lib/Ice/LocalExceptions.rb +3 -0
  249. data/dist/lib/Ice/Locator.rb +5 -5
  250. data/dist/lib/Ice/LocatorRegistry.rb +4 -4
  251. data/dist/lib/Ice/Metrics.rb +7 -7
  252. data/dist/lib/Ice/OperationMode.rb +2 -3
  253. data/dist/lib/Ice/Process.rb +3 -3
  254. data/dist/lib/Ice/PropertiesAdmin.rb +4 -4
  255. data/dist/lib/Ice/PropertyDict.rb +1 -1
  256. data/dist/lib/Ice/ProxyFunctions.rb +8 -4
  257. data/dist/lib/Ice/RemoteLogger.rb +7 -8
  258. data/dist/lib/Ice/ReplyStatus.rb +4 -4
  259. data/dist/lib/Ice/Router.rb +5 -5
  260. data/dist/lib/Ice/SliceChecksumDict.rb +1 -1
  261. data/dist/lib/Ice/SliceUtil.rb +2 -2
  262. data/dist/lib/Ice/Struct.rb +1 -0
  263. data/dist/lib/Ice/ToStringMode.rb +1 -2
  264. data/dist/lib/Ice/Value.rb +2 -2
  265. data/dist/lib/Ice/Version.rb +1 -1
  266. data/dist/lib/IceBox/ServiceManager.rb +8 -8
  267. data/dist/lib/IceGrid/Admin.rb +85 -86
  268. data/dist/lib/IceGrid/Descriptor.rb +1 -1
  269. data/dist/lib/IceGrid/Exception.rb +1 -1
  270. data/dist/lib/IceGrid/FileParser.rb +2 -2
  271. data/dist/lib/IceGrid/Registry.rb +14 -15
  272. data/dist/lib/IceGrid/Session.rb +7 -7
  273. data/dist/lib/IceGrid/UserAccountMapper.rb +2 -2
  274. data/dist/lib/IceStorm/IceStorm.rb +16 -16
  275. data/dist/lib/IceStorm/Metrics.rb +1 -1
  276. data/extconf.rb +1 -1
  277. data/ice.gemspec +3 -3
  278. metadata +5 -5
  279. data/dist/ice/cpp/src/Ice/DLLMain.cpp +0 -40
  280. data/dist/ice/cpp/src/Ice/UndefSysMacros.h +0 -37
@@ -48,6 +48,16 @@ namespace
48
48
  inline EndpointIPtr toEndpointI(const EndpointPtr& endp) { return dynamic_pointer_cast<EndpointI>(endp); }
49
49
 
50
50
  string emptyName{};
51
+
52
+ // Installed as the dispatch pipeline when the creation of the actual pipeline fails.
53
+ class FailedDispatchPipeline final : public Object
54
+ {
55
+ public:
56
+ void dispatch(IncomingRequest&, std::function<void(OutgoingResponse)>) final
57
+ {
58
+ throw UnknownException{__FILE__, __LINE__, "the object adapter could not create its dispatch pipeline"};
59
+ }
60
+ };
51
61
  }
52
62
 
53
63
  Ice::ObjectAdapter::~ObjectAdapter() = default; // avoid weak vtable
@@ -95,7 +105,7 @@ Ice::ObjectAdapterI::activate()
95
105
  //
96
106
  // One off initializations of the adapter: update the
97
107
  // locator registry and print the "adapter ready"
98
- // message. We set set state to StateActivating to prevent
108
+ // message. We set state to StateActivating to prevent
99
109
  // deactivation from other threads while these one off
100
110
  // initializations are done.
101
111
  //
@@ -121,7 +131,7 @@ Ice::ObjectAdapterI::activate()
121
131
  //
122
132
  // If we couldn't update the locator registry, we let the
123
133
  // exception go through and don't activate the adapter to
124
- // allow to user code to retry activating the adapter
134
+ // allow user code to retry activating the adapter
125
135
  // later.
126
136
  //
127
137
  {
@@ -535,11 +545,29 @@ Ice::ObjectAdapterI::dispatchPipeline() const noexcept
535
545
  lock_guard lock(_mutex);
536
546
  if (!_dispatchPipeline)
537
547
  {
538
- _dispatchPipeline = _servantManager;
539
- while (!_middlewareFactoryStack.empty())
548
+ try
549
+ {
550
+ ObjectPtr dispatchPipeline = _servantManager;
551
+ while (!_middlewareFactoryStack.empty())
552
+ {
553
+ dispatchPipeline = _middlewareFactoryStack.top()(std::move(dispatchPipeline));
554
+ _middlewareFactoryStack.pop();
555
+ }
556
+ _dispatchPipeline = std::move(dispatchPipeline);
557
+ }
558
+ catch (const std::exception& ex)
540
559
  {
541
- _dispatchPipeline = _middlewareFactoryStack.top()(std::move(_dispatchPipeline));
542
- _middlewareFactoryStack.pop();
560
+ Error out(_instance->initializationData().logger);
561
+ out << "failed to create the dispatch pipeline of object adapter '" << _name << "':\n" << ex;
562
+ _dispatchPipeline = make_shared<FailedDispatchPipeline>();
563
+ _middlewareFactoryStack = {};
564
+ }
565
+ catch (...)
566
+ {
567
+ Error out(_instance->initializationData().logger);
568
+ out << "failed to create the dispatch pipeline of object adapter '" << _name << "': unknown c++ exception";
569
+ _dispatchPipeline = make_shared<FailedDispatchPipeline>();
570
+ _middlewareFactoryStack = {};
543
571
  }
544
572
  }
545
573
  return _dispatchPipeline;
@@ -996,15 +1024,6 @@ Ice::ObjectAdapterI::initialize(optional<RouterPrx> router)
996
1024
  // fill in the real port number.
997
1025
  //
998
1026
  vector<EndpointIPtr> endpoints = parseEndpoints(properties->getProperty(_name + ".Endpoints"), true);
999
- for (const auto& endpoint : endpoints)
1000
- {
1001
- for (const auto& expanded : endpoint->expandHost())
1002
- {
1003
- auto factory = make_shared<IncomingConnectionFactory>(_instance, expanded, shared_from_this());
1004
- factory->initialize();
1005
- _incomingConnectionFactories.push_back(factory);
1006
- }
1007
- }
1008
1027
  if (endpoints.empty())
1009
1028
  {
1010
1029
  TraceLevelsPtr tl = _instance->traceLevels();
@@ -1014,6 +1033,24 @@ Ice::ObjectAdapterI::initialize(optional<RouterPrx> router)
1014
1033
  out << "created adapter '" << _name << "' without endpoints";
1015
1034
  }
1016
1035
  }
1036
+ else
1037
+ {
1038
+ // An adapter with endpoints accepts incoming connections, and each connection needs the
1039
+ // adapter's dispatch thread pool. Create it before the first connection factory: its
1040
+ // on-demand creation reads the thread pool properties and can throw, and it must not fail
1041
+ // once connections exist.
1042
+ [[maybe_unused]] auto _ = getThreadPool();
1043
+
1044
+ for (const auto& endpoint : endpoints)
1045
+ {
1046
+ for (const auto& expanded : endpoint->expandHost())
1047
+ {
1048
+ auto factory = make_shared<IncomingConnectionFactory>(_instance, expanded, shared_from_this());
1049
+ factory->initialize();
1050
+ _incomingConnectionFactories.push_back(factory);
1051
+ }
1052
+ }
1053
+ }
1017
1054
  }
1018
1055
 
1019
1056
  //
@@ -1317,7 +1354,7 @@ ObjectAdapterI::updateLocatorRegistry(const IceInternal::LocatorInfoPtr& locator
1317
1354
  if (_instance->traceLevels()->location >= 1)
1318
1355
  {
1319
1356
  Trace out(_instance->initializationData().logger, _instance->traceLevels()->locationCat);
1320
- out << "couldn't update object adapter '" + _id + "' endpoints with the locator registry:\n";
1357
+ out << "could not update object adapter '" + _id + "' endpoints with the locator registry:\n";
1321
1358
  out << "the object adapter is not known to the locator registry";
1322
1359
  }
1323
1360
 
@@ -1328,7 +1365,7 @@ ObjectAdapterI::updateLocatorRegistry(const IceInternal::LocatorInfoPtr& locator
1328
1365
  if (_instance->traceLevels()->location >= 1)
1329
1366
  {
1330
1367
  Trace out(_instance->initializationData().logger, _instance->traceLevels()->locationCat);
1331
- out << "couldn't update object adapter '" + _id + "' endpoints with the locator registry:\n";
1368
+ out << "could not update object adapter '" + _id + "' endpoints with the locator registry:\n";
1332
1369
  out << "the replica group '" << _replicaGroupId << "' is not known to the locator registry";
1333
1370
  }
1334
1371
 
@@ -1339,7 +1376,7 @@ ObjectAdapterI::updateLocatorRegistry(const IceInternal::LocatorInfoPtr& locator
1339
1376
  if (_instance->traceLevels()->location >= 1)
1340
1377
  {
1341
1378
  Trace out(_instance->initializationData().logger, _instance->traceLevels()->locationCat);
1342
- out << "couldn't update object adapter '" + _id + "' endpoints with the locator registry:\n";
1379
+ out << "could not update object adapter '" + _id + "' endpoints with the locator registry:\n";
1343
1380
  out << "the object adapter endpoints are already set";
1344
1381
  }
1345
1382
 
@@ -1358,7 +1395,7 @@ ObjectAdapterI::updateLocatorRegistry(const IceInternal::LocatorInfoPtr& locator
1358
1395
  if (_instance->traceLevels()->location >= 1)
1359
1396
  {
1360
1397
  Trace out(_instance->initializationData().logger, _instance->traceLevels()->locationCat);
1361
- out << "couldn't update object adapter '" + _id + "' endpoints with the locator registry:\n" << ex;
1398
+ out << "could not update object adapter '" + _id + "' endpoints with the locator registry:\n" << ex;
1362
1399
  }
1363
1400
  throw; // TODO: Shall we raise a special exception instead of a non obvious local exception?
1364
1401
  }
@@ -298,7 +298,7 @@ IceInternal::OpaqueEndpointI::checkOption(const string& option, const string& ar
298
298
  __LINE__,
299
299
  "invalid type value '" + argument + "' in endpoint '" + endpoint + "'");
300
300
  }
301
- else if (t < 0 || t > 65535)
301
+ else if (t < 0 || t > 32767)
302
302
  {
303
303
  throw ParseException(
304
304
  __FILE__,
@@ -322,17 +322,17 @@ IceInternal::OpaqueEndpointI::checkOption(const string& option, const string& ar
322
322
  __LINE__,
323
323
  "no argument provided for -v option in endpoint '" + endpoint + "'");
324
324
  }
325
- for (char i : argument)
325
+ try
326
+ {
327
+ const_cast<vector<byte>&>(_rawBytes) = Base64::decode(argument);
328
+ }
329
+ catch (const std::invalid_argument& ex)
326
330
  {
327
- if (!Base64::isBase64(i))
328
- {
329
- ostringstream os;
330
- os << "invalid base64 character '" << i << "' (ordinal " << static_cast<int>(i) << ") in endpoint '"
331
- << endpoint << "'";
332
- throw ParseException(__FILE__, __LINE__, os.str());
333
- }
331
+ throw ParseException(
332
+ __FILE__,
333
+ __LINE__,
334
+ "invalid base64 value in endpoint '" + endpoint + "':\n" + ex.what());
334
335
  }
335
- const_cast<vector<byte>&>(_rawBytes) = Base64::decode(argument);
336
336
  return true;
337
337
  }
338
338
 
@@ -51,7 +51,7 @@ IceInternal::Options::checkArgs(const string& shortOpt, const string& longOpt, b
51
51
  {
52
52
  string err = "'";
53
53
  err += shortOpt;
54
- err += "': a short option cannot be `-'";
54
+ err += "': a short option cannot be '-'";
55
55
  throw invalid_argument(err);
56
56
  }
57
57
  }
@@ -69,7 +69,7 @@ IceInternal::Options::checkArgs(const string& shortOpt, const string& longOpt, b
69
69
  {
70
70
  string err = "'";
71
71
  err += longOpt;
72
- err += "': a long option must not contain a leading `-'";
72
+ err += "': a long option must not contain a leading '-'";
73
73
  throw invalid_argument(err);
74
74
  }
75
75
  }
@@ -627,6 +627,11 @@ IceInternal::Options::parse(const StringVector& args)
627
627
  argDone = true;
628
628
  break;
629
629
  }
630
+
631
+ // This option is the last character in the cluster and its argument is the next argv element,
632
+ // consumed by the "if (!argDone)" code below. Reset argDone in case a preceding no-argument
633
+ // option in this cluster set it (for example "-dI dir").
634
+ argDone = false;
630
635
  }
631
636
  else
632
637
  {
@@ -481,7 +481,7 @@ ProxyOutgoingAsyncBase::invokeImpl(bool userThread)
481
481
  }
482
482
  }
483
483
  }
484
- catch (const Exception&)
484
+ catch (...)
485
485
  {
486
486
  // If called from the user thread we re-throw, the exception will be caught by the caller and handled using
487
487
  // abort.
@@ -817,7 +817,7 @@ OutgoingAsync::prepare(string_view operation, OperationMode mode, const Context&
817
817
  }
818
818
  else
819
819
  {
820
- string facet = ref->getFacet();
820
+ const string& facet = ref->getFacet();
821
821
  _os.write(&facet, &facet + 1);
822
822
  }
823
823
 
@@ -2,9 +2,11 @@
2
2
 
3
3
  #include "Ice/OutgoingResponse.h"
4
4
  #include "Ice/Demangle.h"
5
+ #include "Ice/Initialize.h"
5
6
  #include "Ice/LocalExceptions.h"
6
7
  #include "Ice/ObjectAdapter.h"
7
8
  #include "Ice/UserException.h"
9
+ #include "OutgoingResponseInternal.h"
8
10
  #include "Protocol.h"
9
11
 
10
12
  #include <sstream>
@@ -30,131 +32,6 @@ namespace
30
32
  os << "dispatch failed with " << typeId << ": " << what;
31
33
  return os.str();
32
34
  }
33
-
34
- // The "core" implementation of makeOutgoingResponse for exceptions. Note that it can throw an exception.
35
- OutgoingResponse makeOutgoingResponseCore(std::exception_ptr exc, const Current& current)
36
- {
37
- assert(exc);
38
- OutputStream ostr{currentProtocolEncoding};
39
-
40
- if (current.requestId != 0)
41
- {
42
- ostr.writeBlob(replyHdr, sizeof(replyHdr));
43
- ostr.write(current.requestId);
44
- }
45
- ReplyStatus replyStatus;
46
- string exceptionId;
47
- string exceptionDetails; // may include the stack trace.
48
- string dispatchExceptionMessage;
49
-
50
- try
51
- {
52
- rethrow_exception(exc);
53
- }
54
- catch (const UserException& ex)
55
- {
56
- // We keep exceptionId and exceptionDetails empty.
57
-
58
- replyStatus = ReplyStatus::UserException;
59
-
60
- if (current.requestId != 0)
61
- {
62
- ostr.write(replyStatus);
63
- ostr.startEncapsulation(current.encoding, FormatType::SlicedFormat);
64
- ostr.write(ex);
65
- ostr.endEncapsulation();
66
- }
67
- }
68
- catch (const DispatchException& ex)
69
- {
70
- exceptionId = ex.ice_id();
71
- exceptionDetails = toString(ex); // can include a stack trace
72
- replyStatus = ex.replyStatus();
73
-
74
- if (replyStatus >= ReplyStatus::ObjectNotExist && replyStatus <= ReplyStatus::OperationNotExist)
75
- {
76
- if (current.requestId != 0) // only marshal response for two-way requests
77
- {
78
- // The identity, facet, operation are often left unset at this point.
79
- Identity id;
80
- string facet;
81
- string operation;
82
- if (auto* rfe = dynamic_cast<const RequestFailedException*>(&ex))
83
- {
84
- id = rfe->id();
85
- facet = rfe->facet();
86
- operation = rfe->operation();
87
- }
88
- if (id.name.empty())
89
- {
90
- id = current.id;
91
- facet = current.facet;
92
- }
93
- if (operation.empty())
94
- {
95
- operation = current.operation;
96
- }
97
-
98
- ostr.write(replyStatus);
99
- ostr.write(id);
100
-
101
- if (facet.empty())
102
- {
103
- ostr.write(static_cast<string*>(nullptr), static_cast<string*>(nullptr));
104
- }
105
- else
106
- {
107
- ostr.write(&facet, &facet + 1);
108
- }
109
- ostr.write(operation, false);
110
- }
111
- // dispatchExceptionMessage remains empty: RequestFailedException does not carry a message and we
112
- // don't include this message in OutgoingResponse.
113
- }
114
- else
115
- {
116
- dispatchExceptionMessage = ex.what();
117
- // And marshal this exception after the last catch block.
118
- }
119
- }
120
- catch (const LocalException& ex)
121
- {
122
- exceptionId = ex.ice_id();
123
- exceptionDetails = toString(ex);
124
- dispatchExceptionMessage = createDispatchExceptionMessage(exceptionId, ex.what());
125
- replyStatus = ReplyStatus::UnknownLocalException;
126
- }
127
- catch (const std::exception& ex)
128
- {
129
- exceptionId = demangle(typeid(ex).name());
130
- ostringstream str;
131
- str << "c++ exception: " << ex.what();
132
- exceptionDetails = str.str();
133
- dispatchExceptionMessage = createDispatchExceptionMessage(exceptionId, ex.what());
134
- replyStatus = ReplyStatus::UnknownException;
135
- }
136
- catch (...)
137
- {
138
- exceptionId = "unknown";
139
- exceptionDetails = "c++ exception: unknown";
140
- dispatchExceptionMessage = createDispatchExceptionMessage(exceptionId, "c++ exception");
141
- replyStatus = ReplyStatus::UnknownException;
142
- }
143
-
144
- if (current.requestId != 0 && replyStatus > ReplyStatus::OperationNotExist)
145
- {
146
- // We can't use the generated code to marshal a possibly unknown reply status.
147
- ostr.write(static_cast<uint8_t>(replyStatus));
148
- ostr.write(dispatchExceptionMessage);
149
- }
150
-
151
- return OutgoingResponse{
152
- replyStatus,
153
- std::move(exceptionId),
154
- std::move(exceptionDetails),
155
- std::move(ostr),
156
- current};
157
- }
158
35
  } // anonymous namespace
159
36
 
160
37
  OutgoingResponse::OutgoingResponse(
@@ -264,13 +141,136 @@ Ice::makeOutgoingResponse(bool ok, pair<const byte*, const byte*> encapsulation,
264
141
  OutgoingResponse
265
142
  Ice::makeOutgoingResponse(std::exception_ptr exc, const Current& current) noexcept
266
143
  {
144
+ IceInternal::Instance* instance = getInstance(current.adapter->getCommunicator()).get();
145
+
267
146
  try
268
147
  {
269
- return makeOutgoingResponseCore(exc, current);
148
+ return makeOutgoingResponseCore(exc, current, instance);
270
149
  }
271
150
  catch (...)
272
151
  {
273
152
  // This could throw again, but then it's either a bug or we can't allocate anything.
274
- return makeOutgoingResponseCore(current_exception(), current);
153
+ return makeOutgoingResponseCore(current_exception(), current, instance);
275
154
  }
276
155
  }
156
+
157
+ // The "core" implementation of makeOutgoingResponse for exceptions. Note that it can throw an exception.
158
+ OutgoingResponse
159
+ Ice::makeOutgoingResponseCore(std::exception_ptr exc, const Current& current, Instance* instance)
160
+ {
161
+ assert(exc);
162
+ OutputStream ostr{instance, currentProtocolEncoding};
163
+
164
+ if (current.requestId != 0)
165
+ {
166
+ ostr.writeBlob(replyHdr, sizeof(replyHdr));
167
+ ostr.write(current.requestId);
168
+ }
169
+ ReplyStatus replyStatus;
170
+ string exceptionId;
171
+ string exceptionDetails; // may include the stack trace.
172
+ string dispatchExceptionMessage;
173
+
174
+ try
175
+ {
176
+ rethrow_exception(exc);
177
+ }
178
+ catch (const UserException& ex)
179
+ {
180
+ // We keep exceptionId and exceptionDetails empty.
181
+
182
+ replyStatus = ReplyStatus::UserException;
183
+
184
+ if (current.requestId != 0)
185
+ {
186
+ ostr.write(replyStatus);
187
+ ostr.startEncapsulation(current.encoding, FormatType::SlicedFormat);
188
+ ostr.write(ex);
189
+ ostr.endEncapsulation();
190
+ }
191
+ }
192
+ catch (const DispatchException& ex)
193
+ {
194
+ exceptionId = ex.ice_id();
195
+ exceptionDetails = toString(ex); // can include a stack trace
196
+ replyStatus = ex.replyStatus();
197
+
198
+ if (replyStatus >= ReplyStatus::ObjectNotExist && replyStatus <= ReplyStatus::OperationNotExist)
199
+ {
200
+ if (current.requestId != 0) // only marshal response for two-way requests
201
+ {
202
+ // The identity, facet, operation are often left unset at this point.
203
+ Identity id;
204
+ string facet;
205
+ string operation;
206
+ if (auto* rfe = dynamic_cast<const RequestFailedException*>(&ex))
207
+ {
208
+ id = rfe->id();
209
+ facet = rfe->facet();
210
+ operation = rfe->operation();
211
+ }
212
+ if (id.name.empty())
213
+ {
214
+ id = current.id;
215
+ facet = current.facet;
216
+ }
217
+ if (operation.empty())
218
+ {
219
+ operation = current.operation;
220
+ }
221
+
222
+ ostr.write(replyStatus);
223
+ ostr.write(id);
224
+
225
+ if (facet.empty())
226
+ {
227
+ ostr.write(static_cast<string*>(nullptr), static_cast<string*>(nullptr));
228
+ }
229
+ else
230
+ {
231
+ ostr.write(&facet, &facet + 1);
232
+ }
233
+ ostr.write(operation, false);
234
+ }
235
+ // dispatchExceptionMessage remains empty: RequestFailedException does not carry a message and we
236
+ // don't include this message in OutgoingResponse.
237
+ }
238
+ else
239
+ {
240
+ dispatchExceptionMessage = ex.what();
241
+ // And marshal this exception after the last catch block.
242
+ }
243
+ }
244
+ catch (const LocalException& ex)
245
+ {
246
+ exceptionId = ex.ice_id();
247
+ exceptionDetails = toString(ex);
248
+ dispatchExceptionMessage = createDispatchExceptionMessage(exceptionId, ex.what());
249
+ replyStatus = ReplyStatus::UnknownLocalException;
250
+ }
251
+ catch (const std::exception& ex)
252
+ {
253
+ exceptionId = demangle(typeid(ex).name());
254
+ ostringstream str;
255
+ str << "c++ exception: " << ex.what();
256
+ exceptionDetails = str.str();
257
+ dispatchExceptionMessage = createDispatchExceptionMessage(exceptionId, ex.what());
258
+ replyStatus = ReplyStatus::UnknownException;
259
+ }
260
+ catch (...)
261
+ {
262
+ exceptionId = "unknown";
263
+ exceptionDetails = "c++ exception: unknown";
264
+ dispatchExceptionMessage = createDispatchExceptionMessage(exceptionId, "c++ exception");
265
+ replyStatus = ReplyStatus::UnknownException;
266
+ }
267
+
268
+ if (current.requestId != 0 && replyStatus > ReplyStatus::OperationNotExist)
269
+ {
270
+ // We can't use the generated code to marshal a possibly unknown reply status.
271
+ ostr.write(static_cast<uint8_t>(replyStatus));
272
+ ostr.write(dispatchExceptionMessage);
273
+ }
274
+
275
+ return OutgoingResponse{replyStatus, std::move(exceptionId), std::move(exceptionDetails), std::move(ostr), current};
276
+ }
@@ -0,0 +1,21 @@
1
+ // Copyright (c) ZeroC, Inc.
2
+
3
+ #ifndef ICE_OUTGOING_RESPONSE_INTERNAL_H
4
+ #define ICE_OUTGOING_RESPONSE_INTERNAL_H
5
+
6
+ #include "Ice/OutgoingResponse.h"
7
+
8
+ namespace Ice
9
+ {
10
+ /// @private
11
+ /// The "core" implementation of makeOutgoingResponse for exceptions. Note that it can throw an exception.
12
+ /// @param exception The exception to marshal into the response.
13
+ /// @param current A reference to the Current object of the request. @c current.adapter can be null here; the
14
+ /// implementation uses @p instance instead.
15
+ /// @param instance The IceInternal::Instance object. Not null.
16
+ /// @return The new response.
17
+ OutgoingResponse
18
+ makeOutgoingResponseCore(std::exception_ptr exception, const Current& current, IceInternal::Instance* instance);
19
+ }
20
+
21
+ #endif