zeroc-ice 3.8.2 → 3.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. checksums.yaml +4 -4
  2. data/dist/IceRuby/Communicator.cpp +26 -9
  3. data/dist/IceRuby/Config.h +0 -12
  4. data/dist/IceRuby/Connection.cpp +18 -9
  5. data/dist/IceRuby/DefaultSliceLoader.h +1 -1
  6. data/dist/IceRuby/Endpoint.cpp +21 -8
  7. data/dist/IceRuby/Operation.cpp +7 -5
  8. data/dist/IceRuby/Properties.cpp +3 -4
  9. data/dist/IceRuby/Proxy.cpp +11 -19
  10. data/dist/IceRuby/RubySliceLoader.cpp +1 -1
  11. data/dist/IceRuby/RubySliceLoader.h +6 -0
  12. data/dist/IceRuby/Types.cpp +162 -138
  13. data/dist/IceRuby/Types.h +68 -28
  14. data/dist/IceRuby/Util.cpp +14 -78
  15. data/dist/IceRuby/Util.h +7 -17
  16. data/dist/ice/cpp/include/Ice/Communicator.h +31 -8
  17. data/dist/ice/cpp/include/Ice/Config.h +2 -2
  18. data/dist/ice/cpp/include/Ice/Connection.h +24 -8
  19. data/dist/ice/cpp/include/Ice/CtrlCHandler.h +1 -1
  20. data/dist/ice/cpp/include/Ice/Demangle.h +1 -1
  21. data/dist/ice/cpp/include/Ice/Endpoint.h +4 -4
  22. data/dist/ice/cpp/include/Ice/Initialize.h +4 -4
  23. data/dist/ice/cpp/include/Ice/InputStream.h +5 -5
  24. data/dist/ice/cpp/include/Ice/Instrumentation.h +13 -7
  25. data/dist/ice/cpp/include/Ice/LocalExceptions.h +5 -5
  26. data/dist/ice/cpp/include/Ice/Logger.h +7 -0
  27. data/dist/ice/cpp/include/Ice/LoggerUtil.h +1 -1
  28. data/dist/ice/cpp/include/Ice/Object.h +10 -8
  29. data/dist/ice/cpp/include/Ice/ObjectAdapter.h +1 -1
  30. data/dist/ice/cpp/include/Ice/OutgoingAsync.h +5 -2
  31. data/dist/ice/cpp/include/Ice/OutgoingResponse.h +2 -1
  32. data/dist/ice/cpp/include/Ice/OutputStream.h +7 -6
  33. data/dist/ice/cpp/include/Ice/PluginFactory.h +1 -1
  34. data/dist/ice/cpp/include/Ice/Properties.h +3 -3
  35. data/dist/ice/cpp/include/Ice/Proxy.h +192 -50
  36. data/dist/ice/cpp/include/Ice/SSL/ClientAuthenticationOptions.h +3 -3
  37. data/dist/ice/cpp/include/Ice/SSL/EndpointInfo.h +1 -1
  38. data/dist/ice/cpp/include/Ice/SSL/ServerAuthenticationOptions.h +5 -5
  39. data/dist/ice/cpp/include/Ice/ServantLocator.h +1 -1
  40. data/dist/ice/cpp/include/Ice/Service.h +2 -5
  41. data/dist/ice/cpp/include/Ice/SliceLoader.h +1 -1
  42. data/dist/ice/cpp/include/Ice/SlicedData.h +5 -3
  43. data/dist/ice/cpp/include/Ice/StreamHelpers.h +1 -1
  44. data/dist/ice/cpp/include/Ice/StreamableTraits.h +2 -2
  45. data/dist/ice/cpp/include/Ice/StringConverter.h +2 -3
  46. data/dist/ice/cpp/include/Ice/StringUtil.h +2 -7
  47. data/dist/ice/cpp/include/Ice/UUID.h +1 -0
  48. data/dist/ice/cpp/include/Ice/Value.h +2 -2
  49. data/dist/ice/cpp/include/generated/Ice/BuiltinSequences.h +2 -2
  50. data/dist/ice/cpp/include/generated/Ice/Context.h +2 -2
  51. data/dist/ice/cpp/include/generated/Ice/EndpointTypes.h +2 -2
  52. data/dist/ice/cpp/include/generated/Ice/Identity.h +2 -2
  53. data/dist/ice/cpp/include/generated/Ice/Locator.h +50 -14
  54. data/dist/ice/cpp/include/generated/Ice/LocatorRegistry.h +38 -11
  55. data/dist/ice/cpp/include/generated/Ice/Metrics.h +94 -39
  56. data/dist/ice/cpp/include/generated/Ice/OperationMode.h +2 -2
  57. data/dist/ice/cpp/include/generated/Ice/Process.h +34 -8
  58. data/dist/ice/cpp/include/generated/Ice/PropertiesAdmin.h +42 -11
  59. data/dist/ice/cpp/include/generated/Ice/PropertyDict.h +2 -2
  60. data/dist/ice/cpp/include/generated/Ice/RemoteLogger.h +93 -40
  61. data/dist/ice/cpp/include/generated/Ice/ReplyStatus.h +2 -2
  62. data/dist/ice/cpp/include/generated/Ice/Router.h +50 -14
  63. data/dist/ice/cpp/include/generated/Ice/SliceChecksumDict.h +2 -2
  64. data/dist/ice/cpp/include/generated/Ice/Version.h +2 -2
  65. data/dist/ice/cpp/include/generated/IceDiscovery/Lookup.h +66 -14
  66. data/dist/ice/cpp/include/generated/IceLocatorDiscovery/Lookup.h +34 -8
  67. data/dist/ice/cpp/src/Ice/AddDefaultPluginFactories_all.cpp +1 -1
  68. data/dist/ice/cpp/src/Ice/Base64.cpp +47 -137
  69. data/dist/ice/cpp/src/Ice/Base64.h +2 -2
  70. data/dist/ice/cpp/src/Ice/BatchRequestQueue.cpp +28 -13
  71. data/dist/ice/cpp/src/Ice/BatchRequestQueue.h +5 -1
  72. data/dist/ice/cpp/src/Ice/Buffer.cpp +1 -1
  73. data/dist/ice/cpp/src/Ice/CollocatedRequestHandler.cpp +1 -1
  74. data/dist/ice/cpp/src/Ice/CollocatedRequestHandler.h +1 -1
  75. data/dist/ice/cpp/src/Ice/Communicator.cpp +4 -3
  76. data/dist/ice/cpp/src/Ice/CommunicatorFlushBatchAsync.cpp +8 -0
  77. data/dist/ice/cpp/src/Ice/ConnectRequestHandler.cpp +5 -15
  78. data/dist/ice/cpp/src/Ice/ConnectRequestHandler.h +1 -1
  79. data/dist/ice/cpp/src/Ice/ConnectionFactory.cpp +6 -8
  80. data/dist/ice/cpp/src/Ice/ConnectionFactory.h +0 -3
  81. data/dist/ice/cpp/src/Ice/ConnectionI.cpp +94 -99
  82. data/dist/ice/cpp/src/Ice/ConnectionI.h +11 -8
  83. data/dist/ice/cpp/src/Ice/ConsoleUtil.cpp +1 -1
  84. data/dist/ice/cpp/src/Ice/DefaultsAndOverrides.cpp +10 -14
  85. data/dist/ice/cpp/src/Ice/EndpointI.h +1 -1
  86. data/dist/ice/cpp/src/Ice/FileUtil.cpp +12 -12
  87. data/dist/ice/cpp/src/Ice/FixedRequestHandler.cpp +1 -1
  88. data/dist/ice/cpp/src/Ice/FixedRequestHandler.h +1 -1
  89. data/dist/ice/cpp/src/Ice/HttpParser.h +0 -2
  90. data/dist/ice/cpp/src/Ice/IdleTimeoutTransceiverDecorator.cpp +6 -3
  91. data/dist/ice/cpp/src/Ice/IncomingRequest.cpp +1 -3
  92. data/dist/ice/cpp/src/Ice/InputStream.cpp +23 -19
  93. data/dist/ice/cpp/src/Ice/Instance.cpp +73 -50
  94. data/dist/ice/cpp/src/Ice/Instance.h +1 -6
  95. data/dist/ice/cpp/src/Ice/LocalExceptions.cpp +1 -1
  96. data/dist/ice/cpp/src/Ice/LocatorInfo.cpp +2 -2
  97. data/dist/ice/cpp/src/Ice/LoggerAdminI.cpp +13 -18
  98. data/dist/ice/cpp/src/Ice/LoggerI.cpp +1 -1
  99. data/dist/ice/cpp/src/Ice/LoggerI.h +2 -2
  100. data/dist/ice/cpp/src/Ice/MetricsAdminI.h +6 -1
  101. data/dist/ice/cpp/src/Ice/MetricsObserverI.h +22 -18
  102. data/dist/ice/cpp/src/Ice/NativePropertiesAdmin.cpp +5 -2
  103. data/dist/ice/cpp/src/Ice/Network.cpp +168 -103
  104. data/dist/ice/cpp/src/Ice/Network.h +12 -7
  105. data/dist/ice/cpp/src/Ice/NetworkProxy.cpp +17 -6
  106. data/dist/ice/cpp/src/Ice/NetworkProxy.h +2 -1
  107. data/dist/ice/cpp/src/Ice/Object.cpp +1 -1
  108. data/dist/ice/cpp/src/Ice/ObjectAdapterI.cpp +56 -19
  109. data/dist/ice/cpp/src/Ice/OpaqueEndpointI.cpp +10 -10
  110. data/dist/ice/cpp/src/Ice/Options.cpp +7 -2
  111. data/dist/ice/cpp/src/Ice/OutgoingAsync.cpp +1 -1
  112. data/dist/ice/cpp/src/Ice/OutputStream.cpp +4 -4
  113. data/dist/ice/cpp/src/Ice/PluginManagerI.cpp +7 -1
  114. data/dist/ice/cpp/src/Ice/Properties.cpp +26 -16
  115. data/dist/ice/cpp/src/Ice/PropertyUtil.cpp +1 -1
  116. data/dist/ice/cpp/src/Ice/ProtocolInstance.cpp +0 -11
  117. data/dist/ice/cpp/src/Ice/ProtocolInstance.h +1 -2
  118. data/dist/ice/cpp/src/Ice/Proxy.cpp +9 -1
  119. data/dist/ice/cpp/src/Ice/ProxyAsync.cpp +110 -13
  120. data/dist/ice/cpp/src/Ice/Random.cpp +68 -7
  121. data/dist/ice/cpp/src/Ice/Random.h +6 -2
  122. data/dist/ice/cpp/src/Ice/Reference.cpp +22 -11
  123. data/dist/ice/cpp/src/Ice/Reference.h +3 -0
  124. data/dist/ice/cpp/src/Ice/ReferenceFactory.cpp +10 -0
  125. data/dist/ice/cpp/src/Ice/RequestHandler.h +3 -1
  126. data/dist/ice/cpp/src/Ice/RequestHandlerCache.cpp +1 -1
  127. data/dist/ice/cpp/src/Ice/RequestHandlerCache.h +1 -1
  128. data/dist/ice/cpp/src/Ice/ResourceConfig.h +3 -3
  129. data/dist/ice/cpp/src/Ice/RetryQueue.cpp +8 -12
  130. data/dist/ice/cpp/src/Ice/SHA1.cpp +11 -11
  131. data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.cpp +0 -6
  132. data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.h +0 -6
  133. data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngine.cpp +15 -1
  134. data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.cpp +77 -27
  135. data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.h +2 -1
  136. data/dist/ice/cpp/src/Ice/SSL/RFC2253.cpp +2 -2
  137. data/dist/ice/cpp/src/Ice/SSL/SSLUtil.cpp +39 -34
  138. data/dist/ice/cpp/src/Ice/SSL/SchannelEngine.cpp +130 -52
  139. data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.cpp +64 -33
  140. data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.h +0 -1
  141. data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngine.cpp +3 -3
  142. data/dist/ice/cpp/src/Ice/SSL/SecureTransportTransceiverI.cpp +9 -3
  143. data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.cpp +73 -51
  144. data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.h +0 -8
  145. data/dist/ice/cpp/src/Ice/Selector.cpp +13 -11
  146. data/dist/ice/cpp/src/Ice/ServantManager.cpp +3 -3
  147. data/dist/ice/cpp/src/Ice/Service.cpp +33 -115
  148. data/dist/ice/cpp/src/Ice/StreamSocket.cpp +33 -40
  149. data/dist/ice/cpp/src/Ice/StreamSocket.h +4 -4
  150. data/dist/ice/cpp/src/Ice/StringConverter.cpp +1 -1
  151. data/dist/ice/cpp/src/Ice/StringUtil.cpp +12 -21
  152. data/dist/ice/cpp/src/Ice/SysLoggerI.cpp +136 -100
  153. data/dist/ice/cpp/src/Ice/SysLoggerI.h +7 -3
  154. data/dist/ice/cpp/src/Ice/SystemdJournalI.cpp +1 -1
  155. data/dist/ice/cpp/src/Ice/TcpAcceptor.cpp +7 -7
  156. data/dist/ice/cpp/src/Ice/TcpAcceptor.h +2 -1
  157. data/dist/ice/cpp/src/Ice/TcpBufSize.h +40 -0
  158. data/dist/ice/cpp/src/Ice/TcpConnector.cpp +5 -2
  159. data/dist/ice/cpp/src/Ice/TcpConnector.h +2 -0
  160. data/dist/ice/cpp/src/Ice/TcpTransceiver.cpp +6 -2
  161. data/dist/ice/cpp/src/Ice/ThreadPool.cpp +2 -8
  162. data/dist/ice/cpp/src/Ice/ThreadPool.h +0 -2
  163. data/dist/ice/cpp/src/Ice/Timer.cpp +7 -3
  164. data/dist/ice/cpp/src/Ice/UUID.cpp +1 -2
  165. data/dist/ice/cpp/src/Ice/UdpEndpointI.cpp +4 -1
  166. data/dist/ice/cpp/src/Ice/UdpTransceiver.cpp +136 -123
  167. data/dist/ice/cpp/src/Ice/UdpTransceiver.h +3 -4
  168. data/dist/ice/cpp/src/Ice/WSTransceiver.cpp +96 -27
  169. data/dist/ice/cpp/src/Ice/WSTransceiver.h +1 -1
  170. data/dist/ice/cpp/src/Ice/generated/BuiltinSequences.cpp +2 -2
  171. data/dist/ice/cpp/src/Ice/generated/Context.cpp +2 -2
  172. data/dist/ice/cpp/src/Ice/generated/EndpointTypes.cpp +2 -2
  173. data/dist/ice/cpp/src/Ice/generated/Identity.cpp +2 -2
  174. data/dist/ice/cpp/src/Ice/generated/Locator.cpp +2 -2
  175. data/dist/ice/cpp/src/Ice/generated/LocatorRegistry.cpp +2 -2
  176. data/dist/ice/cpp/src/Ice/generated/Metrics.cpp +2 -2
  177. data/dist/ice/cpp/src/Ice/generated/OperationMode.cpp +2 -2
  178. data/dist/ice/cpp/src/Ice/generated/Process.cpp +2 -2
  179. data/dist/ice/cpp/src/Ice/generated/PropertiesAdmin.cpp +2 -2
  180. data/dist/ice/cpp/src/Ice/generated/PropertyDict.cpp +2 -2
  181. data/dist/ice/cpp/src/Ice/generated/RemoteLogger.cpp +2 -2
  182. data/dist/ice/cpp/src/Ice/generated/ReplyStatus.cpp +2 -2
  183. data/dist/ice/cpp/src/Ice/generated/Router.cpp +2 -2
  184. data/dist/ice/cpp/src/Ice/generated/SliceChecksumDict.cpp +2 -2
  185. data/dist/ice/cpp/src/Ice/generated/Version.cpp +2 -2
  186. data/dist/ice/cpp/src/IceDiscovery/LookupI.cpp +47 -9
  187. data/dist/ice/cpp/src/IceDiscovery/LookupI.h +8 -3
  188. data/dist/ice/cpp/src/IceDiscovery/generated/Lookup.cpp +2 -2
  189. data/dist/ice/cpp/src/IceLocatorDiscovery/PluginI.cpp +43 -14
  190. data/dist/ice/cpp/src/IceLocatorDiscovery/generated/Lookup.cpp +2 -2
  191. data/dist/ice/cpp/src/Slice/DocCommentParser.cpp +26 -20
  192. data/dist/ice/cpp/src/Slice/DocCommentParser.h +2 -2
  193. data/dist/ice/cpp/src/Slice/FileTracker.cpp +3 -11
  194. data/dist/ice/cpp/src/Slice/FileTracker.h +0 -2
  195. data/dist/ice/cpp/src/Slice/Grammar.cpp +211 -210
  196. data/dist/ice/cpp/src/Slice/MetadataValidation.cpp +10 -9
  197. data/dist/ice/cpp/src/Slice/Parser.cpp +28 -20
  198. data/dist/ice/cpp/src/Slice/Parser.h +3 -4
  199. data/dist/ice/cpp/src/Slice/Preprocessor.cpp +3 -11
  200. data/dist/ice/cpp/src/Slice/Preprocessor.h +0 -2
  201. data/dist/ice/cpp/src/Slice/Scanner.cpp +3 -3
  202. data/dist/ice/cpp/src/Slice/SliceUtil.cpp +197 -114
  203. data/dist/ice/cpp/src/Slice/StringLiteralUtil.cpp +0 -2
  204. data/dist/ice/cpp/src/Slice/Util.h +21 -9
  205. data/dist/ice/cpp/src/slice2rb/Ruby.cpp +7 -3
  206. data/dist/ice/cpp/src/slice2rb/RubyUtil.cpp +16 -12
  207. data/dist/ice/cpp/src/slice2rb/RubyUtil.h +3 -3
  208. data/dist/ice/slice/Glacier2/Router.ice +3 -3
  209. data/dist/ice/slice/Ice/Metrics.ice +6 -5
  210. data/dist/ice/slice/Ice/RemoteLogger.ice +5 -5
  211. data/dist/ice/slice/IceGrid/Admin.ice +9 -9
  212. data/dist/ice/slice/IceGrid/Descriptor.ice +5 -5
  213. data/dist/ice/slice/IceStorm/Metrics.ice +1 -1
  214. data/dist/lib/Glacier2/Metrics.rb +1 -1
  215. data/dist/lib/Glacier2/PermissionsVerifier.rb +1 -1
  216. data/dist/lib/Glacier2/Router.rb +2 -2
  217. data/dist/lib/Glacier2/SSLInfo.rb +1 -1
  218. data/dist/lib/Glacier2/Session.rb +1 -1
  219. data/dist/lib/Ice/BuiltinSequences.rb +1 -1
  220. data/dist/lib/Ice/CompressBatch.rb +1 -2
  221. data/dist/lib/Ice/Context.rb +1 -1
  222. data/dist/lib/Ice/EndpointSelectionType.rb +1 -2
  223. data/dist/lib/Ice/EndpointTypes.rb +1 -1
  224. data/dist/lib/Ice/Identity.rb +1 -1
  225. data/dist/lib/Ice/IdentitySpaceship.rb +1 -0
  226. data/dist/lib/Ice/Locator.rb +1 -1
  227. data/dist/lib/Ice/LocatorRegistry.rb +1 -1
  228. data/dist/lib/Ice/Metrics.rb +1 -1
  229. data/dist/lib/Ice/OperationMode.rb +2 -3
  230. data/dist/lib/Ice/Process.rb +1 -1
  231. data/dist/lib/Ice/PropertiesAdmin.rb +1 -1
  232. data/dist/lib/Ice/PropertyDict.rb +1 -1
  233. data/dist/lib/Ice/RemoteLogger.rb +2 -3
  234. data/dist/lib/Ice/ReplyStatus.rb +2 -3
  235. data/dist/lib/Ice/Router.rb +1 -1
  236. data/dist/lib/Ice/SliceChecksumDict.rb +1 -1
  237. data/dist/lib/Ice/SliceUtil.rb +2 -2
  238. data/dist/lib/Ice/Struct.rb +1 -0
  239. data/dist/lib/Ice/ToStringMode.rb +1 -2
  240. data/dist/lib/Ice/Value.rb +2 -2
  241. data/dist/lib/Ice/Version.rb +1 -1
  242. data/dist/lib/IceBox/ServiceManager.rb +1 -1
  243. data/dist/lib/IceGrid/Admin.rb +3 -4
  244. data/dist/lib/IceGrid/Descriptor.rb +1 -1
  245. data/dist/lib/IceGrid/Exception.rb +1 -1
  246. data/dist/lib/IceGrid/FileParser.rb +1 -1
  247. data/dist/lib/IceGrid/Registry.rb +2 -3
  248. data/dist/lib/IceGrid/Session.rb +2 -2
  249. data/dist/lib/IceGrid/UserAccountMapper.rb +1 -1
  250. data/dist/lib/IceStorm/IceStorm.rb +1 -1
  251. data/dist/lib/IceStorm/Metrics.rb +1 -1
  252. data/extconf.rb +1 -1
  253. data/ice.gemspec +3 -3
  254. metadata +4 -5
  255. data/dist/ice/cpp/src/Ice/DLLMain.cpp +0 -40
  256. data/dist/ice/cpp/src/Ice/UndefSysMacros.h +0 -37
