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
@@ -38,8 +38,8 @@ IceInternal::isAbsolutePath(const string& path)
38
38
  }
39
39
 
40
40
  #ifdef _WIN32
41
- // We need at least 3 non whitespace character to have
42
- // and absolute path
41
+ // We need at least 3 non whitespace characters to have
42
+ // an absolute path
43
43
  if (i + 3 > size)
44
44
  {
45
45
  return false;
@@ -195,39 +195,11 @@ IceInternal::mkdir(const string& path, int)
195
195
  return ::_wmkdir(stringToWstring(path, Ice::getProcessStringConverter()).c_str());
196
196
  }
197
197
 
198
- FILE*
199
- IceInternal::fopen(const string& path, const string& mode)
200
- {
201
- //
202
- // Don't need to use a wide string converter, the wide strings are directly passed
203
- // to Windows API.
204
- //
205
- const Ice::StringConverterPtr converter = Ice::getProcessStringConverter();
206
- return ::_wfopen(stringToWstring(path, converter).c_str(), stringToWstring(mode, converter).c_str());
207
- }
208
-
209
- int
210
- IceInternal::open(const string& path, int flags)
211
- {
212
- //
213
- // Don't need to use a wide string converter, the wide string is directly passed
214
- // to Windows API.
215
- //
216
- if (flags & _O_CREAT)
217
- {
218
- return ::_wopen(stringToWstring(path, Ice::getProcessStringConverter()).c_str(), flags, _S_IREAD | _S_IWRITE);
219
- }
220
- else
221
- {
222
- return ::_wopen(stringToWstring(path, Ice::getProcessStringConverter()).c_str(), flags);
223
- }
224
- }
225
-
226
198
  int
227
199
  IceInternal::getcwd(string& cwd)
228
200
  {
229
201
  //
230
- // Don't need to use a wide string converter, the wide string come
202
+ // Don't need to use a wide string converter, the wide string comes
231
203
  // from Windows API.
232
204
  //
233
205
  wchar_t cwdbuf[_MAX_PATH];
@@ -249,16 +221,6 @@ IceInternal::unlink(const string& path)
249
221
  return _wunlink(stringToWstring(path, Ice::getProcessStringConverter()).c_str());
250
222
  }
251
223
 
252
- int
253
- IceInternal::close(int fd)
254
- {
255
- # ifdef _WIN32
256
- return _close(fd);
257
- # else
258
- return ::close(fd);
259
- # endif
260
- }
261
-
262
224
  IceInternal::FileLock::FileLock(const std::string& path) : _path(path)
263
225
  {
264
226
  //
@@ -280,19 +242,19 @@ IceInternal::FileLock::FileLock(const std::string& path) : _path(path)
280
242
  throw FileLockException(__FILE__, __LINE__, GetLastError(), _path);
281
243
  }
282
244
 
283
- OVERLAPPED overlaped;
284
- overlaped.Internal = 0;
285
- overlaped.InternalHigh = 0;
286
- overlaped.Offset = 0;
287
- overlaped.OffsetHigh = 0;
245
+ OVERLAPPED overlapped;
246
+ overlapped.Internal = 0;
247
+ overlapped.InternalHigh = 0;
248
+ overlapped.Offset = 0;
249
+ overlapped.OffsetHigh = 0;
288
250
 
289
251
  # if defined(_MSC_VER)
290
- overlaped.hEvent = nullptr;
252
+ overlapped.hEvent = nullptr;
291
253
  # else
292
- overlaped.hEvent = 0;
254
+ overlapped.hEvent = 0;
293
255
  # endif
294
256
 
295
- if (::LockFileEx(_fd, LOCKFILE_EXCLUSIVE_LOCK | LOCKFILE_FAIL_IMMEDIATELY, 0, 0, 0, &overlaped) == 0)
257
+ if (::LockFileEx(_fd, LOCKFILE_EXCLUSIVE_LOCK | LOCKFILE_FAIL_IMMEDIATELY, 0, 0, 0, &overlapped) == 0)
296
258
  {
297
259
  ::CloseHandle(_fd);
298
260
  throw FileLockException(__FILE__, __LINE__, GetLastError(), _path);
@@ -351,26 +313,6 @@ IceInternal::mkdir(const string& path, int perm)
351
313
  return ::mkdir(path.c_str(), static_cast<mode_t>(perm));
352
314
  }
