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
@@ -11,7 +11,9 @@
11
11
  # include <winsock2.h>
12
12
  #else
13
13
  # include "Network.h"
14
+ # include <algorithm>
14
15
  # include <csignal>
16
+ # include <sys/resource.h>
15
17
  # include <sys/stat.h>
16
18
  # include <sys/types.h>
17
19
  # ifdef ICE_USE_SYSTEMD
@@ -172,93 +174,6 @@ namespace
172
174
  DeregisterEventSource(_source);
173
175
  }
174
176
 
175
- static void addKeys(const string& source, const StringConverterPtr& stringConverter)
176
- {
177
- HKEY hKey;
178
- DWORD d;
179
- //
180
- // Don't need to use a wide string converter as the wide string is passed
181
- // to Windows API.
182
- //
183
- LSTATUS err = RegCreateKeyExW(
184
- HKEY_LOCAL_MACHINE,
185
- stringToWstring(createKey(source), stringConverter).c_str(),
186
- 0,
187
- const_cast<wchar_t*>(L"REG_SZ"),
188
- REG_OPTION_NON_VOLATILE,
189
- KEY_ALL_ACCESS,
190
- 0,
191
- &hKey,
192
- &d);
193
-
194
- if (err != ERROR_SUCCESS)
195
- {
196
- throw SyscallException{__FILE__, __LINE__, "RegCreateKeyExW failed", static_cast<DWORD>(err)};
197
- }
198
-
199
- //
200
- // Get the filename of this DLL.
201
- //
202
- wchar_t path[_MAX_PATH];
203
- assert(_module != 0);
204
- if (!GetModuleFileNameW(_module, path, _MAX_PATH))
205
- {
206
- DWORD error = GetLastError();
207
- RegCloseKey(hKey);
208
- throw SyscallException{__FILE__, __LINE__, "GetModuleFileNameW failed", error};
209
- }
210
-
211
- //
212
- // The event resources are bundled into this DLL, therefore
213
- // the "EventMessageFile" key should contain the path to this
214
- // DLL.
215
- //
216
- err = RegSetValueExW(
217
- hKey,
218
- L"EventMessageFile",
219
- 0,
220
- REG_EXPAND_SZ,
221
- reinterpret_cast<unsigned char*>(path),
222
- static_cast<DWORD>((wcslen(path) * sizeof(wchar_t)) + 1));
223
-
224
- if (err == ERROR_SUCCESS)
225
- {
226
- //
227
- // The "TypesSupported" key indicates the supported event
228
- // types.
229
- //
230
- DWORD typesSupported = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE;
231
- err = RegSetValueExW(
232
- hKey,
233
- L"TypesSupported",
234
- 0,
235
- REG_DWORD,
236
- reinterpret_cast<unsigned char*>(&typesSupported),
237
- sizeof(typesSupported));
238
- }
239
- if (err != ERROR_SUCCESS)
240
- {
241
- RegCloseKey(hKey);
242
- throw SyscallException{__FILE__, __LINE__, "RegSetValueExW failed", static_cast<DWORD>(err)};
243
- }
244
-
245
- RegCloseKey(hKey);
246
- }
247
-
248
- static void removeKeys(const string& source, const StringConverterPtr& stringConverter)
249
- {
250
- //
251
- // Don't need to use a wide string converter as the wide string is passed
252
- // to Windows API.
253
- //
254
- LSTATUS err =
255
- RegDeleteKeyW(HKEY_LOCAL_MACHINE, stringToWstring(createKey(source), stringConverter).c_str());
256
- if (err != ERROR_SUCCESS)
257
- {
258
- throw SyscallException{__FILE__, __LINE__, "RegDeleteKeyW failed", static_cast<DWORD>(err)};
259
- }
260
- }
261
-
262
177
  virtual void print(const string& prefix, const string& message)
263
178
  {
264
179
  string s;
@@ -379,8 +294,6 @@ namespace
379
294
  ReportEventW(_source, EVENTLOG_ERROR_TYPE, 0, EVENT_LOGGER_MSG, 0, 1, 0, messages, 0);
380
295
  }