@@ -52,6 +52,23 @@ namespace
52
52
  const string _iceProtocol = "ice.zeroc.com"; // NOLINT(cert-err58-cpp)
53
53
  const string _wsUUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; // NOLINT(cert-err58-cpp)
54
54
 
55
+ // Returns true if the Connection header field - a comma-separated list of tokens, already trimmed and lowercased
56
+ // by HttpParser::getHeader - includes the "upgrade" token required by RFC 6455 section 4.
57
+ bool hasUpgradeToken(string_view connectionField)
58
+ {
59
+ while (!connectionField.empty())
60
+ {
61
+ auto comma = connectionField.find(',');
62
+ string_view token = connectionField.substr(0, comma);
63
+ connectionField.remove_prefix(comma == string_view::npos ? connectionField.size() : comma + 1);
64
+ if (IceInternal::trim(token) == "upgrade")
65
+ {
66
+ return true;
67
+ }
68
+ }
69
+ return false;
70
+ }
71
+
55
72
  //
56
73
  // Rename to avoid conflict with OS 10.10 htonll
57
74
  //
@@ -232,7 +249,7 @@ IceInternal::WSTransceiver::initialize(Buffer& readBuffer, Buffer& writeBuffer)
232
249
  // encoded with Base64.
233
250
  //