353
315
 
354
- FILE*
355
- IceInternal::fopen(const string& path, const string& mode)
356
- {
357
- return ::fopen(path.c_str(), mode.c_str());
358
- }
359
-
360
- int
361
- IceInternal::open(const string& path, int flags)
362
- {
363
- if (flags & O_CREAT)
364
- {
365
- // By default, create with rw-rw-rw- modified by the user's umask (same as fopen).
366
- return ::open(path.c_str(), flags, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
367
- }
368
- else
369
- {
370
- return ::open(path.c_str(), flags);
371
- }
372
- }
373
-
374
316
  int
375
317
  IceInternal::getcwd(string& cwd)
376
318
  {
@@ -389,15 +331,9 @@ IceInternal::unlink(const string& path)
389
331
  return ::unlink(path.c_str());
390
332
  }
391
333
 
392
- int
393
- IceInternal::close(int fd)
394
- {
395
- return ::close(fd);
396
- }
397
-
398
334
  IceInternal::FileLock::FileLock(const std::string& path) : _path(path)
399
335
  {
400
- _fd = ::open(path.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
336
+ _fd = ::open(path.c_str(), O_RDWR | O_CREAT | O_NOFOLLOW, S_IRUSR | S_IWUSR);
401
337
  if (_fd < 0)
402
338
  {
403
339
  throw FileLockException(__FILE__, __LINE__, errno, _path);
@@ -417,7 +353,7 @@ IceInternal::FileLock::FileLock(const std::string& path) : _path(path)
417
353
  if (::fcntl(_fd, F_SETLK, &lock) == -1)
418
354
  {
419
355
  int err = errno;
420
- close(_fd);
356
+ ::close(_fd);
421
357
  throw FileLockException(__FILE__, __LINE__, err, _path);
422
358
  }
423
359
 
@@ -427,7 +363,7 @@ IceInternal::FileLock::FileLock(const std::string& path) : _path(path)
427
363
  //
428
364
 
429
365
  //
430
- // Now that we have acquire an exclusive write lock,
366
+ // Now that we have acquired an exclusive write lock,
431
367
  // write the process pid there.
432
368
  //
433
369
  ostringstream os;
@@ -436,7 +372,7 @@ IceInternal::FileLock::FileLock(const std::string& path) : _path(path)
436
372
  if (write(_fd, os.str().c_str(), os.str().size()) == -1)
437
373
  {
438
374
  int err = errno;
439
- close(_fd);
375
+ ::close(_fd);
440
376
  throw FileLockException(__FILE__, __LINE__, err, _path);
441
377
  }
442
378
  }
@@ -84,13 +84,10 @@ namespace IceInternal
84
84
  ICE_API int rmdir(const std::string&);
85
85
 
86
86
  ICE_API int mkdir(const std::string&, int);
87
- ICE_API FILE* fopen(const std::string&, const std::string&);
88
87
  ICE_API FILE* freopen(const std::string&, const std::string&, FILE*);
89
- ICE_API int open(const std::string&, int);
90
88
  ICE_API int getcwd(std::string&);
91
89
 
92
90
  ICE_API int unlink(const std::string&);
93
- ICE_API int close(int);
94
91
 
95
92
  //
96
93
  // This class is used to implement process file locking. This class
@@ -28,7 +28,7 @@ FixedRequestHandler::asyncRequestCanceled(const OutgoingAsyncBasePtr& outAsync,
28
28
  }
29
29
 
30
30
  Ice::ConnectionIPtr
31
- FixedRequestHandler::getConnection()
31
+ FixedRequestHandler::getConnection() noexcept
32
32
  {
33
33
  return _connection;
34
34
  }
@@ -18,7 +18,7 @@ namespace IceInternal
18
18
 
19
19
  void asyncRequestCanceled(const OutgoingAsyncBasePtr&, std::exception_ptr) final;
20
20
 
21
- Ice::ConnectionIPtr getConnection() final;
21
+ Ice::ConnectionIPtr getConnection() noexcept final;
22
22
 
23
23
  private:
24
24
  Ice::ConnectionIPtr _connection;
@@ -12,8 +12,6 @@
12
12
 
13
13
  namespace IceInternal
14
14
  {
15
- std::vector<unsigned char> calcSHA1(const std::vector<unsigned char>&);
16
-
17
15
  using HeaderFields = std::map<std::string, std::pair<std::string, std::string>>;
18
16
 
19
17
  class WebSocketException
@@ -419,6 +419,10 @@ IceInternal::IPEndpointI::IPEndpointI(ProtocolInstancePtr instance, InputStream*
419
419
  s->read(const_cast<string&>(_host), false);
420
420
  const_cast<string&>(_normalizedHost) = normalizeIPv6Address(_host);
421
421
  s->read(const_cast<int32_t&>(_port));
422
+ if (_port < 0 || _port > 65535)
423
+ {
424
+ throw MarshalException{__FILE__, __LINE__, "port value '" + to_string(_port) + "' is out of range"};
425
+ }
422
426
  }
423
427
 
424
428
  IceInternal::EndpointHostResolver::EndpointHostResolver(const InstancePtr& instance)
@@ -70,15 +70,18 @@ IdleTimeoutTransceiverDecorator::initialize(Buffer& readBuffer, Buffer& writeBuf
70
70
 
71
71
  IdleTimeoutTransceiverDecorator::~IdleTimeoutTransceiverDecorator()
72
72
  {
73
- // Since ConnectionI is noexcept, decoratorInit always sets _heartbeatTimerTask.
74
- assert(_heartbeatTimerTask);
75
- _timer->cancel(_heartbeatTimerTask);
73
+ // _heartbeatTimerTask remains null when the connection creation fails before decoratorInit is called.
74
+ if (_heartbeatTimerTask)
75
+ {
76
+ _timer->cancel(_heartbeatTimerTask);
77
+ }
76
78
  disableIdleCheck();
77
79
  }
78
80
 
79
81
  void
80
82
  IdleTimeoutTransceiverDecorator::close()
81
83
  {
84
+ assert(_heartbeatTimerTask); // close is only called on a connection that completed decoratorInit.
82
85
  _timer->cancel(_heartbeatTimerTask);
83
86
  disableIdleCheck();
84
87
  _decoratee->close();
@@ -33,14 +33,12 @@ IncomingRequest::IncomingRequest(
33
33
  {
34
34
  throw MarshalException{__FILE__, __LINE__, "received facet path with more than one element"};
35
35
  }
36
- _current.facet = facetPath[0];
36
+ _current.facet = std::move(facetPath[0]);
37
37
  }
38
38
 
39
39
  inputStream.read(_current.operation, false);
40
40
 
41
- uint8_t mode;
42
- inputStream.read(mode);
43
- _current.mode = static_cast<OperationMode>(mode);
41
+ inputStream.read(_current.mode);
44
42
 
45
43
  int32_t sz = inputStream.readSize();
46
44
  while (sz--)
@@ -243,7 +243,8 @@ Ice::InputStream::startEncapsulation()
243
243
  {
244
244
  throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
245
245
  }
246
- if (i - sizeof(std::int32_t) + sz > b.end())
246
+ // sz includes the 4 bytes of the size itself, which we've already read.
247
+ if (sz - 4 > b.end() - i)
247
248
  {
248
249
  throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
249
250
  }
@@ -305,7 +306,8 @@ Ice::InputStream::skipEmptyEncapsulation()
305
306
  {
306
307
  throw MarshalException{__FILE__, __LINE__, to_string(sz) + " is not a valid encapsulation size"};
307
308
  }
308
- if (i - sizeof(std::int32_t) + sz > b.end())
309
+ // sz includes the 4 bytes of the size itself, which we've already read.
310
+ if (sz - 4 > b.end() - i)
309
311
  {
310
312
  throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
311
313
  }
@@ -342,7 +344,8 @@ Ice::InputStream::readEncapsulation(const std::byte*& v, std::int32_t& sz)
342
344
  {
343
345
  throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
344
346
  }
345
- if (i - sizeof(std::int32_t) + sz > b.end())
347
+ // sz includes the 4 bytes of the size itself, which we've already read.
348
+ if (sz - 4 > b.end() - i)
346
349
  {
347
350
  throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
348
351
  }
@@ -368,7 +371,8 @@ Ice::InputStream::skipEncapsulation()
368
371
  {
369
372
  throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
370
373
  }
371
- if (i - sizeof(int32_t) + sz > b.end())
374
+ // sz includes the 4 bytes of the size itself, which we've already read.
375
+ if (sz - 4 > b.end() - i)
372
376
  {
373
377
  throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
374
378
  }
@@ -428,26 +432,33 @@ Ice::InputStream::readAndCheckSeqSize(int minSize)
428
432
  // the estimated remaining buffer size. This estimation is based on
429
433
  // the minimum size of the enclosing sequences, it's _minSeqSize.
430
434
  //
431
- if (_startSeq == -1 || i > (b.begin() + _startSeq + _minSeqSize))
435
+ // 'sz' is peer-controlled (up to INT32_MAX), so we compute the minimum size of this sequence in
436
+ // 64-bit: 'sz * minSize' would otherwise overflow a 32-bit int and bypass the bounds check below.
437
+ int64_t minSeqSize = static_cast<int64_t>(sz) * minSize;
438
+
439
+ // '_startSeq + _minSeqSize' does not overflow: on the previous call, the bounds check below
440
+ // established this sum is <= b.size(), itself smaller than INT32_MAX.
441
+ if (_startSeq == -1 || (i - b.begin()) > _startSeq + _minSeqSize)
432
442
  {
433
443
  _startSeq = static_cast<int>(i - b.begin());
434
- _minSeqSize = sz * minSize;
435
444
  }
436
445
  else
437
446
  {
438
- _minSeqSize += sz * minSize;
447
+ minSeqSize += _minSeqSize;
439
448
  }
440
449
 
441
450
  //
442
451
  // If there isn't enough data to read on the stream for the sequence (and
443
452
  // possibly enclosed sequences), something is wrong with the marshaled
444
- // data: it's claiming having more data that what is possible to read.
453
+ // data: it's claiming to have more data than what is possible to read.
445
454
  //
446
- if (_startSeq + _minSeqSize > static_cast<int>(b.size()))
455
+ if (_startSeq + minSeqSize > static_cast<int64_t>(b.size()))
447
456
  {
448
457
  throwUnmarshalOutOfBoundsException(__FILE__, __LINE__);
449
458
  }
450
459
 
460
+ // minSeqSize is now known to be <= b.size(), itself smaller than INT32_MAX.
461
+ _minSeqSize = static_cast<int>(minSeqSize);
451
462
  return sz;
452
463
  }
453
464
 
@@ -474,15 +485,7 @@ Ice::InputStream::read(std::vector<byte>& v)
474
485
  {
475
486
  std::pair<const byte*, const byte*> p;
476
487
  read(p);
477
- if (p.first != p.second)
478
- {
479
- v.resize(static_cast<size_t>(p.second - p.first));
480
- copy(p.first, p.second, v.begin());
481
- }
482
- else
483
- {
484
- v.clear();
485
- }
488
+ v.assign(p.first, p.second);
486
489
  }
487
490
 
488
491
  void
@@ -599,7 +602,7 @@ Ice::InputStream::read(vector<int16_t>& v)
599
602
  if constexpr (endian::native == endian::big)
600
603
  {
601
604
  const byte* src = &(*begin);
602
- byte* dest = reinterpret_cast<byte*>(&v[0]) + sizeof(int16_t) - 1;
605
+ byte* dest = reinterpret_cast<byte*>(v.data()) + sizeof(int16_t) - 1;
603
606
  for (int j = 0; j < sz; ++j)
604
607
  {
605
608
  *dest-- = *src++;
@@ -609,7 +612,7 @@ Ice::InputStream::read(vector<int16_t>& v)
609
612
  }
610
613
  else
611
614
  {
612
- copy(begin, i, reinterpret_cast<byte*>(&v[0]));
615
+ copy(begin, i, reinterpret_cast<byte*>(v.data()));
613
616
  }
614
617
  }
615
618
  else
@@ -657,7 +660,7 @@ Ice::InputStream::read(vector<int32_t>& v)
657
660
  if constexpr (endian::native == endian::big)
658
661
  {
659
662
  const byte* src = &(*begin);
660
- byte* dest = reinterpret_cast<byte*>(&v[0]) + sizeof(int32_t) - 1;
663
+ byte* dest = reinterpret_cast<byte*>(v.data()) + sizeof(int32_t) - 1;
661
664
  for (int j = 0; j < sz; ++j)
662
665
  {
663
666
  *dest-- = *src++;
@@ -669,7 +672,7 @@ Ice::InputStream::read(vector<int32_t>& v)
669
672
  }
670
673
  else
671
674
  {
672
- copy(begin, i, reinterpret_cast<byte*>(&v[0]));
675
+ copy(begin, i, reinterpret_cast<byte*>(v.data()));
673
676
  }
674
677
  }
675
678
  else
@@ -725,7 +728,7 @@ Ice::InputStream::read(vector<int64_t>& v)
725
728
  if constexpr (endian::native == endian::big)
726
729
  {
727
730
  const byte* src = &(*begin);
728
- byte* dest = reinterpret_cast<byte*>(&v[0]) + sizeof(int64_t) - 1;
731
+ byte* dest = reinterpret_cast<byte*>(v.data()) + sizeof(int64_t) - 1;
729
732
  for (int j = 0; j < sz; ++j)
730
733
  {
731
734
  *dest-- = *src++;
@@ -741,7 +744,7 @@ Ice::InputStream::read(vector<int64_t>& v)
741
744
  }
742
745
  else
743
746
  {
744
- copy(begin, i, reinterpret_cast<byte*>(&v[0]));
747
+ copy(begin, i, reinterpret_cast<byte*>(v.data()));
745
748
  }
746
749
  }
747
750
  else
@@ -789,7 +792,7 @@ Ice::InputStream::read(vector<float>& v)
789
792
  if constexpr (endian::native == endian::big)
790
793
  {
791
794
  const byte* src = &(*begin);
792
- byte* dest = reinterpret_cast<byte*>(&v[0]) + sizeof(float) - 1;
795
+ byte* dest = reinterpret_cast<byte*>(v.data()) + sizeof(float) - 1;
793
796
  for (int j = 0; j < sz; ++j)
794
797
  {
795
798
  *dest-- = *src++;
@@ -801,7 +804,7 @@ Ice::InputStream::read(vector<float>& v)
801
804
  }
802
805
  else
803
806
  {
804
- copy(begin, i, reinterpret_cast<byte*>(&v[0]));
807
+ copy(begin, i, reinterpret_cast<byte*>(v.data()));
805
808
  }
806
809
  }
807
810
  else
@@ -857,7 +860,7 @@ Ice::InputStream::read(vector<double>& v)
857
860
  if constexpr (endian::native == endian::big)
858
861
  {
859
862
  const byte* src = &(*begin);
860
- byte* dest = reinterpret_cast<byte*>(&v[0]) + sizeof(double) - 1;
863
+ byte* dest = reinterpret_cast<byte*>(v.data()) + sizeof(double) - 1;
861
864
  for (int j = 0; j < sz; ++j)
862
865
  {
863
866
  *dest-- = *src++;
@@ -873,7 +876,7 @@ Ice::InputStream::read(vector<double>& v)
873
876
  }
874
877
  else
875
878
  {
876
- copy(begin, i, reinterpret_cast<byte*>(&v[0]));
879
+ copy(begin, i, reinterpret_cast<byte*>(v.data()));
877
880
  }
878
881
  }
879
882
  else
@@ -1142,6 +1145,13 @@ Ice::InputStream::readOptImpl(int32_t readTag, OptionalFormat expectedFormat)
1142
1145
 
1143
1146
  auto format = static_cast<OptionalFormat>(v & 0x07); // First 3 bits.
1144
1147
  auto tag = static_cast<int32_t>(v >> 3);
1148
+ if (tag > 30)
1149
+ {
1150
+ // We check for '> 30' instead of '> 29' because 30 is a special sentinel tag, handled by the next block.
1151
+ ostringstream os;
1152
+ os << "invalid tag '" << tag << "': tags larger than 29 must be encoded as a size";
1153
+ throw MarshalException(__FILE__, __LINE__, os.str());
1154
+ }
1145
1155
  if (tag == 30)
1146
1156
  {
1147
1157
  tag = readSize();
@@ -1454,7 +1464,7 @@ Ice::InputStream::EncapsDecoder10::read(PatchFunc patchFunc, void* patchAddr)
1454
1464
  //
1455
1465
  int32_t index;
1456
1466
  _stream->read(index);
1457
- if (index > 0)
1467
+ if (index > 0 || index == INT32_MIN)
1458
1468
  {
1459
1469
  throw MarshalException(__FILE__, __LINE__, "invalid object id");
1460
1470
  }
@@ -1480,7 +1490,7 @@ Ice::InputStream::EncapsDecoder10::throwException(UserExceptionFactory exception
1480
1490
  assert(_sliceType == NoSlice);
1481
1491
 
1482
1492
  //
1483
- // User exception with the 1.0 encoding start with a boolean flag
1493
+ // User exceptions with the 1.0 encoding start with a boolean flag
1484
1494
  // that indicates whether or not the exception has classes.
1485
1495
  //
1486
1496
  // This allows reading the pending values even if some part of
@@ -1916,7 +1926,11 @@ Ice::InputStream::EncapsDecoder11::startSlice()
1916
1926
  if (_current->sliceFlags & FLAG_HAS_SLICE_SIZE)
1917
1927
  {
1918
1928
  _stream->read(_current->sliceSize);
1919
- if (_current->sliceSize < 4)
1929
+ // A slice with optional members carries at least the 1-byte end marker in its body, so its
1930
+ // size (which includes the 4-byte size field) must be >= 5. We rely on this in skipSlice's
1931
+ // slice-preservation logic, which excludes the end marker by stepping back one byte.
1932
+ int32_t minSliceSize = (_current->sliceFlags & FLAG_HAS_OPTIONAL_MEMBERS) ? 5 : 4;
1933
+ if (_current->sliceSize < minSliceSize)
1920
1934
  {
1921
1935
  throw MarshalException{__FILE__, __LINE__, endOfBufferMessage};
1922
1936
  }
@@ -2074,7 +2088,10 @@ Ice::InputStream::EncapsDecoder11::readOptional(int32_t readTag, Ice::OptionalFo
2074
2088
  int32_t
2075
2089
  Ice::InputStream::EncapsDecoder11::readInstance(int32_t index, const PatchFunc& patchFunc, void* patchAddr)
2076
2090
  {
2077
- assert(index > 0);
2091
+ if (index <= 0)
2092
+ {
2093
+ throw MarshalException(__FILE__, __LINE__, "invalid class instance index");
2094
+ }
2078
2095
 
2079
2096
  if (index > 1)
2080
2097
  {
@@ -2089,7 +2106,7 @@ Ice::InputStream::EncapsDecoder11::readInstance(int32_t index, const PatchFunc&
2089
2106
 
2090
2107
  //
2091
2108
  // Get the object ID before we start reading slices. If some
2092
- // slices are skiped, the indirect object table are still read and
2109
+ // slices are skipped, the indirect object table is still read and
2093
2110
  // might read other instances.
2094
2111
  //
2095
2112
  index = ++_valueIdIndex;