381
296
 
382
- static void setModuleHandle(HMODULE module) { _module = module; }
383
-
384
297
  private:
385
298
  static string mangleSource(string name)
386
299
  {
@@ -395,22 +308,9 @@ namespace
395
308
  return name;
396
309
  }
397
310
 
398
- static string createKey(string name)
399
- {
400
- //
401
- // The registry key is:
402
- //
403
- // HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application.
404
- //
405
- return "SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\" + mangleSource(name);
406
- }
407
-
408
311
  StringConverterPtr _stringConverter;
409
312
  HANDLE _source;
410
- static HMODULE _module;
411
313
  };
412
-
413
- HMODULE SMEventLoggerI::_module = 0;
414
314
  }
415
315
 
416
316
  #endif
@@ -425,6 +325,7 @@ Ice::Service::~Service()
425
325
  {
426
326
  _instance = nullptr;
427
327
  delete ctrlCHandler;
328
+ ctrlCHandler = nullptr;
428
329
  }
429
330
 
430
331
  bool
@@ -816,12 +717,6 @@ Ice::Service::configureService(const string& name)
816
717
  _name = name;
817
718
  }
818
719
 
819
- void
820
- Ice::Service::setModuleHandle(HMODULE module)
821
- {
822
- SMEventLoggerI::setModuleHandle(module);
823
- }
824
-
825
720
  #else
826
721
 
827
722
  void
@@ -1385,7 +1280,10 @@ ServiceStatusManager::stopUpdate()
1385
1280
  }
1386
1281
  }
1387
1282
 
1388
- thread.join();
1283
+ if (thread.joinable())
1284
+ {
1285
+ thread.join();
1286
+ }
1389
1287
  }
1390
1288
 
1391
1289
  void
@@ -1469,7 +1367,8 @@ Ice::Service::runDaemon(int argc, char* argv[], InitializationData initData)
1469
1367
  char c = 0;
1470
1368
  while (true)