234
251
  vector<byte> key(16);
235
- IceInternal::generateRandom(reinterpret_cast<char*>(&key[0]), key.size());
252
+ IceInternal::generateRandom(reinterpret_cast<char*>(key.data()), key.size());
236
253
  _key = IceInternal::Base64::encode(key);
237
254
  out << _key << "\r\n\r\n"; // EOM
238
255
 
@@ -420,10 +437,10 @@ IceInternal::WSTransceiver::closing(bool initiator, exception_ptr reason)
420
437
  {
421
438
  //
422
439
  // If we initiated a close connection but also received a
423
- // close connection, we assume we didn't initiated the
424
- // connection and we send the close frame now. This is to
440
+ // close connection, we assume we didn't initiate the
441
+ // close and we send the close frame now. This is to
425
442
  // ensure that if both peers close the connection at the same
426
- // time we don't hang having both peer waiting for the close
443
+ // time we don't hang having both peers waiting for the close
427
444
  // frame of the other.
428
445
  //
429
446
  assert(!initiator);
@@ -575,8 +592,8 @@ IceInternal::WSTransceiver::read(Buffer& buf)
575
592
  }
576
593
 
577
594
  //
578
- // If we read the full Ice message, handle it before trying
579
- // reading anymore data from the WS connection.
595
+ // If we read the full Ice message, handle it before trying to
596
+ // read any more data from the WS connection.
580
597
  //
581
598
  if (buf.i == buf.b.end())
582
599
  {
@@ -921,6 +938,19 @@ IceInternal::WSTransceiver::handleRequest(Buffer& responseBuffer)
921
938
  {
922
939
  string val;
923
940
 
941
+ //
942
+ // The opening handshake must be a GET request (RFC 6455 section 4.1). We check the message type first
943
+ // because method() (used just below) and uri() (used later) assert the parser holds a request.
944
+ //
945
+ if (_parser->type() != HttpParser::TypeRequest)
946
+ {
947
+ throw WebSocketException("WebSocket handshake is not an HTTP request");
948
+ }
949
+ if (_parser->method() != "GET")
950
+ {
951
+ throw WebSocketException("unsupported HTTP method '" + _parser->method() + "' for WebSocket handshake");
952
+ }
953
+
924
954
  //
925
955
  // HTTP/1.1
926
956
  //
@@ -950,7 +980,7 @@ IceInternal::WSTransceiver::handleRequest(Buffer& responseBuffer)
950
980
  {
951
981
  throw WebSocketException("missing value for Connection field");
952
982
  }
953
- else if (val.find("upgrade") == string::npos)
983
+ else if (!hasUpgradeToken(val))
954
984
  {
955
985
  throw WebSocketException("invalid value '" + val + "' for Connection field");
956
986
  }
@@ -1000,10 +1030,17 @@ IceInternal::WSTransceiver::handleRequest(Buffer& responseBuffer)
1000
1030
  throw WebSocketException("missing value for WebSocket key");
1001
1031
  }
1002
1032
 
1003
- vector<byte> decodedKey = Base64::decode(key);
1004
- if (decodedKey.size() != 16)
1033
+ try
1034
+ {
1035
+ vector<byte> decodedKey = Base64::decode(key);
1036
+ if (decodedKey.size() != 16)
1037
+ {
1038
+ throw WebSocketException("WebSocket key '" + key + "' has invalid length");
1039
+ }
1040
+ }
1041
+ catch (const std::invalid_argument&)
1005
1042
  {
1006
- throw WebSocketException("invalid value '" + key + "' for WebSocket key");
1043
+ throw WebSocketException("invalid base64 value '" + key + "' for WebSocket key");
1007
1044
  }
1008
1045
 
1009
1046
  //
@@ -1062,9 +1099,8 @@ IceInternal::WSTransceiver::handleRequest(Buffer& responseBuffer)
1062
1099
  out << "Sec-WebSocket-Accept: ";
1063
1100
  string input = key + _wsUUID;
1064
1101
  vector<byte> hash;
1065
- sha1(reinterpret_cast<const byte*>(&input[0]), input.size(), hash);
1066
- out << IceInternal::Base64::encode(hash) << "\r\n"
1067
- << "\r\n"; // EOM
1102
+ sha1(reinterpret_cast<const byte*>(input.data()), input.size(), hash);
1103
+ out << IceInternal::Base64::encode(hash) << "\r\n\r\n"; // EOM
1068
1104
 
1069
1105
  string str = out.str();
1070
1106
  responseBuffer.b.resize(str.size());
@@ -1129,7 +1165,7 @@ IceInternal::WSTransceiver::handleResponse()
1129
1165
  {
1130
1166
  throw WebSocketException("missing value for Connection field");
1131
1167
  }
1132
- else if (val.find("upgrade") == string::npos)
1168
+ else if (!hasUpgradeToken(val))
1133
1169
  {
1134
1170
  throw WebSocketException("invalid value '" + val + "' for Connection field");
1135
1171
  }
@@ -1161,7 +1197,7 @@ IceInternal::WSTransceiver::handleResponse()
1161
1197
  }