1471
1369
  {
1472
- if (read(fds[0], &c, 1) == -1)
1370
+ ssize_t rc = read(fds[0], &c, 1);
1371
+ if (rc == -1)
1473
1372
  {
1474
1373
  if (IceInternal::interrupted())
1475
1374
  {
@@ -1483,6 +1382,20 @@ Ice::Service::runDaemon(int argc, char* argv[], InitializationData initData)
1483
1382
  consoleErr << IceInternal::errorToString(errno) << endl;
1484
1383
  _exit(EXIT_FAILURE);
1485
1384
  }
1385
+ else if (rc == 0)
1386
+ {
1387
+ //
1388
+ // EOF before the readiness byte: the daemon exited during startup without signaling readiness
1389
+ // (e.g. it was killed by a signal or aborted in a plug-in). Report a failure so supervisors don't
1390
+ // conclude the service started successfully.
1391
+ //
1392
+ if (argv[0])
1393
+ {
1394
+ consoleErr << argv[0] << ": ";
1395
+ }
1396
+ consoleErr << "daemon exited during startup before signaling readiness" << endl;
1397
+ _exit(EXIT_FAILURE);
1398
+ }
1486
1399
  break;
1487
1400
  }
1488
1401
 
@@ -1494,7 +1407,7 @@ Ice::Service::runDaemon(int argc, char* argv[], InitializationData initData)
1494
1407
  ssize_t rs;
1495
1408
  char s[16];
1496
1409
  string message;
1497
- while ((rs = read(fds[0], &s, 16)) > 0)
1410
+ while ((rs = read(fds[0], s, sizeof(s))) > 0)
1498
1411
  {
1499
1412
  message.append(s, static_cast<size_t>(rs));
1500
1413
  }
@@ -1579,13 +1492,18 @@ Ice::Service::runDaemon(int argc, char* argv[], InitializationData initData)
1579
1492
  // have an opportunity to use stdin/stdout/stderr if necessary. This also
1580
1493
  // conveniently allows the Ice.PrintProcessId property to work as expected.
1581
1494
  //
1582
- int fdMax = static_cast<int>(sysconf(_SC_OPEN_MAX));
1583
- if (fdMax <= 0)
1495
+ // Bound the probe loop by the soft RLIMIT_NOFILE — the kernel never allocates a
1496
+ // descriptor at or above it — capped so the loop stays cheap even with a very large
1497
+ // limit (such as LimitNOFILE=infinity under systemd).
1498
+ //
1499
+ rlim_t fdMax = 1 << 20;
1500
+ rlimit fdLimit{};
1501
+ if (getrlimit(RLIMIT_NOFILE, &fdLimit) == 0)
1584
1502
  {
1585
- throw SyscallException{__FILE__, __LINE__, "sysconf failed", errno};
1503
+ fdMax = std::min(fdMax, fdLimit.rlim_cur);
1586
1504
  }
1587
1505
 
1588
- for (int i = 0; i < fdMax; ++i)
1506
+ for (int i = 0; i < static_cast<int>(fdMax); ++i)
1589
1507
  {
1590
1508
  if (fcntl(i, F_GETFL) != -1)
1591
1509
  {
@@ -10,7 +10,8 @@ StreamSocket::StreamSocket(
10
10
  ProtocolInstancePtr instance,
11
11
  const NetworkProxyPtr& proxy,
12
12
  const Address& addr,
13
- const Address& sourceAddr)
13
+ const Address& sourceAddr,
14
+ const TcpBufSize& bufSize)
14
15
  : NativeInfo(createSocket(false, proxy ? proxy->getAddress() : addr)),
15
16
  _instance(std::move(instance)),
16
17
  _proxy(proxy),
@@ -23,25 +24,17 @@ StreamSocket::StreamSocket(
23
24
  _write(SocketOperationWrite)
24
25
  #endif
25
26
  {
26
- init();
27
+ init(bufSize);
27
28
  #if !defined(ICE_USE_IOCP)
28
29
  if (doConnect(_fd, _proxy ? _proxy->getAddress() : _addr, sourceAddr))
29
30
  {
30
31
  _state = _proxy ? StateProxyWrite : StateConnected;
31
32
  }
32
33
  #endif
33
- try
34
- {
35
- _desc = fdToString(_fd, _proxy, _addr);
36
- }
37
- catch (const Ice::Exception&)
38
- {
39
- closeSocketNoThrow(_fd);
40
- throw;
41
- }
34
+ _desc = fdToString(_fd, _proxy, _addr);
42
35
  }
43
36
 
44
- StreamSocket::StreamSocket(ProtocolInstancePtr instance, SOCKET fd)
37
+ StreamSocket::StreamSocket(ProtocolInstancePtr instance, SOCKET fd, const TcpBufSize& bufSize)
45
38
  : NativeInfo(fd),
46
39
  _instance(std::move(instance)),
47
40
  _addr(),
@@ -53,16 +46,8 @@ StreamSocket::StreamSocket(ProtocolInstancePtr instance, SOCKET fd)
53
46
  _write(SocketOperationWrite)
54
47
  #endif
55
48
  {
56
- init();
57
- try
58
- {
59
- _desc = fdToString(fd);
60
- }
61
- catch (const Ice::Exception&)
62
- {
63
- closeSocketNoThrow(fd);
64
- throw;
65
- }
49
+ init(bufSize);
50
+ _desc = fdToString(fd);
66
51
  }
67
52
 
68
53
  StreamSocket::~StreamSocket() { assert(_fd == INVALID_SOCKET); }
@@ -113,16 +98,19 @@ StreamSocket::connect(Buffer& readBuffer, Buffer& writeBuffer)
113
98
  return IceInternal::SocketOperationNone;
114
99
  }
115
100
 
116
- bool
117
- StreamSocket::isConnected()
118
- {
119
- return _state == StateConnected && _fd != INVALID_SOCKET;
120
- }
121
-
122
101
  void
123
102
  StreamSocket::setBufferSize(int rcvSize, int sndSize)
124
103
  {
125
- setTcpBufSize(_fd, rcvSize, sndSize, _instance);
104
+ try
105
+ {
106
+ setTcpBufSize(_fd, rcvSize, sndSize, _instance);
107
+ }
108
+ catch (const Ice::SocketException&)
109
+ {
110
+ // The failing call closed the fd.
111
+ clearFd();
112
+ throw;
113
+ }
126
114
  }
127
115
 
128
116
  SocketOperation
@@ -431,16 +419,19 @@ StreamSocket::finishRead(Buffer& buf)
431
419
  void
432
420
  StreamSocket::close()
433
421
  {
434
- assert(_fd != INVALID_SOCKET);
435
- try
422
+ // _fd can be INVALID_SOCKET when a failed socket operation already closed the fd.
423
+ if (_fd != INVALID_SOCKET)
436
424
  {
437
- closeSocket(_fd);
438
- _fd = INVALID_SOCKET;
439
- }
440
- catch (const Ice::SocketException&)
441
- {
442
- _fd = INVALID_SOCKET;
443
- throw;
425
+ try
426
+ {
427
+ closeSocket(_fd);
428
+ _fd = INVALID_SOCKET;
429
+ }
430
+ catch (const Ice::SocketException&)
431
+ {
432
+ _fd = INVALID_SOCKET;
433
+ throw;
434
+ }
444
435
  }
445
436
  }
446
437
 
@@ -451,10 +442,12 @@ StreamSocket::toString() const
451
442
  }
452
443
 
453
444
  void
454
- StreamSocket::init()
445
+ StreamSocket::init(const TcpBufSize& bufSize)
455
446
  {
447
+ // Both calls close the fd before throwing a SocketException, so a failure cannot leak the fd — and since init
448
+ // is only called from constructors, the exception abandons the object and nothing uses the stale _fd afterward.
456
449
  setBlock(_fd, false);
457
- setTcpBufSize(_fd, _instance);
450
+ setTcpBufSize(_fd, bufSize.rcvSize(), bufSize.sndSize(), _instance);
458
451
  }
459
452
 
460
453
  StreamSocket::State
@@ -6,6 +6,7 @@
6
6
  #include "Ice/Buffer.h"
7
7
  #include "Network.h"
8
8
  #include "ProtocolInstanceF.h"
9
+ #include "TcpBufSize.h"
9
10
 
10
11
  #include <memory>
11
12
 
@@ -14,12 +15,11 @@ namespace IceInternal
14
15
  class StreamSocket : public NativeInfo
15
16
  {
16
17
  public:
17
- StreamSocket(ProtocolInstancePtr, const NetworkProxyPtr&, const Address&, const Address&);
18
- StreamSocket(ProtocolInstancePtr, SOCKET);
18
+ StreamSocket(ProtocolInstancePtr, const NetworkProxyPtr&, const Address&, const Address&, const TcpBufSize&);
19
+ StreamSocket(ProtocolInstancePtr, SOCKET, const TcpBufSize&);
19
20
  ~StreamSocket() override;
20
21
 
21
22
  SocketOperation connect(Buffer&, Buffer&);
22
- bool isConnected();
23
23
 
24
24
  void setBufferSize(int rcvSize, int sndSize);
25
25
 
@@ -41,7 +41,7 @@ namespace IceInternal
41
41
  [[nodiscard]] const std::string& toString() const;
42
42
 
43
43
  private:
44
- void init();
44
+ void init(const TcpBufSize&);
45
45
 
46
46
  enum State
47
47
  {
@@ -483,7 +483,7 @@ namespace
483
483
  wstring wbuffer;
484
484
 
485
485
  //
486
- // The following code pages doesn't support MB_ERR_INVALID_CHARS flag
486
+ // The following code pages don't support the MB_ERR_INVALID_CHARS flag
487
487
  // see http://msdn.microsoft.com/en-us/library/windows/desktop/dd319072(v=vs.85).aspx
488
488
  //
489
489
  DWORD flags = (_cp == 50220 || _cp == 50221 || _cp == 50222 || _cp == 50225 || _cp == 50227 || _cp == 50229 ||
@@ -337,6 +337,7 @@ namespace
337
337
  // end marks the one-past-the-end position of the substring to be scanned.
338
338
  // nextStart is set to the index of the first character following the decoded
339
339
  // character or escape sequence.
340
+ // Returns true if the decoded character is pure ASCII (<= 127), false otherwise.
340
341
  //
341
342
  bool decodeChar(
342
343
  const string& s,
@@ -353,6 +354,10 @@ namespace
353
354
 
354
355
  if (s[start] != '\\')
355
356
  {
357
+ if (static_cast<unsigned char>(s[start]) > 127)
358
+ {
359
+ pureASCII = false;
360
+ }
356
361
  result.push_back(checkChar(s, start++));
357
362
  }
358
363
  else if (start + 1 == end)
@@ -585,7 +590,7 @@ IceInternal::unescapeString(
585
590
  {
586
591
  checkChar(s, p++);
587
592
  }
588
- return s.substr(start, end);
593
+ return s.substr(start, end - start);
589
594
  }
590
595
  else
591
596
  {
@@ -605,7 +610,7 @@ IceInternal::unescapeString(
605
610
 
606
611
  if (!inputIsPureASCII)
607
612
  {
608
- u8s = nativeToUTF8(s.substr(start, end), stringConverter);
613
+ u8s = nativeToUTF8(s.substr(start, end - start), stringConverter);
609
614
  inputStringPtr = &u8s;
610
615
  start = 0;
611
616
  end = u8s.size();
@@ -617,7 +622,7 @@ IceInternal::unescapeString(
617
622
  result.reserve(end - start);
618
623
  while (start < end)
619
624
  {
620
- if (decodeChar(*inputStringPtr, start, end, start, special, result))
625
+ if (!decodeChar(*inputStringPtr, start, end, start, special, result))
621
626
  {
622
627
  resultIsPureASCII = false;
623
628
  }
@@ -801,7 +806,7 @@ IceInternal::match(const string& s, const string& pat, bool emptyMatch)
801
806
  //
802
807
  // Make sure end of the strings match
803
808
  //
804
- if (s.substr(endIndex, s.length()) != pat.substr(beginIndex + 1, pat.length()))
809
+ if (s.substr(endIndex) != pat.substr(beginIndex + 1))
805
810
  {
806
811
  return false;
807
812
  }
@@ -1032,10 +1037,10 @@ IceInternal::errorToString(int error)
1032
1037
  //
1033
1038
  // Use the XSI-compliant version of strerror_r
1034
1039
  //
1035
- int err = strerror_r(error, &buffer[0], buffer.size());
1040
+ int err = strerror_r(error, buffer.data(), buffer.size());
1036
1041
  if (err == 0)
1037
1042
  {
1038
- return {&buffer[0]};
1043
+ return {buffer.data()};
1039
1044
  }
1040
1045
  # else
1041
1046
  //
@@ -1043,7 +1048,7 @@ IceInternal::errorToString(int error)
1043
1048
  //
1044
1049
  int oerrno = errno;
1045
1050
  errno = 0;
1046
- const char* msg = strerror_r(error, &buffer[0], buffer.size());
1051
+ const char* msg = strerror_r(error, buffer.data(), buffer.size());
1047
1052
  int err = errno;
1048
1053
  errno = oerrno;
1049
1054
  if (err == 0)
@@ -1121,17 +1126,3 @@ IceInternal::isDigit(char c)
1121
1126
  {
1122
1127
  return c >= '0' && c <= '9';
1123
1128
  }
1124
-
1125
- string
1126
- IceInternal::removeWhitespace(string_view s)
1127
- {
1128
- string result;
1129
- for (unsigned int i = 0; i < s.length(); ++i)
1130
- {
1131
- if (!isspace(static_cast<unsigned char>(s[i])))
1132
- {
1133
- result += s[i];
1134
- }
1135
- }
1136
- return result;
1137
- }