1162
1198
  string input = _key + _wsUUID;
1163
1199
  vector<byte> hash;
1164
- sha1(reinterpret_cast<const byte*>(&input[0]), input.size(), hash);
1200
+ sha1(reinterpret_cast<const byte*>(input.data()), input.size(), hash);
1165
1201
  if (val != IceInternal::Base64::encode(hash))
1166
1202
  {
1167
1203
  throw WebSocketException("invalid value '" + val + "' for Sec-WebSocket-Accept");
@@ -1352,7 +1388,7 @@ IceInternal::WSTransceiver::preRead(Buffer& buf)
1352
1388
  }
1353
1389
  _readState = ReadStatePayload;
1354
1390
  assert(buf.i != buf.b.end());
1355
- _readFrameStart = buf.i;
1391
+ _readFrameOffset = 0;
1356
1392
  break;
1357
1393
  }
1358
1394
  case OP_CLOSE: // Connection close
@@ -1430,7 +1466,17 @@ IceInternal::WSTransceiver::preRead(Buffer& buf)
1430
1466
  {
1431
1467
  _pingPayload.clear();
1432
1468
  _pingPayload.resize(_readPayloadLength);
1433
- memcpy(&_pingPayload[0], _readI, _pingPayload.size());
1469
+ memcpy(_pingPayload.data(), _readI, _pingPayload.size());
1470
+ if (_incoming)
1471
+ {
1472
+ // A client masks its frames (RFC 6455 §5.3), so unmask the ping payload here, just like the
1473
+ // data path does in postRead. Otherwise the pong we echo back carries the still-masked bytes
1474
+ // instead of the original ping payload (RFC 6455 §5.5.3).
1475
+ for (size_t i = 0; i < _pingPayload.size(); ++i)
1476
+ {
1477
+ _pingPayload[i] ^= static_cast<uint8_t>(_readMask[i % 4]);
1478
+ }
1479
+ }
1434
1480
  }
1435
1481
 
1436
1482
  _readI += _readPayloadLength;
@@ -1506,13 +1552,16 @@ IceInternal::WSTransceiver::postRead(Buffer& buf)
1506
1552
  if (_incoming)
1507
1553
  {
1508
1554
  //
1509
- // Unmask the data we just read.
1555
+ // Unmask the data we just read. _readFrameOffset is the mask index (payload bytes consumed so far in
1556
+ // this frame). We keep it as an integer rather than an iterator into buf because ConnectionI reallocates
1557
+ // the read buffer between reads of the same frame, which would invalidate such an iterator.
1510
1558
  //
1511
1559
  IceInternal::Buffer::Container::iterator p = _readStart;
1512
- for (auto n = static_cast<size_t>(_readStart - _readFrameStart); p < buf.i; ++p, ++n)
1560
+ for (size_t n = _readFrameOffset; p < buf.i; ++p, ++n)
1513
1561
  {
1514
1562
  *p ^= _readMask[n % 4];
1515
1563
  }
1564
+ _readFrameOffset += static_cast<size_t>(buf.i - _readStart);
1516
1565
  }
1517
1566
 
1518
1567
  _readPayloadLength -= static_cast<size_t>(buf.i - _readStart);
@@ -1555,15 +1604,35 @@ IceInternal::WSTransceiver::preWrite(Buffer& buf)
1555
1604
  else if (_state == StatePongPending)
1556
1605
  {
1557
1606
  prepareWriteHeader(OP_PONG, _pingPayload.size());
1558
- if (_pingPayload.size() > static_cast<size_t>(_writeBuffer.b.end() - _writeBuffer.i))
1607
+
1608
+ // A zero-length ping (the common keep-alive case) leaves _pingPayload empty. Guard the copy so we
1609
+ // never form &_pingPayload[0] on an empty vector, which is undefined behavior and aborts under
1610
+ // hardened standard libraries (_GLIBCXX_ASSERTIONS, MSVC debug iterators, libc++ hardening).
1611
+ if (!_pingPayload.empty())
1559
1612
  {
1560
- auto pos = static_cast<size_t>(_writeBuffer.i - _writeBuffer.b.begin());
1561
- _writeBuffer.b.resize(pos + _pingPayload.size());
1562
- _writeBuffer.i = _writeBuffer.b.begin() + pos;
1613
+ if (_pingPayload.size() > static_cast<size_t>(_writeBuffer.b.end() - _writeBuffer.i))
1614
+ {
1615
+ auto pos = static_cast<size_t>(_writeBuffer.i - _writeBuffer.b.begin());
1616
+ _writeBuffer.b.resize(pos + _pingPayload.size());
1617
+ _writeBuffer.i = _writeBuffer.b.begin() + pos;
1618
+ }
1619
+ if (_incoming)
1620
+ {
1621
+ // Server-to-client frames are not masked (RFC 6455 §5.1).
1622
+ memcpy(_writeBuffer.i, _pingPayload.data(), _pingPayload.size());
1623
+ _writeBuffer.i += _pingPayload.size();
1624
+ }
1625
+ else
1626
+ {
1627
+ // Client-to-server frames are masked with _writeMask, like the OP_DATA and OP_CLOSE paths;
1628
+ // prepareWriteHeader set FLAG_MASKED, so the payload must be masked to match (RFC 6455 §5.5.3).
1629
+ for (size_t i = 0; i < _pingPayload.size(); ++i)
1630
+ {
1631
+ *_writeBuffer.i++ = static_cast<std::byte>(_pingPayload[i]) ^ _writeMask[i % 4];
1632
+ }
1633
+ }
1634
+ _pingPayload.clear();
1563
1635
  }
1564
- memcpy(_writeBuffer.i, &_pingPayload[0], _pingPayload.size());
1565
- _writeBuffer.i += _pingPayload.size();
1566
- _pingPayload.clear();
1567
1636
 
1568
1637
  _writeBuffer.b.resize(static_cast<size_t>(_writeBuffer.i - _writeBuffer.b.begin()));
1569
1638
  _writeState = WriteStateControlFrame;
@@ -1608,7 +1677,7 @@ IceInternal::WSTransceiver::preWrite(Buffer& buf)
1608
1677
  // 32-bit value, so we copy the entire message into the internal buffer
1609
1678
  // for writing. For incoming connections, we just copy the start of the
1610
1679
  // message in the internal buffer after the header. If the message is
1611
- // larger, the reminder is sent directly from the message buffer to avoid
1680
+ // larger, the remainder is sent directly from the message buffer to avoid
1612
1681
  // copying.
1613
1682
  //
1614
1683
 
@@ -117,7 +117,7 @@ namespace IceInternal
117
117
  size_t _readHeaderLength;
118
118
  size_t _readPayloadLength;
119
119
  Buffer::Container::iterator _readStart;
120
- Buffer::Container::iterator _readFrameStart;
120
+ size_t _readFrameOffset{0};
121
121
  std::byte _readMask[4];
122
122
 
123
123
  enum WriteState
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) ZeroC, Inc.
2
2
 
3
- // slice2cpp version 3.8.2
3
+ // slice2cpp version 3.8.3
4
4
  // <auto-generated>Generated from Slice file 'BuiltinSequences.ice'.</auto-generated>
5
5
 
6
6
  #ifndef ICE_API_EXPORTS
@@ -34,7 +34,7 @@
34
34
  # if ICE_INT_VERSION % 100 >= 50
35
35
  # error Beta header file detected
36
36
  # endif
37
- # if ICE_INT_VERSION % 100 < 2
37
+ # if ICE_INT_VERSION % 100 < 3
38
38
  # error Ice patch level mismatch!
39
39
  # endif
40
40
  #endif
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) ZeroC, Inc.
2
2
 
3
- // slice2cpp version 3.8.2
3
+ // slice2cpp version 3.8.3
4
4
  // <auto-generated>Generated from Slice file 'Context.ice'.</auto-generated>
5
5
 
6
6
  #ifndef ICE_API_EXPORTS
@@ -34,7 +34,7 @@
34
34
  # if ICE_INT_VERSION % 100 >= 50
35
35
  # error Beta header file detected
36
36
  # endif
37
- # if ICE_INT_VERSION % 100 < 2
37
+ # if ICE_INT_VERSION % 100 < 3
38
38
  # error Ice patch level mismatch!
39
39
  # endif
40
40
  #endif
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) ZeroC, Inc.
2
2
 
3
- // slice2cpp version 3.8.2
3
+ // slice2cpp version 3.8.3
4
4
  // <auto-generated>Generated from Slice file 'EndpointTypes.ice'.</auto-generated>
5
5
 
6
6
  #ifndef ICE_API_EXPORTS
@@ -34,7 +34,7 @@
34
34
  # if ICE_INT_VERSION % 100 >= 50
35
35
  # error Beta header file detected
36
36
  # endif
37
- # if ICE_INT_VERSION % 100 < 2
37
+ # if ICE_INT_VERSION % 100 < 3
38
38
  # error Ice patch level mismatch!
39
39
  # endif
40
40
  #endif
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) ZeroC, Inc.
2
2
 
3
- // slice2cpp version 3.8.2
3
+ // slice2cpp version 3.8.3
4
4
  // <auto-generated>Generated from Slice file 'Identity.ice'.</auto-generated>
5
5
 
6
6
  #ifndef ICE_API_EXPORTS
@@ -34,7 +34,7 @@
34
34
  # if ICE_INT_VERSION % 100 >= 50
35
35
  # error Beta header file detected
36
36
  # endif
37
- # if ICE_INT_VERSION % 100 < 2
37
+ # if ICE_INT_VERSION % 100 < 3
38
38
  # error Ice patch level mismatch!
39
39
  # endif
40
40
  #endif
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) ZeroC, Inc.
2
2
 
3
- // slice2cpp version 3.8.2
3
+ // slice2cpp version 3.8.3
4
4
  // <auto-generated>Generated from Slice file 'Locator.ice'.</auto-generated>
5
5
 
6
6
  #ifndef ICE_API_EXPORTS
@@ -34,7 +34,7 @@
34
34
  # if ICE_INT_VERSION % 100 >= 50
35
35
  # error Beta header file detected
36
36
  # endif
37
- # if ICE_INT_VERSION % 100 < 2
37
+ # if ICE_INT_VERSION % 100 < 3
38
38
  # error Ice patch level mismatch!
39
39
  # endif
40
40
  #endif
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) ZeroC, Inc.
2
2
 
3
- // slice2cpp version 3.8.2
3
+ // slice2cpp version 3.8.3
4
4
  // <auto-generated>Generated from Slice file 'LocatorRegistry.ice'.</auto-generated>
5
5
 
6
6
  #ifndef ICE_API_EXPORTS
@@ -34,7 +34,7 @@
34
34
  # if ICE_INT_VERSION % 100 >= 50
35
35
  # error Beta header file detected
36
36
  # endif
37
- # if ICE_INT_VERSION % 100 < 2
37
+ # if ICE_INT_VERSION % 100 < 3
38
38
  # error Ice patch level mismatch!
39
39
  # endif
40
40
  #endif
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) ZeroC, Inc.
2
2
 
3
- // slice2cpp version 3.8.2
3
+ // slice2cpp version 3.8.3
4
4
  // <auto-generated>Generated from Slice file 'Metrics.ice'.</auto-generated>
5
5
 
6
6
  #ifndef ICE_API_EXPORTS
@@ -33,7 +33,7 @@
33
33
  # if ICE_INT_VERSION % 100 >= 50
34
34
  # error Beta header file detected
35
35
  # endif
36
- # if ICE_INT_VERSION % 100 < 2
36
+ # if ICE_INT_VERSION % 100 < 3
37
37
  # error Ice patch level mismatch!
38
38
  # endif
39
39
  #endif
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) ZeroC, Inc.
2
2
 
3
- // slice2cpp version 3.8.2
3
+ // slice2cpp version 3.8.3
4
4
  // <auto-generated>Generated from Slice file 'OperationMode.ice'.</auto-generated>
5
5
 
6
6
  #ifndef ICE_API_EXPORTS
@@ -34,7 +34,7 @@
34
34
  # if ICE_INT_VERSION % 100 >= 50
35
35
  # error Beta header file detected
36
36
  # endif
37
- # if ICE_INT_VERSION % 100 < 2
37
+ # if ICE_INT_VERSION % 100 < 3
38
38
  # error Ice patch level mismatch!
39
39
  # endif
40
40
  #endif
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) ZeroC, Inc.
2
2
 
3
- // slice2cpp version 3.8.2
3
+ // slice2cpp version 3.8.3
4
4
  // <auto-generated>Generated from Slice file 'Process.ice'.</auto-generated>
5
5
 
6
6
  #ifndef ICE_API_EXPORTS
@@ -33,7 +33,7 @@
33
33
  # if ICE_INT_VERSION % 100 >= 50
34
34
  # error Beta header file detected
35
35
  # endif
36
- # if ICE_INT_VERSION % 100 < 2
36
+ # if ICE_INT_VERSION % 100 < 3
37
37
  # error Ice patch level mismatch!
38
38
  # endif
39
39
  #endif
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) ZeroC, Inc.
2
2
 
3
- // slice2cpp version 3.8.2
3
+ // slice2cpp version 3.8.3
4
4
  // <auto-generated>Generated from Slice file 'PropertiesAdmin.ice'.</auto-generated>
5
5
 
6
6
  #ifndef ICE_API_EXPORTS
@@ -33,7 +33,7 @@
33
33
  # if ICE_INT_VERSION % 100 >= 50
34
34
  # error Beta header file detected
35
35
  # endif
36
- # if ICE_INT_VERSION % 100 < 2
36
+ # if ICE_INT_VERSION % 100 < 3
37
37
  # error Ice patch level mismatch!
38
38
  # endif
39
39
  #endif
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) ZeroC, Inc.
2
2
 
3
- // slice2cpp version 3.8.2
3
+ // slice2cpp version 3.8.3
4
4
  // <auto-generated>Generated from Slice file 'PropertyDict.ice'.</auto-generated>
5
5
 
6
6
  #ifndef ICE_API_EXPORTS
@@ -34,7 +34,7 @@
34
34
  # if ICE_INT_VERSION % 100 >= 50
35
35
  # error Beta header file detected
36
36
  # endif
37
- # if ICE_INT_VERSION % 100 < 2
37
+ # if ICE_INT_VERSION % 100 < 3
38
38
  # error Ice patch level mismatch!
39
39
  # endif
40
40
  #endif
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) ZeroC, Inc.
2
2
 
3
- // slice2cpp version 3.8.2
3
+ // slice2cpp version 3.8.3
4
4
  // <auto-generated>Generated from Slice file 'RemoteLogger.ice'.</auto-generated>
5
5
 
6
6
  #ifndef ICE_API_EXPORTS
@@ -33,7 +33,7 @@
33
33
  # if ICE_INT_VERSION % 100 >= 50
34
34
  # error Beta header file detected
35
35
  # endif
36
- # if ICE_INT_VERSION % 100 < 2
36
+ # if ICE_INT_VERSION % 100 < 3
37
37
  # error Ice patch level mismatch!
38
38
  # endif
39
39
  #endif
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) ZeroC, Inc.
2
2
 
3
- // slice2cpp version 3.8.2
3
+ // slice2cpp version 3.8.3
4
4
  // <auto-generated>Generated from Slice file 'ReplyStatus.ice'.</auto-generated>
5
5
 
6
6
  #ifndef ICE_API_EXPORTS
@@ -34,7 +34,7 @@
34
34
  # if ICE_INT_VERSION % 100 >= 50
35
35
  # error Beta header file detected
36
36
  # endif
37
- # if ICE_INT_VERSION % 100 < 2
37
+ # if ICE_INT_VERSION % 100 < 3
38
38
  # error Ice patch level mismatch!
39
39
  # endif
40
40
  #endif
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) ZeroC, Inc.
2
2
 
3
- // slice2cpp version 3.8.2
3
+ // slice2cpp version 3.8.3
4
4
  // <auto-generated>Generated from Slice file 'Router.ice'.</auto-generated>
5
5
 
6
6
  #ifndef ICE_API_EXPORTS
@@ -33,7 +33,7 @@
33
33
  # if ICE_INT_VERSION % 100 >= 50
34
34
  # error Beta header file detected
35
35
  # endif
36
- # if ICE_INT_VERSION % 100 < 2
36
+ # if ICE_INT_VERSION % 100 < 3
37
37
  # error Ice patch level mismatch!
38
38
  # endif
39
39
  #endif
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) ZeroC, Inc.
2
2
 
3
- // slice2cpp version 3.8.2
3
+ // slice2cpp version 3.8.3
4
4
  // <auto-generated>Generated from Slice file 'SliceChecksumDict.ice'.</auto-generated>
5
5
 
6
6
  #ifndef ICE_API_EXPORTS
@@ -33,7 +33,7 @@
33
33
  # if ICE_INT_VERSION % 100 >= 50
34
34
  # error Beta header file detected
35
35
  # endif
36
- # if ICE_INT_VERSION % 100 < 2
36
+ # if ICE_INT_VERSION % 100 < 3
37
37
  # error Ice patch level mismatch!
38
38
  # endif
39
39
  #endif
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) ZeroC, Inc.
2
2
 
3
- // slice2cpp version 3.8.2
3
+ // slice2cpp version 3.8.3
4
4
  // <auto-generated>Generated from Slice file 'Version.ice'.</auto-generated>
5
5
 
6
6
  #ifndef ICE_API_EXPORTS
@@ -34,7 +34,7 @@
34
34
  # if ICE_INT_VERSION % 100 >= 50
35
35
  # error Beta header file detected
36
36
  # endif
37
- # if ICE_INT_VERSION % 100 < 2
37
+ # if ICE_INT_VERSION % 100 < 3
38
38
  # error Ice patch level mismatch!
39
39
  # endif
40
40
  #endif
@@ -30,6 +30,7 @@ IceDiscovery::Request::retry()
30
30
  void
31
31
  IceDiscovery::Request::invoke(const string& domainId, const vector<pair<LookupPrx, LookupReplyPrx>>& lookups)
32
32
  {
33
+ ++_generation;
33
34
  _lookupCount = lookups.size();
34
35
  _failureCount = 0;
35
36
  Ice::Identity id;
@@ -42,8 +43,15 @@ IceDiscovery::Request::invoke(const string& domainId, const vector<pair<LookupPr
42
43
  }
43
44
 
44
45
  bool
45
- IceDiscovery::Request::exception()
46
+ IceDiscovery::Request::exception(size_t generation)
46
47
  {
48
+ // Ignore a delayed failure from an earlier invocation round: it must not count against the current round, which
49
+ // reset _failureCount and may still have outstanding lookups.
50
+ if (generation != _generation)
51
+ {
52
+ return false;
53
+ }
54
+
47
55
  // If all the invocations on all the lookup proxies failed, report it to the locator.
48
56
  if (++_failureCount == _lookupCount)
49
57
  {
@@ -69,7 +77,17 @@ AdapterRequest::AdapterRequest(const LookupIPtr& lookup, const std::string& adap
69
77
  bool
70
78
  AdapterRequest::retry()
71
79
  {
72
- return _proxies.empty() && --_retryCount >= 0;
80
+ if (_proxies.empty() && --_retryCount >= 0)
81
+ {
82
+ // We only reach here with _proxies empty, i.e. no replica-group response arrived. _latency is set only
83
+ // together with inserting into _proxies, so the latency timer is not running.
84
+ assert(_latency == chrono::nanoseconds::zero());
85
+
86
+ // Restart the replica-group latency window so it's measured from this round rather than from request creation.
87
+ _start = chrono::steady_clock::now();
88
+ return true;
89
+ }
90
+ return false;
73
91
  }
74
92
 
75
93
  bool
@@ -77,6 +95,7 @@ AdapterRequest::response(const ObjectPrx& proxy, bool isReplicaGroup)
77
95
  {
78
96
  if (isReplicaGroup)
79
97
  {
98
+ _proxies.insert(proxy);
80
99
  if (_latency == chrono::nanoseconds::zero())
81
100
  {
82
101
  _latency = chrono::duration_cast<chrono::nanoseconds>(chrono::steady_clock::now() - _start) *
@@ -84,7 +103,6 @@ AdapterRequest::response(const ObjectPrx& proxy, bool isReplicaGroup)
84
103
  _lookup->timer()->cancel(shared_from_this());
85
104
  _lookup->timer()->schedule(shared_from_this(), _latency);
86
105
  }
87
- _proxies.insert(proxy);
88
106
  return false;
89
107
  }
90
108
  finished(proxy);
@@ -127,7 +145,8 @@ AdapterRequest::invokeWithLookup(const string& domainId, const LookupPrx& lookup
127
145
  _id,
128
146
  lookupReply,
129
147
  nullptr,
130
- [self = shared_from_this()](exception_ptr ex) { self->_lookup->adapterRequestException(self, ex); });
148
+ [self = shared_from_this(), generation = _generation](exception_ptr ex)
149
+ { self->_lookup->adapterRequestException(self, ex, generation); });
131
150
  }
132
151
 
133
152
  void
@@ -155,7 +174,8 @@ ObjectRequest::invokeWithLookup(const string& domainId, const LookupPrx& lookup,
155
174
  _id,
156
175
  lookupReply,
157
176
  nullptr,
158
- [self = shared_from_this()](exception_ptr ex) { self->_lookup->objectRequestException(self, ex); });
177
+ [self = shared_from_this(), generation = _generation](exception_ptr ex)
178
+ { self->_lookup->objectRequestException(self, ex, generation); });
159
179
  }
160
180
 
161
181
  void
@@ -173,6 +193,24 @@ LookupI::LookupI(LocatorRegistryIPtr registry, const LookupPrx& lookup, const Ic
173
193
  _domainId(properties->getIceProperty("IceDiscovery.DomainId")),
174
194
  _timer(IceInternal::getInstanceTimer(lookup->ice_getCommunicator()))
175
195
  {
196
+ if (_timeout <= chrono::milliseconds::zero())
197
+ {
198
+ throw PropertyException{__FILE__, __LINE__, "property 'IceDiscovery.Timeout' must be greater than 0"};
199
+ }
200
+ if (_retryCount < 0)
201
+ {
202
+ throw PropertyException{
203
+ __FILE__,
204
+ __LINE__,
205
+ "property 'IceDiscovery.RetryCount' must be greater than or equal to 0"};
206
+ }
207
+ if (_latencyMultiplier < 1)
208
+ {
209
+ throw PropertyException{
210
+ __FILE__,
211
+ __LINE__,
212
+ "property 'IceDiscovery.LatencyMultiplier' must be greater than or equal to 1"};
213
+ }
176
214
  }
177
215
 
178
216
  void
@@ -390,7 +428,7 @@ LookupI::objectRequestTimedOut(const ObjectRequestPtr& request)
390
428
  }
391
429
 
392
430
  void
393
- LookupI::adapterRequestException(const AdapterRequestPtr& request, exception_ptr ex)
431
+ LookupI::adapterRequestException(const AdapterRequestPtr& request, exception_ptr ex, size_t generation)
394
432
  {
395
433
  lock_guard lock(_mutex);
396
434
  auto p = _adapterRequests.find(request->getId());
@@ -399,7 +437,7 @@ LookupI::adapterRequestException(const AdapterRequestPtr& request, exception_ptr
399
437
  return;
400
438
  }
401
439
 
402
- if (request->exception())
440
+ if (request->exception(generation))
403
441
  {
404
442
  if (_warnOnce)
405
443
  {
@@ -448,7 +486,7 @@ LookupI::adapterRequestTimedOut(const AdapterRequestPtr& request)
448
486
  }
449
487
 
450
488
  void
451
- LookupI::objectRequestException(const ObjectRequestPtr& request, exception_ptr ex)
489
+ LookupI::objectRequestException(const ObjectRequestPtr& request, exception_ptr ex, size_t generation)
452
490
  {
453
491
  lock_guard lock(_mutex);
454
492
  auto p = _objectRequests.find(request->getId());
@@ -457,7 +495,7 @@ LookupI::objectRequestException(const ObjectRequestPtr& request, exception_ptr e
457
495
  return;
458
496
  }
459
497
 
460
- if (request->exception())
498
+ if (request->exception(generation))
461
499
  {
462
500
  if (_warnOnce)
463
501
  {