zeroc-ice 3.7.11 → 3.8.1
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.
- checksums.yaml +4 -4
- data/dist/IceRuby/Communicator.cpp +159 -376
- data/dist/IceRuby/Communicator.h +8 -9
- data/dist/IceRuby/Config.h +23 -89
- data/dist/IceRuby/Connection.cpp +111 -219
- data/dist/IceRuby/Connection.h +8 -12
- data/dist/IceRuby/DefaultSliceLoader.cpp +45 -0
- data/dist/IceRuby/DefaultSliceLoader.h +25 -0
- data/dist/IceRuby/Endpoint.cpp +63 -65
- data/dist/IceRuby/Endpoint.h +7 -11
- data/dist/IceRuby/ImplicitContext.cpp +26 -31
- data/dist/IceRuby/ImplicitContext.h +6 -10
- data/dist/IceRuby/Init.cpp +27 -40
- data/dist/IceRuby/Logger.cpp +23 -28
- data/dist/IceRuby/Logger.h +8 -12
- data/dist/IceRuby/Operation.cpp +177 -219
- data/dist/IceRuby/Operation.h +15 -18
- data/dist/IceRuby/Properties.cpp +133 -89
- data/dist/IceRuby/Properties.h +6 -10
- data/dist/IceRuby/Proxy.cpp +179 -649
- data/dist/IceRuby/Proxy.h +11 -12
- data/dist/IceRuby/RubySliceLoader.cpp +39 -0
- data/dist/IceRuby/RubySliceLoader.h +27 -0
- data/dist/IceRuby/Slice.cpp +88 -94
- data/dist/IceRuby/Slice.h +3 -7
- data/dist/IceRuby/Types.cpp +987 -1190
- data/dist/IceRuby/Types.h +390 -461
- data/dist/IceRuby/Util.cpp +214 -473
- data/dist/IceRuby/Util.h +378 -479
- data/dist/ice/cpp/include/Ice/AsyncResponseHandler.h +85 -0
- data/dist/ice/cpp/include/Ice/BatchRequest.h +39 -0
- data/dist/ice/cpp/include/Ice/BatchRequestQueueF.h +4 -10
- data/dist/ice/cpp/include/Ice/Buffer.h +116 -111
- data/dist/ice/cpp/include/Ice/Communicator.h +411 -0
- data/dist/ice/cpp/include/Ice/CommunicatorF.h +16 -0
- data/dist/ice/cpp/include/Ice/Config.h +46 -62
- data/dist/ice/cpp/include/Ice/Connection.h +410 -0
- data/dist/ice/cpp/include/Ice/ConnectionF.h +36 -0
- data/dist/ice/cpp/include/Ice/ConnectionIF.h +6 -28
- data/dist/ice/cpp/include/Ice/CtrlCHandler.h +56 -0
- data/dist/ice/cpp/include/Ice/Current.h +60 -0
- data/dist/ice/cpp/include/Ice/DefaultSliceLoader.h +160 -0
- data/dist/ice/cpp/include/Ice/Demangle.h +17 -0
- data/dist/ice/cpp/include/Ice/Endpoint.h +298 -0
- data/dist/ice/cpp/include/Ice/EndpointF.h +44 -0
- data/dist/ice/cpp/include/Ice/EndpointSelectionType.h +21 -0
- data/dist/ice/cpp/include/Ice/Exception.h +46 -151
- data/dist/ice/cpp/include/Ice/FacetMap.h +16 -0
- data/dist/ice/cpp/include/Ice/Format.h +11 -27
- data/dist/ice/cpp/include/Ice/Ice.h +53 -48
- data/dist/ice/cpp/include/Ice/IconvStringConverter.h +165 -326
- data/dist/ice/cpp/include/Ice/ImplicitContext.h +76 -0
- data/dist/ice/cpp/include/Ice/IncomingRequest.h +75 -0
- data/dist/ice/cpp/include/Ice/Initialize.h +113 -927
- data/dist/ice/cpp/include/Ice/InputStream.h +748 -1320
- data/dist/ice/cpp/include/Ice/InstanceF.h +4 -10
- data/dist/ice/cpp/include/Ice/Instrumentation.h +319 -0
- data/dist/ice/cpp/include/Ice/LocalException.h +58 -0
- data/dist/ice/cpp/include/Ice/LocalExceptions.h +870 -0
- data/dist/ice/cpp/include/Ice/Logger.h +62 -0
- data/dist/ice/cpp/include/Ice/LoggerUtil.h +124 -147
- data/dist/ice/cpp/include/Ice/MarshaledResult.h +50 -0
- data/dist/ice/cpp/include/Ice/NativePropertiesAdmin.h +41 -71
- data/dist/ice/cpp/include/Ice/Object.h +151 -490
- data/dist/ice/cpp/include/Ice/ObjectAdapter.h +324 -0
- data/dist/ice/cpp/include/Ice/ObjectAdapterF.h +16 -0
- data/dist/ice/cpp/include/Ice/ObjectF.h +5 -19
- data/dist/ice/cpp/include/Ice/ObserverHelper.h +115 -132
- data/dist/ice/cpp/include/Ice/OutgoingAsync.h +392 -748
- data/dist/ice/cpp/include/Ice/OutgoingResponse.h +129 -0
- data/dist/ice/cpp/include/Ice/OutputStream.h +756 -956
- data/dist/ice/cpp/include/Ice/Plugin.h +73 -0
- data/dist/ice/cpp/include/Ice/PluginFactory.h +77 -0
- data/dist/ice/cpp/include/{IceUtil → Ice}/PopDisableWarnings.h +8 -6
- data/dist/ice/cpp/include/Ice/Properties.h +307 -0
- data/dist/ice/cpp/include/Ice/PropertiesF.h +19 -0
- data/dist/ice/cpp/include/Ice/Proxy.h +665 -5094
- data/dist/ice/cpp/include/Ice/ProxyF.h +2 -44
- data/dist/ice/cpp/include/Ice/ProxyFunctions.h +209 -0
- data/dist/ice/cpp/include/Ice/PushDisableWarnings.h +29 -0
- data/dist/ice/cpp/include/Ice/ReferenceF.h +4 -19
- data/dist/ice/cpp/include/Ice/RequestHandlerF.h +8 -18
- data/dist/ice/cpp/include/Ice/SSL/ClientAuthenticationOptions.h +276 -0
- data/dist/ice/cpp/include/Ice/SSL/Config.h +54 -0
- data/dist/ice/cpp/include/Ice/SSL/ConnectionInfo.h +107 -0
- data/dist/ice/cpp/include/Ice/SSL/ConnectionInfoF.h +39 -0
- data/dist/ice/cpp/include/Ice/SSL/EndpointInfo.h +40 -0
- data/dist/ice/cpp/include/Ice/SSL/SSLException.h +32 -0
- data/dist/ice/cpp/include/Ice/SSL/ServerAuthenticationOptions.h +286 -0
- data/dist/ice/cpp/include/Ice/ServantLocator.h +51 -0
- data/dist/ice/cpp/include/Ice/Service.h +182 -342
- data/dist/ice/cpp/include/Ice/SliceLoader.h +67 -0
- data/dist/ice/cpp/include/Ice/SlicedData.h +113 -160
- data/dist/ice/cpp/include/Ice/SlicedDataF.h +17 -27
- data/dist/ice/cpp/include/Ice/StreamHelpers.h +532 -1070
- data/dist/ice/cpp/include/Ice/StreamableTraits.h +291 -0
- data/dist/ice/cpp/include/Ice/StringConverter.h +152 -63
- data/dist/ice/cpp/include/Ice/StringUtil.h +114 -0
- data/dist/ice/cpp/include/Ice/TimerTask.h +24 -0
- data/dist/ice/cpp/include/Ice/TupleCompare.h +103 -0
- data/dist/ice/cpp/include/Ice/UUID.h +6 -9
- data/dist/ice/cpp/include/Ice/UserException.h +46 -0
- data/dist/ice/cpp/include/Ice/UserExceptionFactory.h +4 -79
- data/dist/ice/cpp/include/Ice/Value.h +103 -115
- data/dist/ice/cpp/include/Ice/ValueF.h +6 -11
- data/dist/ice/cpp/include/IceDiscovery/IceDiscovery.h +16 -1877
- data/dist/ice/cpp/include/IceLocatorDiscovery/IceLocatorDiscovery.h +16 -1185
- data/dist/ice/cpp/include/generated/Ice/BuiltinSequences.h +46 -146
- data/dist/ice/cpp/include/generated/Ice/Context.h +40 -0
- data/dist/ice/cpp/include/generated/Ice/EndpointTypes.h +49 -93
- data/dist/ice/cpp/include/generated/Ice/Identity.h +70 -226
- data/dist/ice/cpp/include/generated/Ice/Locator.h +494 -3850
- data/dist/ice/cpp/include/generated/Ice/LocatorRegistry.h +443 -0
- data/dist/ice/cpp/include/generated/Ice/Metrics.h +937 -4603
- data/dist/ice/cpp/include/generated/Ice/OperationMode.h +73 -0
- data/dist/ice/cpp/include/generated/Ice/Process.h +197 -929
- data/dist/ice/cpp/include/generated/Ice/PropertiesAdmin.h +249 -1301
- data/dist/ice/cpp/include/generated/Ice/PropertyDict.h +39 -0
- data/dist/ice/cpp/include/generated/Ice/RemoteLogger.h +637 -2620
- data/dist/ice/cpp/include/generated/Ice/ReplyStatus.h +94 -0
- data/dist/ice/cpp/include/generated/Ice/Router.h +429 -1783
- data/dist/ice/cpp/include/generated/Ice/SliceChecksumDict.h +18 -65
- data/dist/ice/cpp/include/generated/Ice/Version.h +73 -318
- data/dist/ice/cpp/include/generated/IceDiscovery/Lookup.h +498 -0
- data/dist/ice/cpp/include/generated/IceLocatorDiscovery/Lookup.h +387 -0
- data/dist/ice/cpp/src/Ice/Acceptor.h +28 -24
- data/dist/ice/cpp/src/Ice/AcceptorF.h +6 -14
- data/dist/ice/cpp/src/Ice/AddDefaultPluginFactories.h +16 -0
- data/dist/ice/cpp/src/Ice/AddDefaultPluginFactories_all.cpp +43 -0
- data/dist/ice/cpp/src/Ice/AddDefaultPluginFactories_min.cpp +17 -0
- data/dist/ice/cpp/src/Ice/ArgVector.cpp +17 -18
- data/dist/ice/cpp/src/Ice/ArgVector.h +19 -25
- data/dist/ice/cpp/src/Ice/Base64.cpp +66 -66
- data/dist/ice/cpp/src/Ice/Base64.h +14 -19
- data/dist/ice/cpp/src/Ice/BatchRequestQueue.cpp +70 -121
- data/dist/ice/cpp/src/Ice/BatchRequestQueue.h +37 -47
- data/dist/ice/cpp/src/Ice/Buffer.cpp +73 -41
- data/dist/ice/cpp/src/Ice/CheckIdentity.h +21 -0
- data/dist/ice/cpp/src/Ice/CollocatedRequestHandler.cpp +215 -249
- data/dist/ice/cpp/src/Ice/CollocatedRequestHandler.h +38 -60
- data/dist/ice/cpp/src/Ice/Communicator.cpp +399 -0
- data/dist/ice/cpp/src/Ice/CommunicatorFlushBatchAsync.cpp +140 -0
- data/dist/ice/cpp/src/Ice/CommunicatorFlushBatchAsync.h +39 -0
- data/dist/ice/cpp/src/Ice/ConnectRequestHandler.cpp +63 -184
- data/dist/ice/cpp/src/Ice/ConnectRequestHandler.h +30 -51
- data/dist/ice/cpp/src/Ice/ConnectRequestHandlerF.h +4 -14
- data/dist/ice/cpp/src/Ice/Connection.cpp +44 -0
- data/dist/ice/cpp/src/Ice/ConnectionFactory.cpp +578 -792
- data/dist/ice/cpp/src/Ice/ConnectionFactory.h +200 -200
- data/dist/ice/cpp/src/Ice/ConnectionFactoryF.h +6 -19
- data/dist/ice/cpp/src/Ice/ConnectionI.cpp +1674 -1782
- data/dist/ice/cpp/src/Ice/ConnectionI.h +333 -293
- data/dist/ice/cpp/src/Ice/ConnectionOptions.h +22 -0
- data/dist/ice/cpp/src/Ice/Connector.h +25 -19
- data/dist/ice/cpp/src/Ice/ConnectorF.h +4 -11
- data/dist/ice/cpp/src/{IceUtil → Ice}/ConsoleUtil.cpp +32 -53
- data/dist/ice/cpp/src/Ice/ConsoleUtil.h +79 -0
- data/dist/ice/cpp/src/Ice/CtrlCHandler.cpp +189 -0
- data/dist/ice/cpp/src/Ice/Current.cpp +29 -0
- data/dist/ice/cpp/src/Ice/DLLMain.cpp +25 -35
- data/dist/ice/cpp/src/Ice/DefaultSliceLoader.cpp +39 -0
- data/dist/ice/cpp/src/Ice/DefaultsAndOverrides.cpp +41 -119
- data/dist/ice/cpp/src/Ice/DefaultsAndOverrides.h +27 -41
- data/dist/ice/cpp/src/Ice/DefaultsAndOverridesF.h +4 -11
- data/dist/ice/cpp/src/Ice/Demangle.cpp +26 -0
- data/dist/ice/cpp/src/Ice/DisableWarnings.h +31 -0
- data/dist/ice/cpp/src/Ice/DynamicLibrary.cpp +44 -112
- data/dist/ice/cpp/src/Ice/DynamicLibrary.h +91 -0
- data/dist/ice/cpp/src/Ice/Endian.h +40 -0
- data/dist/ice/cpp/src/Ice/EndpointFactory.cpp +35 -59
- data/dist/ice/cpp/src/Ice/EndpointFactory.h +82 -103
- data/dist/ice/cpp/src/Ice/EndpointFactoryF.h +4 -11
- data/dist/ice/cpp/src/Ice/EndpointFactoryManager.cpp +54 -87
- data/dist/ice/cpp/src/Ice/EndpointFactoryManager.h +28 -33
- data/dist/ice/cpp/src/Ice/EndpointFactoryManagerF.h +4 -11
- data/dist/ice/cpp/src/Ice/EndpointI.cpp +53 -23
- data/dist/ice/cpp/src/Ice/EndpointI.h +132 -200
- data/dist/ice/cpp/src/Ice/EndpointIF.h +11 -39
- data/dist/ice/cpp/src/Ice/EventHandler.cpp +3 -26
- data/dist/ice/cpp/src/Ice/EventHandler.h +46 -56
- data/dist/ice/cpp/src/Ice/EventHandlerF.h +4 -14
- data/dist/ice/cpp/src/Ice/Exception.cpp +3 -816
- data/dist/ice/cpp/src/Ice/FileUtil.cpp +476 -0
- data/dist/ice/cpp/src/Ice/FileUtil.h +152 -0
- data/dist/ice/cpp/src/Ice/FixedRequestHandler.cpp +34 -0
- data/dist/ice/cpp/src/Ice/FixedRequestHandler.h +29 -0
- data/dist/ice/cpp/src/Ice/HashUtil.h +46 -32
- data/dist/ice/cpp/src/Ice/HttpParser.cpp +431 -431
- data/dist/ice/cpp/src/Ice/HttpParser.h +95 -100
- data/dist/ice/cpp/src/Ice/IPEndpointI.cpp +207 -324
- data/dist/ice/cpp/src/Ice/IPEndpointI.h +80 -126
- data/dist/ice/cpp/src/Ice/IPEndpointIF.h +6 -17
- data/dist/ice/cpp/src/Ice/IdleTimeoutTransceiverDecorator.cpp +172 -0
- data/dist/ice/cpp/src/Ice/IdleTimeoutTransceiverDecorator.h +89 -0
- data/dist/ice/cpp/src/Ice/ImplicitContext.cpp +109 -0
- data/dist/ice/cpp/src/Ice/IncomingRequest.cpp +66 -0
- data/dist/ice/cpp/src/Ice/Initialize.cpp +48 -542
- data/dist/ice/cpp/src/Ice/InputStream.cpp +848 -1385
- data/dist/ice/cpp/src/Ice/Instance.cpp +816 -827
- data/dist/ice/cpp/src/Ice/Instance.h +202 -212
- data/dist/ice/cpp/src/Ice/InstrumentationI.cpp +526 -661
- data/dist/ice/cpp/src/Ice/InstrumentationI.h +171 -192
- data/dist/ice/cpp/src/Ice/LocalException.cpp +518 -0
- data/dist/ice/cpp/src/Ice/LocalExceptions.cpp +577 -0
- data/dist/ice/cpp/src/Ice/LocatorInfo.cpp +291 -329
- data/dist/ice/cpp/src/Ice/LocatorInfo.h +144 -157
- data/dist/ice/cpp/src/Ice/LocatorInfoF.h +8 -17
- data/dist/ice/cpp/src/Ice/LoggerAdminI.cpp +561 -743
- data/dist/ice/cpp/src/Ice/LoggerAdminI.h +18 -28
- data/dist/ice/cpp/src/Ice/LoggerI.cpp +66 -91
- data/dist/ice/cpp/src/Ice/LoggerI.h +36 -41
- data/dist/ice/cpp/src/Ice/LoggerMiddleware.cpp +176 -0
- data/dist/ice/cpp/src/Ice/LoggerMiddleware.h +42 -0
- data/dist/ice/cpp/src/Ice/LoggerUtil.cpp +14 -38
- data/dist/ice/cpp/src/Ice/MarshaledResult.cpp +20 -0
- data/dist/ice/cpp/src/Ice/MetricsAdminI.cpp +194 -280
- data/dist/ice/cpp/src/Ice/MetricsAdminI.h +600 -0
- data/dist/ice/cpp/src/Ice/MetricsFunctional.h +92 -0
- data/dist/ice/cpp/src/Ice/MetricsObserverI.h +587 -0
- data/dist/ice/cpp/src/Ice/NativePropertiesAdmin.cpp +185 -0
- data/dist/ice/cpp/src/Ice/Network.cpp +595 -917
- data/dist/ice/cpp/src/Ice/Network.h +189 -213
- data/dist/ice/cpp/src/Ice/NetworkF.h +2 -10
- data/dist/ice/cpp/src/Ice/NetworkProxy.cpp +99 -104
- data/dist/ice/cpp/src/Ice/NetworkProxy.h +49 -54
- data/dist/ice/cpp/src/Ice/NetworkProxyF.h +4 -11
- data/dist/ice/cpp/src/Ice/OSLogLoggerI.cpp +16 -18
- data/dist/ice/cpp/src/Ice/OSLogLoggerI.h +22 -27
- data/dist/ice/cpp/src/Ice/Object.cpp +152 -338
- data/dist/ice/cpp/src/Ice/ObjectAdapterFactory.cpp +170 -113
- data/dist/ice/cpp/src/Ice/ObjectAdapterFactory.h +41 -41
- data/dist/ice/cpp/src/Ice/ObjectAdapterFactoryF.h +4 -15
- data/dist/ice/cpp/src/Ice/ObjectAdapterI.cpp +580 -727
- data/dist/ice/cpp/src/Ice/ObjectAdapterI.h +149 -145
- data/dist/ice/cpp/src/Ice/ObserverHelper.cpp +36 -17
- data/dist/ice/cpp/src/Ice/ObserverMiddleware.cpp +96 -0
- data/dist/ice/cpp/src/Ice/ObserverMiddleware.h +25 -0
- data/dist/ice/cpp/src/Ice/OpaqueEndpointI.cpp +147 -187
- data/dist/ice/cpp/src/Ice/OpaqueEndpointI.h +56 -64
- data/dist/ice/cpp/src/{IceUtil → Ice}/Options.cpp +187 -258
- data/dist/ice/cpp/src/Ice/Options.h +119 -0
- data/dist/ice/cpp/src/Ice/OutgoingAsync.cpp +516 -732
- data/dist/ice/cpp/src/Ice/OutgoingResponse.cpp +276 -0
- data/dist/ice/cpp/src/Ice/OutputStream.cpp +610 -543
- data/dist/ice/cpp/src/Ice/OutputUtil.cpp +344 -0
- data/dist/ice/cpp/src/Ice/OutputUtil.h +173 -0
- data/dist/ice/cpp/src/Ice/PluginManagerI.cpp +118 -277
- data/dist/ice/cpp/src/Ice/PluginManagerI.h +41 -48
- data/dist/ice/cpp/src/Ice/Properties.cpp +931 -0
- data/dist/ice/cpp/src/Ice/PropertyNames.cpp +519 -1341
- data/dist/ice/cpp/src/Ice/PropertyNames.h +49 -64
- data/dist/ice/cpp/src/Ice/PropertyUtil.cpp +103 -0
- data/dist/ice/cpp/src/Ice/PropertyUtil.h +31 -0
- data/dist/ice/cpp/src/Ice/Protocol.cpp +129 -94
- data/dist/ice/cpp/src/Ice/Protocol.h +116 -0
- data/dist/ice/cpp/src/Ice/ProtocolInstance.cpp +117 -62
- data/dist/ice/cpp/src/Ice/ProtocolInstance.h +63 -82
- data/dist/ice/cpp/src/Ice/ProtocolInstanceF.h +4 -11
- data/dist/ice/cpp/src/Ice/ProtocolPluginFacade.cpp +10 -32
- data/dist/ice/cpp/src/Ice/ProtocolPluginFacade.h +25 -54
- data/dist/ice/cpp/src/Ice/Proxy.cpp +294 -1357
- data/dist/ice/cpp/src/Ice/ProxyAsync.cpp +684 -0
- data/dist/ice/cpp/src/Ice/ProxyFunctions.cpp +90 -0
- data/dist/ice/cpp/src/Ice/PushDisableDeprecatedWarnings.h +15 -0
- data/dist/ice/cpp/src/Ice/Random.cpp +29 -0
- data/dist/ice/cpp/src/Ice/Random.h +23 -0
- data/dist/ice/cpp/src/Ice/Reference.cpp +635 -1097
- data/dist/ice/cpp/src/Ice/Reference.h +314 -298
- data/dist/ice/cpp/src/Ice/ReferenceFactory.cpp +320 -378
- data/dist/ice/cpp/src/Ice/ReferenceFactory.h +48 -66
- data/dist/ice/cpp/src/Ice/ReferenceFactoryF.h +4 -9
- data/dist/ice/cpp/src/Ice/RequestHandler.cpp +15 -24
- data/dist/ice/cpp/src/Ice/RequestHandler.h +43 -68
- data/dist/ice/cpp/src/Ice/RequestHandlerCache.cpp +76 -0
- data/dist/ice/cpp/src/Ice/RequestHandlerCache.h +33 -0
- data/dist/ice/cpp/src/Ice/ResourceConfig.h +27 -0
- data/dist/ice/cpp/src/Ice/RetryQueue.cpp +51 -57
- data/dist/ice/cpp/src/Ice/RetryQueue.h +39 -46
- data/dist/ice/cpp/src/Ice/RetryQueueF.h +4 -9
- data/dist/ice/cpp/src/Ice/RouterInfo.cpp +97 -201
- data/dist/ice/cpp/src/Ice/RouterInfo.h +61 -118
- data/dist/ice/cpp/src/Ice/RouterInfoF.h +6 -14
- data/dist/ice/cpp/src/Ice/SHA1.cpp +86 -60
- data/dist/ice/cpp/src/Ice/SHA1.h +35 -0
- data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.cpp +89 -0
- data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.h +87 -0
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngine.cpp +521 -0
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngine.h +40 -0
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngineF.h +13 -0
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.cpp +646 -0
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.h +80 -0
- data/dist/ice/cpp/src/{IceSSL → Ice/SSL}/RFC2253.cpp +85 -88
- data/dist/ice/cpp/src/Ice/SSL/RFC2253.h +58 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLAcceptorI.cpp +124 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLAcceptorI.h +52 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLConnectorI.cpp +92 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLConnectorI.h +38 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLEndpointI.cpp +377 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLEndpointI.h +84 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLEngine.cpp +115 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLEngine.h +69 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLEngineF.h +14 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLException.cpp +18 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLInstance.cpp +27 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLInstance.h +26 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLInstanceF.h +19 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLUtil.cpp +673 -0
- data/dist/ice/cpp/src/Ice/SSL/SSLUtil.h +118 -0
- data/dist/ice/cpp/src/Ice/SSL/SchannelEngine.cpp +1449 -0
- data/dist/ice/cpp/src/Ice/SSL/SchannelEngine.h +58 -0
- data/dist/ice/cpp/src/Ice/SSL/SchannelEngineF.h +18 -0
- data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.cpp +1088 -0
- data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.h +118 -0
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngine.cpp +825 -0
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngine.h +44 -0
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngineF.h +18 -0
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportTransceiverI.cpp +621 -0
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportTransceiverI.h +91 -0
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.cpp +1048 -0
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.h +40 -0
- data/dist/ice/cpp/src/Ice/SSL/TrustManager.cpp +233 -0
- data/dist/ice/cpp/src/Ice/SSL/TrustManager.h +42 -0
- data/dist/ice/cpp/src/Ice/SSL/TrustManagerF.h +14 -0
- data/dist/ice/cpp/src/Ice/ScannerConfig.h +35 -0
- data/dist/ice/cpp/src/Ice/Selector.cpp +341 -606
- data/dist/ice/cpp/src/Ice/Selector.h +167 -224
- data/dist/ice/cpp/src/Ice/ServantManager.cpp +195 -128
- data/dist/ice/cpp/src/Ice/ServantManager.h +52 -55
- data/dist/ice/cpp/src/Ice/ServantManagerF.h +14 -0
- data/dist/ice/cpp/src/Ice/Service.cpp +548 -641
- data/dist/ice/cpp/src/Ice/SharedContext.h +13 -26
- data/dist/ice/cpp/src/Ice/SliceLoader.cpp +53 -0
- data/dist/ice/cpp/src/Ice/SlicedData.cpp +17 -96
- data/dist/ice/cpp/src/Ice/StreamSocket.cpp +104 -151
- data/dist/ice/cpp/src/Ice/StreamSocket.h +48 -60
- data/dist/ice/cpp/src/Ice/StringConverter.cpp +586 -0
- data/dist/ice/cpp/src/Ice/StringUtil.cpp +1137 -0
- data/dist/ice/cpp/src/Ice/SysLoggerI.cpp +41 -47
- data/dist/ice/cpp/src/Ice/SysLoggerI.h +24 -27
- data/dist/ice/cpp/src/Ice/SystemdJournalI.cpp +16 -17
- data/dist/ice/cpp/src/Ice/SystemdJournalI.h +19 -25
- data/dist/ice/cpp/src/Ice/TargetCompare.h +96 -0
- data/dist/ice/cpp/src/Ice/TcpAcceptor.cpp +67 -88
- data/dist/ice/cpp/src/Ice/TcpAcceptor.h +34 -40
- data/dist/ice/cpp/src/Ice/TcpConnector.cpp +42 -41
- data/dist/ice/cpp/src/Ice/TcpConnector.h +26 -35
- data/dist/ice/cpp/src/Ice/TcpEndpointI.cpp +172 -146
- data/dist/ice/cpp/src/Ice/TcpEndpointI.h +76 -80
- data/dist/ice/cpp/src/Ice/TcpTransceiver.cpp +38 -26
- data/dist/ice/cpp/src/Ice/TcpTransceiver.h +40 -45
- data/dist/ice/cpp/src/Ice/ThreadPool.cpp +333 -515
- data/dist/ice/cpp/src/Ice/ThreadPool.h +202 -290
- data/dist/ice/cpp/src/Ice/ThreadPoolF.h +14 -0
- data/dist/ice/cpp/src/Ice/TimeUtil.cpp +47 -0
- data/dist/ice/cpp/src/Ice/TimeUtil.h +21 -0
- data/dist/ice/cpp/src/Ice/Timer.cpp +73 -167
- data/dist/ice/cpp/src/Ice/Timer.h +212 -0
- data/dist/ice/cpp/src/Ice/TraceLevels.cpp +11 -29
- data/dist/ice/cpp/src/Ice/TraceLevels.h +22 -28
- data/dist/ice/cpp/src/Ice/TraceLevelsF.h +4 -11
- data/dist/ice/cpp/src/Ice/TraceUtil.cpp +136 -215
- data/dist/ice/cpp/src/Ice/TraceUtil.h +27 -16
- data/dist/ice/cpp/src/Ice/Transceiver.cpp +3 -7
- data/dist/ice/cpp/src/Ice/Transceiver.h +35 -32
- data/dist/ice/cpp/src/Ice/TransceiverF.h +10 -20
- data/dist/ice/cpp/src/Ice/UUID.cpp +79 -0
- data/dist/ice/cpp/src/Ice/UdpConnector.cpp +39 -39
- data/dist/ice/cpp/src/Ice/UdpConnector.h +27 -36
- data/dist/ice/cpp/src/Ice/UdpEndpointI.cpp +178 -213
- data/dist/ice/cpp/src/Ice/UdpEndpointI.h +82 -85
- data/dist/ice/cpp/src/Ice/UdpTransceiver.cpp +201 -221
- data/dist/ice/cpp/src/Ice/UdpTransceiver.h +68 -74
- data/dist/ice/cpp/{include/IceUtil → src/Ice}/UndefSysMacros.h +12 -12
- data/dist/ice/cpp/src/Ice/UniqueRef.h +77 -0
- data/dist/ice/cpp/src/Ice/UserException.cpp +58 -0
- data/dist/ice/cpp/src/Ice/Value.cpp +107 -38
- data/dist/ice/cpp/src/Ice/WSAcceptor.cpp +10 -15
- data/dist/ice/cpp/src/Ice/WSAcceptor.h +31 -37
- data/dist/ice/cpp/src/Ice/WSConnector.cpp +25 -40
- data/dist/ice/cpp/src/Ice/WSConnector.h +26 -33
- data/dist/ice/cpp/src/Ice/WSEndpoint.cpp +164 -217
- data/dist/ice/cpp/src/Ice/WSEndpoint.h +72 -83
- data/dist/ice/cpp/src/Ice/WSTransceiver.cpp +469 -458
- data/dist/ice/cpp/src/Ice/WSTransceiver.h +117 -123
- data/dist/ice/cpp/src/Ice/generated/BuiltinSequences.cpp +20 -29
- data/dist/ice/cpp/src/Ice/generated/Context.cpp +40 -0
- data/dist/ice/cpp/src/Ice/generated/EndpointTypes.cpp +20 -31
- data/dist/ice/cpp/src/Ice/generated/Identity.cpp +24 -34
- data/dist/ice/cpp/src/Ice/generated/Locator.cpp +454 -1744
- data/dist/ice/cpp/src/Ice/generated/LocatorRegistry.cpp +577 -0
- data/dist/ice/cpp/src/Ice/generated/Metrics.cpp +824 -1971
- data/dist/ice/cpp/src/Ice/generated/OperationMode.cpp +56 -0
- data/dist/ice/cpp/src/Ice/generated/Process.cpp +190 -331
- data/dist/ice/cpp/src/Ice/generated/PropertiesAdmin.cpp +289 -449
- data/dist/ice/cpp/src/Ice/generated/PropertyDict.cpp +40 -0
- data/dist/ice/cpp/src/Ice/generated/RemoteLogger.cpp +547 -867
- data/dist/ice/cpp/src/Ice/generated/ReplyStatus.cpp +70 -0
- data/dist/ice/cpp/src/Ice/generated/Router.cpp +406 -723
- data/dist/ice/cpp/src/Ice/generated/SliceChecksumDict.cpp +19 -29
- data/dist/ice/cpp/src/Ice/generated/Version.cpp +28 -31
- data/dist/ice/cpp/src/IceDiscovery/LocatorI.cpp +76 -139
- data/dist/ice/cpp/src/IceDiscovery/LocatorI.h +55 -96
- data/dist/ice/cpp/src/IceDiscovery/LookupI.cpp +190 -303
- data/dist/ice/cpp/src/IceDiscovery/LookupI.h +126 -185
- data/dist/ice/cpp/src/IceDiscovery/PluginI.cpp +56 -77
- data/dist/ice/cpp/src/IceDiscovery/PluginI.h +20 -25
- data/dist/ice/cpp/src/IceDiscovery/generated/Lookup.cpp +638 -0
- data/dist/ice/cpp/src/IceLocatorDiscovery/Plugin.h +14 -37
- data/dist/ice/cpp/src/IceLocatorDiscovery/PluginI.cpp +411 -649
- data/dist/ice/cpp/src/IceLocatorDiscovery/generated/Lookup.cpp +468 -0
- data/dist/ice/cpp/src/Slice/DeprecationReporter.cpp +172 -0
- data/dist/ice/cpp/src/Slice/DeprecationReporter.h +14 -0
- data/dist/ice/cpp/src/Slice/DocCommentParser.cpp +736 -0
- data/dist/ice/cpp/src/Slice/DocCommentParser.h +61 -0
- data/dist/ice/cpp/src/Slice/FileTracker.cpp +25 -75
- data/dist/ice/cpp/src/Slice/FileTracker.h +35 -56
- data/dist/ice/cpp/src/Slice/Grammar.cpp +2711 -3382
- data/dist/ice/cpp/src/Slice/Grammar.h +95 -75
- data/dist/ice/cpp/src/Slice/GrammarUtil.h +117 -217
- data/dist/ice/cpp/src/Slice/MetadataValidation.cpp +486 -0
- data/dist/ice/cpp/src/Slice/MetadataValidation.h +106 -0
- data/dist/ice/cpp/src/Slice/Parser.cpp +3068 -5223
- data/dist/ice/cpp/src/Slice/Parser.h +1086 -1065
- data/dist/ice/cpp/src/Slice/Preprocessor.cpp +97 -599
- data/dist/ice/cpp/src/Slice/Preprocessor.h +26 -42
- data/dist/ice/cpp/src/Slice/Scanner.cpp +1562 -924
- data/dist/ice/cpp/src/Slice/SliceUtil.cpp +517 -113
- data/dist/ice/cpp/src/Slice/StringLiteralUtil.cpp +254 -269
- data/dist/ice/cpp/src/Slice/Util.h +126 -35
- data/dist/ice/cpp/src/slice2rb/Main.cpp +13 -15
- data/dist/ice/cpp/src/slice2rb/Ruby.cpp +250 -0
- data/dist/ice/cpp/src/slice2rb/RubyUtil.cpp +1197 -0
- data/dist/ice/cpp/src/slice2rb/RubyUtil.h +56 -0
- data/dist/ice/slice/Glacier2/Metrics.ice +34 -75
- data/dist/ice/slice/Glacier2/PermissionsVerifier.ice +42 -98
- data/dist/ice/slice/Glacier2/Router.ice +80 -173
- data/dist/ice/slice/Glacier2/SSLInfo.ice +23 -40
- data/dist/ice/slice/Glacier2/Session.ice +120 -261
- data/dist/ice/slice/Ice/BuiltinSequences.ice +33 -38
- data/dist/ice/slice/Ice/Context.ice +24 -0
- data/dist/ice/slice/Ice/EndpointTypes.ice +35 -33
- data/dist/ice/slice/Ice/Identity.ice +24 -63
- data/dist/ice/slice/Ice/Locator.ice +61 -226
- data/dist/ice/slice/Ice/LocatorRegistry.ice +77 -0
- data/dist/ice/slice/Ice/Metrics.ice +189 -424
- data/dist/ice/slice/Ice/OperationMode.ice +38 -0
- data/dist/ice/slice/Ice/Process.ice +16 -52
- data/dist/ice/slice/Ice/PropertiesAdmin.ice +25 -75
- data/dist/ice/slice/Ice/PropertyDict.ice +23 -0
- data/dist/ice/slice/Ice/RemoteLogger.ice +113 -213
- data/dist/ice/slice/Ice/ReplyStatus.ice +65 -0
- data/dist/ice/slice/Ice/Router.ice +42 -91
- data/dist/ice/slice/Ice/SliceChecksumDict.ice +7 -25
- data/dist/ice/slice/Ice/Version.ice +31 -39
- data/dist/ice/slice/IceBox/ServiceManager.ice +79 -0
- data/dist/ice/slice/IceGrid/Admin.ice +942 -1918
- data/dist/ice/slice/IceGrid/Descriptor.ice +476 -1051
- data/dist/ice/slice/IceGrid/Exception.ice +86 -384
- data/dist/ice/slice/IceGrid/FileParser.ice +23 -59
- data/dist/ice/slice/IceGrid/Registry.ice +117 -256
- data/dist/ice/slice/IceGrid/Session.ice +46 -110
- data/dist/ice/slice/IceGrid/UserAccountMapper.ice +22 -57
- data/dist/ice/slice/IceStorm/IceStorm.ice +173 -401
- data/dist/ice/slice/IceStorm/Metrics.ice +28 -70
- data/dist/lib/Glacier2/Metrics.rb +16 -31
- data/dist/lib/Glacier2/PermissionsVerifier.rb +18 -50
- data/dist/lib/Glacier2/Router.rb +20 -42
- data/dist/lib/Glacier2/SSLInfo.rb +14 -22
- data/dist/lib/Glacier2/Session.rb +53 -113
- data/dist/lib/Glacier2.rb +6 -6
- data/dist/lib/Ice/BuiltinSequences.rb +14 -26
- data/dist/lib/Ice/CompressBatch.rb +50 -0
- data/dist/lib/Ice/Context.rb +12 -0
- data/dist/lib/Ice/EndpointSelectionType.rb +49 -0
- data/dist/lib/Ice/EndpointTypes.rb +14 -55
- data/dist/lib/Ice/Exception.rb +20 -0
- data/dist/lib/Ice/Identity.rb +10 -26
- data/dist/lib/Ice/IdentitySpaceship.rb +16 -0
- data/dist/lib/Ice/InitializationData.rb +12 -0
- data/dist/lib/Ice/LocalExceptions.rb +168 -0
- data/dist/lib/Ice/Locator.rb +21 -134
- data/dist/lib/Ice/LocatorRegistry.rb +73 -0
- data/dist/lib/Ice/Metrics.rb +85 -132
- data/dist/lib/Ice/OperationMode.rb +58 -0
- data/dist/lib/Ice/Process.rb +12 -31
- data/dist/lib/Ice/PropertiesAdmin.rb +12 -36
- data/dist/lib/Ice/PropertyDict.rb +12 -0
- data/dist/lib/Ice/Proxy.rb +85 -0
- data/dist/lib/Ice/ProxyFunctions.rb +69 -0
- data/dist/lib/Ice/RemoteLogger.rb +29 -60
- data/dist/lib/Ice/ReplyStatus.rb +65 -0
- data/dist/lib/Ice/Router.rb +19 -47
- data/dist/lib/Ice/SliceChecksumDict.rb +5 -17
- data/dist/lib/Ice/SliceUtil.rb +41 -0
- data/dist/lib/Ice/Struct.rb +11 -0
- data/dist/lib/Ice/ToStringMode.rb +50 -0
- data/dist/lib/Ice/Value.rb +93 -0
- data/dist/lib/Ice/Version.rb +12 -24
- data/dist/lib/Ice.rb +29 -665
- data/dist/lib/IceBox/ServiceManager.rb +104 -0
- data/dist/lib/IceBox.rb +2 -4
- data/dist/lib/IceGrid/Admin.rb +303 -291
- data/dist/lib/IceGrid/Descriptor.rb +147 -192
- data/dist/lib/IceGrid/Exception.rb +26 -257
- data/dist/lib/IceGrid/FileParser.rb +12 -36
- data/dist/lib/IceGrid/Registry.rb +35 -76
- data/dist/lib/IceGrid/Session.rb +19 -34
- data/dist/lib/IceGrid/UserAccountMapper.rb +11 -34
- data/dist/lib/IceGrid.rb +3 -3
- data/dist/lib/IceStorm/IceStorm.rb +51 -132
- data/dist/lib/IceStorm/Metrics.rb +19 -37
- data/dist/lib/IceStorm.rb +3 -5
- data/extconf.rb +6 -8
- data/ice.gemspec +3 -3
- data/scripts/slice2rb +1 -3
- metadata +206 -386
- data/dist/IceRuby/ValueFactoryManager.cpp +0 -445
- data/dist/IceRuby/ValueFactoryManager.h +0 -95
- data/dist/ice/cpp/include/Ice/Application.h +0 -326
- data/dist/ice/cpp/include/Ice/AsyncResult.h +0 -155
- data/dist/ice/cpp/include/Ice/AsyncResultF.h +0 -23
- data/dist/ice/cpp/include/Ice/BatchRequestInterceptor.h +0 -75
- data/dist/ice/cpp/include/Ice/CommunicatorAsync.h +0 -154
- data/dist/ice/cpp/include/Ice/Comparable.h +0 -205
- data/dist/ice/cpp/include/Ice/ConnectionAsync.h +0 -302
- data/dist/ice/cpp/include/Ice/ConsoleUtil.h +0 -23
- data/dist/ice/cpp/include/Ice/DefaultValueFactory.h +0 -57
- data/dist/ice/cpp/include/Ice/DispatchInterceptor.h +0 -41
- data/dist/ice/cpp/include/Ice/Dispatcher.h +0 -67
- data/dist/ice/cpp/include/Ice/DynamicLibrary.h +0 -102
- data/dist/ice/cpp/include/Ice/DynamicLibraryF.h +0 -24
- data/dist/ice/cpp/include/Ice/ExceptionHelpers.h +0 -74
- data/dist/ice/cpp/include/Ice/FactoryTable.h +0 -73
- data/dist/ice/cpp/include/Ice/FactoryTableInit.h +0 -84
- data/dist/ice/cpp/include/Ice/Functional.h +0 -140
- data/dist/ice/cpp/include/Ice/GCObject.h +0 -76
- data/dist/ice/cpp/include/Ice/Handle.h +0 -182
- data/dist/ice/cpp/include/Ice/Incoming.h +0 -225
- data/dist/ice/cpp/include/Ice/IncomingAsync.h +0 -186
- data/dist/ice/cpp/include/Ice/IncomingAsyncF.h +0 -36
- data/dist/ice/cpp/include/Ice/InterfaceByValue.h +0 -57
- data/dist/ice/cpp/include/Ice/LocalObject.h +0 -35
- data/dist/ice/cpp/include/Ice/LocalObjectF.h +0 -21
- data/dist/ice/cpp/include/Ice/MetricsAdminI.h +0 -715
- data/dist/ice/cpp/include/Ice/MetricsFunctional.h +0 -159
- data/dist/ice/cpp/include/Ice/MetricsObserverI.h +0 -669
- data/dist/ice/cpp/include/Ice/Optional.h +0 -1114
- data/dist/ice/cpp/include/Ice/OutgoingAsyncF.h +0 -39
- data/dist/ice/cpp/include/Ice/Protocol.h +0 -274
- data/dist/ice/cpp/include/Ice/ProxyFactoryF.h +0 -21
- data/dist/ice/cpp/include/Ice/ProxyHandle.h +0 -318
- data/dist/ice/cpp/include/Ice/RegisterPlugins.h +0 -127
- data/dist/ice/cpp/include/Ice/ResponseHandlerF.h +0 -25
- data/dist/ice/cpp/include/Ice/SHA1.h +0 -40
- data/dist/ice/cpp/include/Ice/ServantManagerF.h +0 -21
- data/dist/ice/cpp/include/Ice/SliceChecksums.h +0 -33
- data/dist/ice/cpp/include/Ice/ThreadPoolF.h +0 -23
- data/dist/ice/cpp/include/Ice/UniquePtr.h +0 -95
- data/dist/ice/cpp/include/Ice/UniqueRef.h +0 -97
- data/dist/ice/cpp/include/IceSSL/Config.h +0 -21
- data/dist/ice/cpp/include/IceSSL/IceSSL.h +0 -24
- data/dist/ice/cpp/include/IceSSL/OpenSSL.h +0 -147
- data/dist/ice/cpp/include/IceSSL/Plugin.h +0 -712
- data/dist/ice/cpp/include/IceSSL/SChannel.h +0 -72
- data/dist/ice/cpp/include/IceSSL/SecureTransport.h +0 -72
- data/dist/ice/cpp/include/IceUtil/Atomic.h +0 -179
- data/dist/ice/cpp/include/IceUtil/Cond.h +0 -317
- data/dist/ice/cpp/include/IceUtil/Config.h +0 -392
- data/dist/ice/cpp/include/IceUtil/ConsoleUtil.h +0 -92
- data/dist/ice/cpp/include/IceUtil/CountDownLatch.h +0 -45
- data/dist/ice/cpp/include/IceUtil/CtrlCHandler.h +0 -96
- data/dist/ice/cpp/include/IceUtil/DisableWarnings.h +0 -44
- data/dist/ice/cpp/include/IceUtil/Exception.h +0 -394
- data/dist/ice/cpp/include/IceUtil/FileUtil.h +0 -140
- data/dist/ice/cpp/include/IceUtil/Functional.h +0 -389
- data/dist/ice/cpp/include/IceUtil/Handle.h +0 -261
- data/dist/ice/cpp/include/IceUtil/IceUtil.h +0 -40
- data/dist/ice/cpp/include/IceUtil/InputUtil.h +0 -42
- data/dist/ice/cpp/include/IceUtil/Iterator.h +0 -31
- data/dist/ice/cpp/include/IceUtil/Lock.h +0 -128
- data/dist/ice/cpp/include/IceUtil/Monitor.h +0 -243
- data/dist/ice/cpp/include/IceUtil/Mutex.h +0 -349
- data/dist/ice/cpp/include/IceUtil/MutexProtocol.h +0 -23
- data/dist/ice/cpp/include/IceUtil/MutexPtrLock.h +0 -78
- data/dist/ice/cpp/include/IceUtil/MutexPtrTryLock.h +0 -77
- data/dist/ice/cpp/include/IceUtil/Optional.h +0 -433
- data/dist/ice/cpp/include/IceUtil/Options.h +0 -135
- data/dist/ice/cpp/include/IceUtil/OutputUtil.h +0 -383
- data/dist/ice/cpp/include/IceUtil/PushDisableWarnings.h +0 -33
- data/dist/ice/cpp/include/IceUtil/Random.h +0 -55
- data/dist/ice/cpp/include/IceUtil/RecMutex.h +0 -107
- data/dist/ice/cpp/include/IceUtil/ResourceConfig.h +0 -37
- data/dist/ice/cpp/include/IceUtil/ScannerConfig.h +0 -40
- data/dist/ice/cpp/include/IceUtil/ScopedArray.h +0 -98
- data/dist/ice/cpp/include/IceUtil/Shared.h +0 -127
- data/dist/ice/cpp/include/IceUtil/StopWatch.h +0 -49
- data/dist/ice/cpp/include/IceUtil/StringConverter.h +0 -195
- data/dist/ice/cpp/include/IceUtil/StringUtil.h +0 -97
- data/dist/ice/cpp/include/IceUtil/Thread.h +0 -160
- data/dist/ice/cpp/include/IceUtil/ThreadException.h +0 -94
- data/dist/ice/cpp/include/IceUtil/Time.h +0 -205
- data/dist/ice/cpp/include/IceUtil/Timer.h +0 -153
- data/dist/ice/cpp/include/IceUtil/UUID.h +0 -21
- data/dist/ice/cpp/include/generated/Glacier2/Metrics.h +0 -475
- data/dist/ice/cpp/include/generated/Glacier2/PermissionsVerifier.h +0 -1430
- data/dist/ice/cpp/include/generated/Glacier2/PermissionsVerifierF.h +0 -147
- data/dist/ice/cpp/include/generated/Glacier2/Router.h +0 -3260
- data/dist/ice/cpp/include/generated/Glacier2/RouterF.h +0 -125
- data/dist/ice/cpp/include/generated/Glacier2/SSLInfo.h +0 -223
- data/dist/ice/cpp/include/generated/Glacier2/Session.h +0 -5894
- data/dist/ice/cpp/include/generated/Ice/Communicator.h +0 -1162
- data/dist/ice/cpp/include/generated/Ice/CommunicatorF.h +0 -101
- data/dist/ice/cpp/include/generated/Ice/Connection.h +0 -1703
- data/dist/ice/cpp/include/generated/Ice/ConnectionF.h +0 -119
- data/dist/ice/cpp/include/generated/Ice/Current.h +0 -322
- data/dist/ice/cpp/include/generated/Ice/Endpoint.h +0 -979
- data/dist/ice/cpp/include/generated/Ice/EndpointF.h +0 -166
- data/dist/ice/cpp/include/generated/Ice/FacetMap.h +0 -80
- data/dist/ice/cpp/include/generated/Ice/ImplicitContext.h +0 -284
- data/dist/ice/cpp/include/generated/Ice/ImplicitContextF.h +0 -101
- data/dist/ice/cpp/include/generated/Ice/Instrumentation.h +0 -1203
- data/dist/ice/cpp/include/generated/Ice/InstrumentationF.h +0 -128
- data/dist/ice/cpp/include/generated/Ice/LocalException.h +0 -7437
- data/dist/ice/cpp/include/generated/Ice/LocatorF.h +0 -147
- data/dist/ice/cpp/include/generated/Ice/Logger.h +0 -237
- data/dist/ice/cpp/include/generated/Ice/LoggerF.h +0 -101
- data/dist/ice/cpp/include/generated/Ice/ObjectAdapter.h +0 -1181
- data/dist/ice/cpp/include/generated/Ice/ObjectAdapterF.h +0 -101
- data/dist/ice/cpp/include/generated/Ice/ObjectFactory.h +0 -203
- data/dist/ice/cpp/include/generated/Ice/Plugin.h +0 -318
- data/dist/ice/cpp/include/generated/Ice/PluginF.h +0 -110
- data/dist/ice/cpp/include/generated/Ice/ProcessF.h +0 -125
- data/dist/ice/cpp/include/generated/Ice/Properties.h +0 -452
- data/dist/ice/cpp/include/generated/Ice/PropertiesF.h +0 -134
- data/dist/ice/cpp/include/generated/Ice/RouterF.h +0 -125
- data/dist/ice/cpp/include/generated/Ice/ServantLocator.h +0 -305
- data/dist/ice/cpp/include/generated/Ice/ServantLocatorF.h +0 -101
- data/dist/ice/cpp/include/generated/Ice/ValueFactory.h +0 -330
- data/dist/ice/cpp/include/generated/IceBox/IceBox.h +0 -3269
- data/dist/ice/cpp/include/generated/IceGrid/Admin.h +0 -33773
- data/dist/ice/cpp/include/generated/IceGrid/Descriptor.h +0 -5254
- data/dist/ice/cpp/include/generated/IceGrid/Exception.h +0 -2834
- data/dist/ice/cpp/include/generated/IceGrid/FileParser.h +0 -824
- data/dist/ice/cpp/include/generated/IceGrid/PluginFacade.h +0 -635
- data/dist/ice/cpp/include/generated/IceGrid/Registry.h +0 -5089
- data/dist/ice/cpp/include/generated/IceGrid/Session.h +0 -2240
- data/dist/ice/cpp/include/generated/IceGrid/UserAccountMapper.h +0 -800
- data/dist/ice/cpp/include/generated/IcePatch2/FileInfo.h +0 -325
- data/dist/ice/cpp/include/generated/IcePatch2/FileServer.h +0 -2891
- data/dist/ice/cpp/include/generated/IceSSL/ConnectionInfo.h +0 -228
- data/dist/ice/cpp/include/generated/IceSSL/ConnectionInfoF.h +0 -101
- data/dist/ice/cpp/include/generated/IceSSL/EndpointInfo.h +0 -186
- data/dist/ice/cpp/include/generated/IceStorm/IceStorm.h +0 -6627
- data/dist/ice/cpp/include/generated/IceStorm/Metrics.h +0 -665
- data/dist/ice/cpp/src/Ice/ACM.cpp +0 -380
- data/dist/ice/cpp/src/Ice/ACM.h +0 -119
- data/dist/ice/cpp/src/Ice/ACMF.h +0 -30
- data/dist/ice/cpp/src/Ice/Acceptor.cpp +0 -16
- data/dist/ice/cpp/src/Ice/Application.cpp +0 -661
- data/dist/ice/cpp/src/Ice/AsyncResult.cpp +0 -70
- data/dist/ice/cpp/src/Ice/CommunicatorI.cpp +0 -586
- data/dist/ice/cpp/src/Ice/CommunicatorI.h +0 -167
- data/dist/ice/cpp/src/Ice/Cond.cpp +0 -381
- data/dist/ice/cpp/src/Ice/ConnectionRequestHandler.cpp +0 -73
- data/dist/ice/cpp/src/Ice/ConnectionRequestHandler.h +0 -41
- data/dist/ice/cpp/src/Ice/Connector.cpp +0 -16
- data/dist/ice/cpp/src/Ice/CountDownLatch.cpp +0 -171
- data/dist/ice/cpp/src/Ice/DispatchInterceptor.cpp +0 -37
- data/dist/ice/cpp/src/Ice/FactoryTable.cpp +0 -162
- data/dist/ice/cpp/src/Ice/FactoryTableInit.cpp +0 -88
- data/dist/ice/cpp/src/Ice/GCObject.cpp +0 -442
- data/dist/ice/cpp/src/Ice/IconvStringConverter.cpp +0 -51
- data/dist/ice/cpp/src/Ice/ImplicitContextI.cpp +0 -655
- data/dist/ice/cpp/src/Ice/ImplicitContextI.h +0 -48
- data/dist/ice/cpp/src/Ice/Incoming.cpp +0 -795
- data/dist/ice/cpp/src/Ice/IncomingAsync.cpp +0 -230
- data/dist/ice/cpp/src/Ice/IncomingRequest.h +0 -33
- data/dist/ice/cpp/src/Ice/LocalObject.cpp +0 -23
- data/dist/ice/cpp/src/Ice/MetricsObserverI.cpp +0 -8
- data/dist/ice/cpp/src/Ice/PropertiesAdminI.cpp +0 -265
- data/dist/ice/cpp/src/Ice/PropertiesAdminI.h +0 -64
- data/dist/ice/cpp/src/Ice/PropertiesI.cpp +0 -739
- data/dist/ice/cpp/src/Ice/PropertiesI.h +0 -70
- data/dist/ice/cpp/src/Ice/ProtocolPluginFacadeF.h +0 -21
- data/dist/ice/cpp/src/Ice/ProxyFactory.cpp +0 -300
- data/dist/ice/cpp/src/Ice/ProxyFactory.h +0 -57
- data/dist/ice/cpp/src/Ice/RegisterPluginsInit.cpp +0 -38
- data/dist/ice/cpp/src/Ice/RegisterPluginsInit.h +0 -20
- data/dist/ice/cpp/src/Ice/ReplyStatus.h +0 -24
- data/dist/ice/cpp/src/Ice/RequestHandlerFactory.cpp +0 -77
- data/dist/ice/cpp/src/Ice/RequestHandlerFactory.h +0 -37
- data/dist/ice/cpp/src/Ice/ResponseHandler.cpp +0 -12
- data/dist/ice/cpp/src/Ice/ResponseHandler.h +0 -43
- data/dist/ice/cpp/src/Ice/SliceChecksums.cpp +0 -75
- data/dist/ice/cpp/src/Ice/StringConverterPlugin.cpp +0 -192
- data/dist/ice/cpp/src/Ice/StringUtil.h +0 -30
- data/dist/ice/cpp/src/Ice/Thread.cpp +0 -569
- data/dist/ice/cpp/src/Ice/ValueFactoryManagerI.cpp +0 -61
- data/dist/ice/cpp/src/Ice/ValueFactoryManagerI.h +0 -37
- data/dist/ice/cpp/src/Ice/VirtualShared.h +0 -38
- data/dist/ice/cpp/src/Ice/generated/Communicator.cpp +0 -79
- data/dist/ice/cpp/src/Ice/generated/CommunicatorF.cpp +0 -61
- data/dist/ice/cpp/src/Ice/generated/Connection.cpp +0 -155
- data/dist/ice/cpp/src/Ice/generated/ConnectionF.cpp +0 -61
- data/dist/ice/cpp/src/Ice/generated/Current.cpp +0 -62
- data/dist/ice/cpp/src/Ice/generated/Endpoint.cpp +0 -147
- data/dist/ice/cpp/src/Ice/generated/EndpointF.cpp +0 -61
- data/dist/ice/cpp/src/Ice/generated/FacetMap.cpp +0 -49
- data/dist/ice/cpp/src/Ice/generated/ImplicitContext.cpp +0 -75
- data/dist/ice/cpp/src/Ice/generated/ImplicitContextF.cpp +0 -61
- data/dist/ice/cpp/src/Ice/generated/Instrumentation.cpp +0 -188
- data/dist/ice/cpp/src/Ice/generated/InstrumentationF.cpp +0 -66
- data/dist/ice/cpp/src/Ice/generated/LocalException.cpp +0 -3262
- data/dist/ice/cpp/src/Ice/generated/LocatorF.cpp +0 -63
- data/dist/ice/cpp/src/Ice/generated/Logger.cpp +0 -73
- data/dist/ice/cpp/src/Ice/generated/LoggerF.cpp +0 -61
- data/dist/ice/cpp/src/Ice/generated/ObjectAdapter.cpp +0 -79
- data/dist/ice/cpp/src/Ice/generated/ObjectAdapterF.cpp +0 -61
- data/dist/ice/cpp/src/Ice/generated/ObjectFactory.cpp +0 -75
- data/dist/ice/cpp/src/Ice/generated/Plugin.cpp +0 -87
- data/dist/ice/cpp/src/Ice/generated/PluginF.cpp +0 -61
- data/dist/ice/cpp/src/Ice/generated/ProcessF.cpp +0 -63
- data/dist/ice/cpp/src/Ice/generated/Properties.cpp +0 -78
- data/dist/ice/cpp/src/Ice/generated/PropertiesF.cpp +0 -63
- data/dist/ice/cpp/src/Ice/generated/RouterF.cpp +0 -63
- data/dist/ice/cpp/src/Ice/generated/ServantLocator.cpp +0 -75
- data/dist/ice/cpp/src/Ice/generated/ServantLocatorF.cpp +0 -61
- data/dist/ice/cpp/src/Ice/generated/ValueFactory.cpp +0 -83
- data/dist/ice/cpp/src/Ice/ios/StreamAcceptor.cpp +0 -154
- data/dist/ice/cpp/src/Ice/ios/StreamAcceptor.h +0 -49
- data/dist/ice/cpp/src/Ice/ios/StreamConnector.cpp +0 -146
- data/dist/ice/cpp/src/Ice/ios/StreamConnector.h +0 -52
- data/dist/ice/cpp/src/Ice/ios/StreamEndpointI.cpp +0 -477
- data/dist/ice/cpp/src/Ice/ios/StreamEndpointI.h +0 -156
- data/dist/ice/cpp/src/Ice/ios/StreamTransceiver.cpp +0 -570
- data/dist/ice/cpp/src/Ice/ios/StreamTransceiver.h +0 -93
- data/dist/ice/cpp/src/IceDiscovery/generated/IceDiscovery/IceDiscovery.h +0 -1889
- data/dist/ice/cpp/src/IceDiscovery/generated/IceDiscovery.cpp +0 -915
- data/dist/ice/cpp/src/IceLocatorDiscovery/generated/IceLocatorDiscovery/IceLocatorDiscovery.h +0 -1197
- data/dist/ice/cpp/src/IceLocatorDiscovery/generated/IceLocatorDiscovery.cpp +0 -730
- data/dist/ice/cpp/src/IceSSL/AcceptorI.cpp +0 -105
- data/dist/ice/cpp/src/IceSSL/AcceptorI.h +0 -52
- data/dist/ice/cpp/src/IceSSL/CertificateI.cpp +0 -301
- data/dist/ice/cpp/src/IceSSL/CertificateI.h +0 -64
- data/dist/ice/cpp/src/IceSSL/ConnectorI.cpp +0 -102
- data/dist/ice/cpp/src/IceSSL/ConnectorI.h +0 -44
- data/dist/ice/cpp/src/IceSSL/EndpointI.cpp +0 -372
- data/dist/ice/cpp/src/IceSSL/EndpointI.h +0 -100
- data/dist/ice/cpp/src/IceSSL/Instance.cpp +0 -28
- data/dist/ice/cpp/src/IceSSL/Instance.h +0 -37
- data/dist/ice/cpp/src/IceSSL/InstanceF.h +0 -33
- data/dist/ice/cpp/src/IceSSL/OpenSSLCertificateI.cpp +0 -688
- data/dist/ice/cpp/src/IceSSL/OpenSSLEngine.cpp +0 -1147
- data/dist/ice/cpp/src/IceSSL/OpenSSLEngine.h +0 -59
- data/dist/ice/cpp/src/IceSSL/OpenSSLEngineF.h +0 -27
- data/dist/ice/cpp/src/IceSSL/OpenSSLPluginI.cpp +0 -127
- data/dist/ice/cpp/src/IceSSL/OpenSSLTransceiverI.cpp +0 -1092
- data/dist/ice/cpp/src/IceSSL/OpenSSLTransceiverI.h +0 -90
- data/dist/ice/cpp/src/IceSSL/OpenSSLUtil.cpp +0 -288
- data/dist/ice/cpp/src/IceSSL/OpenSSLUtil.h +0 -58
- data/dist/ice/cpp/src/IceSSL/PluginI.cpp +0 -246
- data/dist/ice/cpp/src/IceSSL/PluginI.h +0 -67
- data/dist/ice/cpp/src/IceSSL/RFC2253.h +0 -62
- data/dist/ice/cpp/src/IceSSL/SChannelCertificateI.cpp +0 -721
- data/dist/ice/cpp/src/IceSSL/SChannelEngine.cpp +0 -1283
- data/dist/ice/cpp/src/IceSSL/SChannelEngine.h +0 -123
- data/dist/ice/cpp/src/IceSSL/SChannelEngineF.h +0 -31
- data/dist/ice/cpp/src/IceSSL/SChannelPluginI.cpp +0 -73
- data/dist/ice/cpp/src/IceSSL/SChannelTransceiverI.cpp +0 -1174
- data/dist/ice/cpp/src/IceSSL/SChannelTransceiverI.h +0 -133
- data/dist/ice/cpp/src/IceSSL/SSLEngine.cpp +0 -313
- data/dist/ice/cpp/src/IceSSL/SSLEngine.h +0 -100
- data/dist/ice/cpp/src/IceSSL/SSLEngineF.h +0 -21
- data/dist/ice/cpp/src/IceSSL/SecureTransportCertificateI.cpp +0 -999
- data/dist/ice/cpp/src/IceSSL/SecureTransportEngine.cpp +0 -1308
- data/dist/ice/cpp/src/IceSSL/SecureTransportEngine.h +0 -59
- data/dist/ice/cpp/src/IceSSL/SecureTransportEngineF.h +0 -29
- data/dist/ice/cpp/src/IceSSL/SecureTransportPluginI.cpp +0 -75
- data/dist/ice/cpp/src/IceSSL/SecureTransportTransceiverI.cpp +0 -719
- data/dist/ice/cpp/src/IceSSL/SecureTransportTransceiverI.h +0 -92
- data/dist/ice/cpp/src/IceSSL/SecureTransportUtil.cpp +0 -868
- data/dist/ice/cpp/src/IceSSL/SecureTransportUtil.h +0 -45
- data/dist/ice/cpp/src/IceSSL/TrustManager.cpp +0 -236
- data/dist/ice/cpp/src/IceSSL/TrustManager.h +0 -46
- data/dist/ice/cpp/src/IceSSL/TrustManagerF.h +0 -21
- data/dist/ice/cpp/src/IceSSL/Util.cpp +0 -192
- data/dist/ice/cpp/src/IceSSL/Util.h +0 -99
- data/dist/ice/cpp/src/IceSSL/generated/ConnectionInfo.cpp +0 -75
- data/dist/ice/cpp/src/IceSSL/generated/ConnectionInfoF.cpp +0 -61
- data/dist/ice/cpp/src/IceSSL/generated/EndpointInfo.cpp +0 -75
- data/dist/ice/cpp/src/IceUtil/ConvertUTF.cpp +0 -472
- data/dist/ice/cpp/src/IceUtil/ConvertUTF.h +0 -147
- data/dist/ice/cpp/src/IceUtil/CtrlCHandler.cpp +0 -259
- data/dist/ice/cpp/src/IceUtil/FileUtil.cpp +0 -471
- data/dist/ice/cpp/src/IceUtil/InputUtil.cpp +0 -36
- data/dist/ice/cpp/src/IceUtil/MutexProtocol.cpp +0 -19
- data/dist/ice/cpp/src/IceUtil/OutputUtil.cpp +0 -609
- data/dist/ice/cpp/src/IceUtil/Random.cpp +0 -180
- data/dist/ice/cpp/src/IceUtil/RecMutex.cpp +0 -238
- data/dist/ice/cpp/src/IceUtil/Shared.cpp +0 -71
- data/dist/ice/cpp/src/IceUtil/StringConverter.cpp +0 -690
- data/dist/ice/cpp/src/IceUtil/StringUtil.cpp +0 -1135
- data/dist/ice/cpp/src/IceUtil/ThreadException.cpp +0 -130
- data/dist/ice/cpp/src/IceUtil/Time.cpp +0 -307
- data/dist/ice/cpp/src/IceUtil/UUID.cpp +0 -165
- data/dist/ice/cpp/src/IceUtil/Unicode.cpp +0 -183
- data/dist/ice/cpp/src/IceUtil/Unicode.h +0 -43
- data/dist/ice/cpp/src/IceUtil/UtilException.cpp +0 -839
- data/dist/ice/cpp/src/Slice/CPlusPlusUtil.cpp +0 -1810
- data/dist/ice/cpp/src/Slice/CPlusPlusUtil.h +0 -72
- data/dist/ice/cpp/src/Slice/Checksum.cpp +0 -447
- data/dist/ice/cpp/src/Slice/Checksum.h +0 -21
- data/dist/ice/cpp/src/Slice/JavaUtil.cpp +0 -5183
- data/dist/ice/cpp/src/Slice/JavaUtil.h +0 -407
- data/dist/ice/cpp/src/Slice/MD5.cpp +0 -52
- data/dist/ice/cpp/src/Slice/MD5.h +0 -39
- data/dist/ice/cpp/src/Slice/MD5I.cpp +0 -393
- data/dist/ice/cpp/src/Slice/MD5I.h +0 -91
- data/dist/ice/cpp/src/Slice/PHPUtil.cpp +0 -157
- data/dist/ice/cpp/src/Slice/PHPUtil.h +0 -36
- data/dist/ice/cpp/src/Slice/Python.cpp +0 -830
- data/dist/ice/cpp/src/Slice/PythonUtil.cpp +0 -3439
- data/dist/ice/cpp/src/Slice/PythonUtil.h +0 -70
- data/dist/ice/cpp/src/Slice/Ruby.cpp +0 -350
- data/dist/ice/cpp/src/Slice/RubyUtil.cpp +0 -1571
- data/dist/ice/cpp/src/Slice/RubyUtil.h +0 -49
- data/dist/ice/slice/Glacier2/PermissionsVerifierF.ice +0 -30
- data/dist/ice/slice/Glacier2/RouterF.ice +0 -29
- data/dist/ice/slice/Ice/Communicator.ice +0 -676
- data/dist/ice/slice/Ice/CommunicatorF.ice +0 -31
- data/dist/ice/slice/Ice/Connection.ice +0 -516
- data/dist/ice/slice/Ice/ConnectionF.ice +0 -33
- data/dist/ice/slice/Ice/Current.ice +0 -170
- data/dist/ice/slice/Ice/Endpoint.ice +0 -291
- data/dist/ice/slice/Ice/EndpointF.ice +0 -43
- data/dist/ice/slice/Ice/FacetMap.ice +0 -36
- data/dist/ice/slice/Ice/ImplicitContext.ice +0 -119
- data/dist/ice/slice/Ice/ImplicitContextF.ice +0 -30
- data/dist/ice/slice/Ice/Instrumentation.ice +0 -509
- data/dist/ice/slice/Ice/InstrumentationF.ice +0 -38
- data/dist/ice/slice/Ice/LocalException.ice +0 -1040
- data/dist/ice/slice/Ice/LocatorF.ice +0 -32
- data/dist/ice/slice/Ice/Logger.ice +0 -99
- data/dist/ice/slice/Ice/LoggerF.ice +0 -31
- data/dist/ice/slice/Ice/ObjectAdapter.ice +0 -710
- data/dist/ice/slice/Ice/ObjectAdapterF.ice +0 -31
- data/dist/ice/slice/Ice/ObjectFactory.ice +0 -71
- data/dist/ice/slice/Ice/Plugin.ice +0 -131
- data/dist/ice/slice/Ice/PluginF.ice +0 -36
- data/dist/ice/slice/Ice/ProcessF.ice +0 -31
- data/dist/ice/slice/Ice/Properties.ice +0 -244
- data/dist/ice/slice/Ice/PropertiesF.ice +0 -32
- data/dist/ice/slice/Ice/RouterF.ice +0 -31
- data/dist/ice/slice/Ice/ServantLocator.ice +0 -136
- data/dist/ice/slice/Ice/ServantLocatorF.ice +0 -31
- data/dist/ice/slice/Ice/ValueFactory.ice +0 -133
- data/dist/ice/slice/IceBox/IceBox.ice +0 -216
- data/dist/ice/slice/IceGrid/PluginFacade.ice +0 -329
- data/dist/ice/slice/IcePatch2/FileInfo.ice +0 -85
- data/dist/ice/slice/IcePatch2/FileServer.ice +0 -191
- data/dist/lib/Glacier2/PermissionsVerifierF.rb +0 -30
- data/dist/lib/Glacier2/RouterF.rb +0 -25
- data/dist/lib/Ice/Communicator.rb +0 -87
- data/dist/lib/Ice/CommunicatorF.rb +0 -24
- data/dist/lib/Ice/Connection.rb +0 -413
- data/dist/lib/Ice/ConnectionF.rb +0 -32
- data/dist/lib/Ice/Current.rb +0 -141
- data/dist/lib/Ice/Endpoint.rb +0 -187
- data/dist/lib/Ice/EndpointF.rb +0 -48
- data/dist/lib/Ice/FacetMap.rb +0 -24
- data/dist/lib/Ice/ImplicitContext.rb +0 -26
- data/dist/lib/Ice/ImplicitContextF.rb +0 -24
- data/dist/lib/Ice/Instrumentation.rb +0 -169
- data/dist/lib/Ice/InstrumentationF.rb +0 -31
- data/dist/lib/Ice/LocalException.rb +0 -1031
- data/dist/lib/Ice/LocatorF.rb +0 -30
- data/dist/lib/Ice/Logger.rb +0 -24
- data/dist/lib/Ice/LoggerF.rb +0 -24
- data/dist/lib/Ice/ObjectAdapter.rb +0 -29
- data/dist/lib/Ice/ObjectAdapterF.rb +0 -24
- data/dist/lib/Ice/ObjectFactory.rb +0 -24
- data/dist/lib/Ice/Plugin.rb +0 -30
- data/dist/lib/Ice/PluginF.rb +0 -28
- data/dist/lib/Ice/ProcessF.rb +0 -25
- data/dist/lib/Ice/Properties.rb +0 -25
- data/dist/lib/Ice/PropertiesF.rb +0 -29
- data/dist/lib/Ice/RouterF.rb +0 -25
- data/dist/lib/Ice/ServantLocator.rb +0 -26
- data/dist/lib/Ice/ServantLocatorF.rb +0 -24
- data/dist/lib/Ice/ValueFactory.rb +0 -28
- data/dist/lib/IceBox/IceBox.rb +0 -164
- data/dist/lib/IceGrid/PluginFacade.rb +0 -35
- data/dist/lib/IcePatch2/FileInfo.rb +0 -115
- data/dist/lib/IcePatch2/FileServer.rb +0 -123
- data/dist/lib/IcePatch2.rb +0 -5
|
@@ -1,54 +1,43 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright (c) ZeroC, Inc. All rights reserved.
|
|
3
|
-
//
|
|
1
|
+
// Copyright (c) ZeroC, Inc.
|
|
4
2
|
|
|
5
|
-
#include
|
|
6
|
-
#include
|
|
7
|
-
#include
|
|
8
|
-
#include
|
|
9
|
-
#include
|
|
10
|
-
#include <Ice/ArgVector.h>
|
|
11
|
-
#include <IceUtil/FileUtil.h>
|
|
12
|
-
#include <Ice/ConsoleUtil.h>
|
|
13
|
-
#include <Ice/StringConverter.h>
|
|
14
|
-
#include <Ice/Service.h>
|
|
15
|
-
#include <Ice/LoggerI.h>
|
|
16
|
-
#include <Ice/Initialize.h>
|
|
17
|
-
#include <Ice/Communicator.h>
|
|
18
|
-
#include <Ice/LocalException.h>
|
|
19
|
-
#include <Ice/Properties.h>
|
|
20
|
-
#include <Ice/Instance.h>
|
|
21
|
-
#include <Ice/LoggerUtil.h>
|
|
3
|
+
#include "Ice/Service.h"
|
|
4
|
+
#include "ArgVector.h"
|
|
5
|
+
#include "ConsoleUtil.h"
|
|
6
|
+
#include "Ice/StringUtil.h"
|
|
7
|
+
#include "LoggerI.h"
|
|
22
8
|
|
|
23
9
|
#ifdef _WIN32
|
|
24
|
-
#
|
|
25
|
-
#
|
|
10
|
+
# include "Ice/EventLoggerMsg.h"
|
|
11
|
+
# include <winsock2.h>
|
|
26
12
|
#else
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
#
|
|
30
|
-
#
|
|
31
|
-
#
|
|
32
|
-
#
|
|
33
|
-
#
|
|
34
|
-
# endif
|
|
13
|
+
# include "Network.h"
|
|
14
|
+
# include <csignal>
|
|
15
|
+
# include <sys/stat.h>
|
|
16
|
+
# include <sys/types.h>
|
|
17
|
+
# ifdef ICE_USE_SYSTEMD
|
|
18
|
+
# include <systemd/sd-daemon.h>
|
|
19
|
+
# endif
|
|
35
20
|
#endif
|
|
36
21
|
|
|
37
22
|
using namespace std;
|
|
38
23
|
using namespace Ice;
|
|
39
24
|
using namespace IceInternal;
|
|
40
25
|
|
|
41
|
-
Ice::Service* Ice::Service::_instance =
|
|
42
|
-
|
|
26
|
+
Ice::Service* Ice::Service::_instance = nullptr;
|
|
27
|
+
|
|
28
|
+
namespace
|
|
29
|
+
{
|
|
30
|
+
CtrlCHandler* ctrlCHandler = nullptr;
|
|
31
|
+
}
|
|
43
32
|
|
|
44
33
|
//
|
|
45
|
-
// Callback for
|
|
34
|
+
// Callback for CtrlCHandler.
|
|
46
35
|
//
|
|
47
36
|
static void
|
|
48
37
|
ctrlCHandlerCallback(int sig)
|
|
49
38
|
{
|
|
50
39
|
Ice::Service* service = Ice::Service::instance();
|
|
51
|
-
assert(service !=
|
|
40
|
+
assert(service != nullptr);
|
|
52
41
|
service->handleInterrupt(sig);
|
|
53
42
|
}
|
|
54
43
|
|
|
@@ -78,444 +67,392 @@ Ice_Service_CtrlHandler(DWORD ctrl)
|
|
|
78
67
|
|
|
79
68
|
namespace
|
|
80
69
|
{
|
|
70
|
+
class ServiceStatusManager
|
|
71
|
+
{
|
|
72
|
+
public:
|
|
73
|
+
ServiceStatusManager(SERVICE_STATUS_HANDLE);
|
|
81
74
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
75
|
+
//
|
|
76
|
+
// Start a thread to provide regular status updates to the SCM.
|
|
77
|
+
//
|
|
78
|
+
void startUpdate(DWORD);
|
|
85
79
|
|
|
86
|
-
|
|
80
|
+
//
|
|
81
|
+
// Stop the update thread.
|
|
82
|
+
//
|
|
83
|
+
void stopUpdate();
|
|
87
84
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
//
|
|
86
|
+
// Change the service status and report it (once).
|
|
87
|
+
//
|
|
88
|
+
void changeStatus(DWORD, DWORD);
|
|
92
89
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
//
|
|
91
|
+
// Report the current status.
|
|
92
|
+
//
|
|
93
|
+
void reportStatus();
|
|
97
94
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
95
|
+
private:
|
|
96
|
+
void run();
|
|
97
|
+
|
|
98
|
+
SERVICE_STATUS_HANDLE _handle;
|
|
99
|
+
SERVICE_STATUS _status;
|
|
100
|
+
std::thread _thread;
|
|
101
|
+
bool _stopped;
|
|
102
|
+
std::mutex _mutex;
|
|
103
|
+
std::condition_variable _conditionVariable;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
static ServiceStatusManager* serviceStatusManager;
|
|
102
107
|
|
|
103
108
|
//
|
|
104
|
-
//
|
|
109
|
+
// Interface implemented by SMEventLoggerI and called from
|
|
110
|
+
// SMEventLoggerIWrapper.
|
|
105
111
|
//
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
private:
|
|
109
|
-
|
|
110
|
-
void run();
|
|
111
|
-
|
|
112
|
-
class StatusThread : public IceUtil::Thread
|
|
112
|
+
class SMEventLogger
|
|
113
113
|
{
|
|
114
114
|
public:
|
|
115
|
+
virtual void print(const string&, const string&) = 0;
|
|
116
|
+
virtual void trace(const string&, const string&, const string&) = 0;
|
|
117
|
+
virtual void warning(const string&, const string&) = 0;
|
|
118
|
+
virtual void error(const string&, const string&) = 0;
|
|
119
|
+
};
|
|
120
|
+
using SMEventLoggerPtr = std::shared_ptr<SMEventLogger>;
|
|
115
121
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
virtual void run()
|
|
122
|
+
class SMEventLoggerIWrapper final : public Ice::Logger
|
|
123
|
+
{
|
|
124
|
+
public:
|
|
125
|
+
SMEventLoggerIWrapper(const SMEventLoggerPtr& logger, string prefix)
|
|
126
|
+
: _logger(logger),
|
|
127
|
+
_prefix(std::move(prefix))
|
|
123
128
|
{
|
|
124
|
-
|
|
129
|
+
assert(_logger);
|
|
125
130
|
}
|
|
126
131
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
ServiceStatusManager* _manager;
|
|
130
|
-
};
|
|
131
|
-
friend class StatusThread;
|
|
132
|
-
|
|
133
|
-
SERVICE_STATUS_HANDLE _handle;
|
|
134
|
-
SERVICE_STATUS _status;
|
|
135
|
-
IceUtil::ThreadPtr _thread;
|
|
136
|
-
bool _stopped;
|
|
137
|
-
};
|
|
132
|
+
void print(const string& message) final { _logger->print(_prefix, message); }
|
|
138
133
|
|
|
139
|
-
|
|
134
|
+
void trace(const string& category, const string& message) final { _logger->trace(_prefix, category, message); }
|
|
140
135
|
|
|
141
|
-
|
|
142
|
-
// Interface implemented by SMEventLoggerI and called from
|
|
143
|
-
// SMEventLoggerIWrapper.
|
|
144
|
-
//
|
|
145
|
-
class SMEventLogger : public IceUtil::Shared
|
|
146
|
-
{
|
|
147
|
-
public:
|
|
148
|
-
virtual void print(const string&, const string&) = 0;
|
|
149
|
-
virtual void trace(const string&, const string&, const string&) = 0;
|
|
150
|
-
virtual void warning(const string&, const string&) = 0;
|
|
151
|
-
virtual void error(const string&, const string&) = 0;
|
|
152
|
-
};
|
|
153
|
-
typedef IceUtil::Handle<SMEventLogger> SMEventLoggerPtr;
|
|
154
|
-
|
|
155
|
-
class SMEventLoggerIWrapper : public Ice::Logger
|
|
156
|
-
{
|
|
157
|
-
public:
|
|
136
|
+
void warning(const string& message) final { _logger->warning(_prefix, message); }
|
|
158
137
|
|
|
159
|
-
|
|
160
|
-
_logger(logger),
|
|
161
|
-
_prefix(prefix)
|
|
162
|
-
{
|
|
163
|
-
assert(_logger);
|
|
164
|
-
}
|
|
138
|
+
void error(const string& message) final { _logger->error(_prefix, message); }
|
|
165
139
|
|
|
166
|
-
|
|
167
|
-
print(const string& message)
|
|
168
|
-
{
|
|
169
|
-
_logger->print(_prefix, message);
|
|
170
|
-
}
|
|
140
|
+
string getPrefix() final { return _prefix; }
|
|
171
141
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
virtual void
|
|
179
|
-
warning(const string& message)
|
|
180
|
-
{
|
|
181
|
-
_logger->warning(_prefix, message);
|
|
182
|
-
}
|
|
142
|
+
Ice::LoggerPtr cloneWithPrefix(string prefix) final
|
|
143
|
+
{
|
|
144
|
+
return make_shared<SMEventLoggerIWrapper>(_logger, std::move(prefix));
|
|
145
|
+
}
|
|
183
146
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
147
|
+
private:
|
|
148
|
+
SMEventLoggerPtr _logger;
|
|
149
|
+
const string _prefix;
|
|
150
|
+
};
|
|
189
151
|
|
|
190
|
-
|
|
191
|
-
getPrefix()
|
|
152
|
+
class SMEventLoggerI : public SMEventLogger
|
|
192
153
|
{
|
|
193
|
-
|
|
194
|
-
|
|
154
|
+
public:
|
|
155
|
+
SMEventLoggerI(const string& source, const StringConverterPtr& stringConverter)
|
|
156
|
+
: _stringConverter(stringConverter)
|
|
157
|
+
{
|
|
158
|
+
//
|
|
159
|
+
// Don't need to use a wide string converter as the wide string is passed
|
|
160
|
+
// to Windows API.
|
|
161
|
+
//
|
|
162
|
+
_source = RegisterEventSourceW(0, stringToWstring(mangleSource(source), _stringConverter).c_str());
|
|
163
|
+
if (_source == 0)
|
|
164
|
+
{
|
|
165
|
+
throw SyscallException{__FILE__, __LINE__, "RegisterEventSourceW failed", GetLastError()};
|
|
166
|
+
}
|
|
167
|
+
}
|
|
195
168
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
169
|
+
~SMEventLoggerI()
|
|
170
|
+
{
|
|
171
|
+
assert(_source != 0);
|
|
172
|
+
DeregisterEventSource(_source);
|
|
173
|
+
}
|
|
201
174
|
|
|
202
|
-
|
|
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
|
+
}
|
|
203
198
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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
|
+
}
|
|
207
210
|
|
|
208
|
-
|
|
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
|
+
}
|
|
211
244
|
|
|
212
|
-
|
|
213
|
-
_stringConverter(stringConverter)
|
|
214
|
-
{
|
|
215
|
-
//
|
|
216
|
-
// Don't need to use a wide string converter as the wide string is passed
|
|
217
|
-
// to Windows API.
|
|
218
|
-
//
|
|
219
|
-
_source = RegisterEventSourceW(0, stringToWstring(mangleSource(source), _stringConverter).c_str());
|
|
220
|
-
if(_source == 0)
|
|
221
|
-
{
|
|
222
|
-
throw SyscallException(__FILE__, __LINE__, GetLastError());
|
|
245
|
+
RegCloseKey(hKey);
|
|
223
246
|
}
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
~SMEventLoggerI()
|
|
227
|
-
{
|
|
228
|
-
assert(_source != 0);
|
|
229
|
-
DeregisterEventSource(_source);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
static void
|
|
233
|
-
addKeys(const string& source, const StringConverterPtr& stringConverter)
|
|
234
|
-
{
|
|
235
|
-
HKEY hKey;
|
|
236
|
-
DWORD d;
|
|
237
|
-
//
|
|
238
|
-
// Don't need to use a wide string converter as the wide string is passed
|
|
239
|
-
// to Windows API.
|
|
240
|
-
//
|
|
241
|
-
LONG err = RegCreateKeyExW(HKEY_LOCAL_MACHINE,
|
|
242
|
-
stringToWstring(createKey(source), stringConverter).c_str(),
|
|
243
|
-
0, const_cast<wchar_t*>(L"REG_SZ"), REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, &hKey, &d);
|
|
244
247
|
|
|
245
|
-
|
|
248
|
+
static void removeKeys(const string& source, const StringConverterPtr& stringConverter)
|
|
246
249
|
{
|
|
247
|
-
|
|
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
|
+
}
|
|
248
260
|
}
|
|
249
261
|
|
|
250
|
-
|
|
251
|
-
// Get the filename of this DLL.
|
|
252
|
-
//
|
|
253
|
-
wchar_t path[_MAX_PATH];
|
|
254
|
-
assert(_module != 0);
|
|
255
|
-
if(!GetModuleFileNameW(_module, path, _MAX_PATH))
|
|
262
|
+
virtual void print(const string& prefix, const string& message)
|
|
256
263
|
{
|
|
257
|
-
|
|
258
|
-
|
|
264
|
+
string s;
|
|
265
|
+
if (!prefix.empty())
|
|
266
|
+
{
|
|
267
|
+
s = prefix;
|
|
268
|
+
s.append(": ");
|
|
269
|
+
}
|
|
270
|
+
s.append(message);
|
|
271
|
+
print(s);
|
|
259
272
|
}
|
|
260
273
|
|
|
261
|
-
|
|
262
|
-
// The event resources are bundled into this DLL, therefore
|
|
263
|
-
// the "EventMessageFile" key should contain the path to this
|
|
264
|
-
// DLL.
|
|
265
|
-
//
|
|
266
|
-
err = RegSetValueExW(hKey, L"EventMessageFile", 0, REG_EXPAND_SZ, reinterpret_cast<unsigned char*>(path),
|
|
267
|
-
static_cast<DWORD>((wcslen(path) * sizeof(wchar_t)) + 1));
|
|
268
|
-
|
|
269
|
-
if(err == ERROR_SUCCESS)
|
|
274
|
+
void print(const string& message)
|
|
270
275
|
{
|
|
271
276
|
//
|
|
272
|
-
//
|
|
273
|
-
//
|
|
277
|
+
// Don't need to use a wide string converter as the wide string is passed
|
|
278
|
+
// to Windows API.
|
|
274
279
|
//
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
280
|
+
const wstring msg = stringToWstring(message, _stringConverter);
|
|
281
|
+
const wchar_t* messages[1];
|
|
282
|
+
messages[0] = msg.c_str();
|
|
283
|
+
//
|
|
284
|
+
// We ignore any failures from ReportEvent since there isn't
|
|
285
|
+
// anything we can do about it.
|
|
286
|
+
//
|
|
287
|
+
ReportEventW(_source, EVENTLOG_INFORMATION_TYPE, 0, EVENT_LOGGER_MSG, 0, 1, 0, messages, 0);
|
|
278
288
|
}
|
|
279
|
-
|
|
289
|
+
|
|
290
|
+
virtual void trace(const string& prefix, const string& category, const string& message)
|
|
280
291
|
{
|
|
281
|
-
|
|
282
|
-
|
|
292
|
+
string s;
|
|
293
|
+
if (!category.empty())
|
|
294
|
+
{
|
|
295
|
+
s = category;
|
|
296
|
+
s.append(": ");
|
|
297
|
+
}
|
|
298
|
+
s.append(message);
|
|
299
|
+
trace(prefix, s);
|
|
283
300
|
}
|
|
284
301
|
|
|
285
|
-
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
static void
|
|
289
|
-
removeKeys(const string& source, const StringConverterPtr& stringConverter)
|
|
290
|
-
{
|
|
291
|
-
//
|
|
292
|
-
// Don't need to use a wide string converter as the wide string is passed
|
|
293
|
-
// to Windows API.
|
|
294
|
-
//
|
|
295
|
-
LONG err = RegDeleteKeyW(HKEY_LOCAL_MACHINE,
|
|
296
|
-
stringToWstring(createKey(source), stringConverter).c_str());
|
|
297
|
-
if(err != ERROR_SUCCESS)
|
|
302
|
+
void trace(const string& category, const string& message)
|
|
298
303
|
{
|
|
299
|
-
|
|
304
|
+
string s;
|
|
305
|
+
if (!category.empty())
|
|
306
|
+
{
|
|
307
|
+
s = category;
|
|
308
|
+
s.append(": ");
|
|
309
|
+
}
|
|
310
|
+
s.append(message);
|
|
311
|
+
|
|
312
|
+
//
|
|
313
|
+
// Don't need to use a wide string converter as the wide string is passed
|
|
314
|
+
// to Windows API.
|
|
315
|
+
//
|
|
316
|
+
wstring msg = stringToWstring(s, _stringConverter);
|
|
317
|
+
const wchar_t* messages[1];
|
|
318
|
+
messages[0] = msg.c_str();
|
|
319
|
+
//
|
|
320
|
+
// We ignore any failures from ReportEvent since there isn't
|
|
321
|
+
// anything we can do about it.
|
|
322
|
+
//
|
|
323
|
+
ReportEventW(_source, EVENTLOG_INFORMATION_TYPE, 0, EVENT_LOGGER_MSG, 0, 1, 0, messages, 0);
|
|
300
324
|
}
|
|
301
|
-
}
|
|
302
325
|
|
|
303
|
-
|
|
304
|
-
print(const string& prefix, const string& message)
|
|
305
|
-
{
|
|
306
|
-
string s;
|
|
307
|
-
if(!prefix.empty())
|
|
326
|
+
virtual void warning(const string& prefix, const string& message)
|
|
308
327
|
{
|
|
309
|
-
s
|
|
310
|
-
|
|
328
|
+
string s;
|
|
329
|
+
if (!prefix.empty())
|
|
330
|
+
{
|
|
331
|
+
s = prefix;
|
|
332
|
+
s.append(": ");
|
|
333
|
+
}
|
|
334
|
+
s.append(message);
|
|
335
|
+
warning(s);
|
|
311
336
|
}
|
|
312
|
-
s.append(message);
|
|
313
|
-
print(s);
|
|
314
|
-
}
|
|
315
337
|
|
|
316
|
-
|
|
317
|
-
print(const string& message)
|
|
318
|
-
{
|
|
319
|
-
//
|
|
320
|
-
// Don't need to use a wide string converter as the wide string is passed
|
|
321
|
-
// to Windows API.
|
|
322
|
-
//
|
|
323
|
-
const wstring msg = stringToWstring(message, _stringConverter);
|
|
324
|
-
const wchar_t* messages[1];
|
|
325
|
-
messages[0] = msg.c_str();
|
|
326
|
-
//
|
|
327
|
-
// We ignore any failures from ReportEvent since there isn't
|
|
328
|
-
// anything we can do about it.
|
|
329
|
-
//
|
|
330
|
-
ReportEventW(_source, EVENTLOG_INFORMATION_TYPE, 0, EVENT_LOGGER_MSG, 0, 1, 0, messages, 0);
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
virtual void
|
|
334
|
-
trace(const string& prefix, const string& category, const string& message)
|
|
335
|
-
{
|
|
336
|
-
string s;
|
|
337
|
-
if(!category.empty())
|
|
338
|
+
void warning(const string& message)
|
|
338
339
|
{
|
|
339
|
-
|
|
340
|
-
|
|
340
|
+
//
|
|
341
|
+
// Don't need to use a wide string converter as the wide string is passed
|
|
342
|
+
// to Windows API.
|
|
343
|
+
//
|
|
344
|
+
wstring msg = stringToWstring(message, _stringConverter);
|
|
345
|
+
const wchar_t* messages[1];
|
|
346
|
+
messages[0] = msg.c_str();
|
|
347
|
+
//
|
|
348
|
+
// We ignore any failures from ReportEvent since there isn't
|
|
349
|
+
// anything we can do about it.
|
|
350
|
+
//
|
|
351
|
+
ReportEventW(_source, EVENTLOG_WARNING_TYPE, 0, EVENT_LOGGER_MSG, 0, 1, 0, messages, 0);
|
|
341
352
|
}
|
|
342
|
-
s.append(message);
|
|
343
|
-
trace(prefix, s);
|
|
344
|
-
}
|
|
345
353
|
|
|
346
|
-
|
|
347
|
-
trace(const string& category, const string& message)
|
|
348
|
-
{
|
|
349
|
-
string s;
|
|
350
|
-
if(!category.empty())
|
|
354
|
+
virtual void error(const string& prefix, const string& message)
|
|
351
355
|
{
|
|
352
|
-
s
|
|
353
|
-
|
|
356
|
+
string s;
|
|
357
|
+
if (!prefix.empty())
|
|
358
|
+
{
|
|
359
|
+
s = prefix;
|
|
360
|
+
s.append(": ");
|
|
361
|
+
}
|
|
362
|
+
s.append(message);
|
|
363
|
+
error(s);
|
|
354
364
|
}
|
|
355
|
-
s.append(message);
|
|
356
|
-
|
|
357
|
-
//
|
|
358
|
-
// Don't need to use a wide string converter as the wide string is passed
|
|
359
|
-
// to Windows API.
|
|
360
|
-
//
|
|
361
|
-
wstring msg = stringToWstring(s, _stringConverter);
|
|
362
|
-
const wchar_t* messages[1];
|
|
363
|
-
messages[0] = msg.c_str();
|
|
364
|
-
//
|
|
365
|
-
// We ignore any failures from ReportEvent since there isn't
|
|
366
|
-
// anything we can do about it.
|
|
367
|
-
//
|
|
368
|
-
ReportEventW(_source, EVENTLOG_INFORMATION_TYPE, 0, EVENT_LOGGER_MSG, 0, 1, 0, messages, 0);
|
|
369
|
-
}
|
|
370
365
|
|
|
371
|
-
|
|
372
|
-
warning(const string& prefix, const string& message)
|
|
373
|
-
{
|
|
374
|
-
string s;
|
|
375
|
-
if(!prefix.empty())
|
|
366
|
+
void error(const string& message)
|
|
376
367
|
{
|
|
377
|
-
|
|
378
|
-
|
|
368
|
+
//
|
|
369
|
+
// Don't need to use a wide string converter as the wide string is passed
|
|
370
|
+
// to Windows API.
|
|
371
|
+
//
|
|
372
|
+
wstring msg = stringToWstring(message, _stringConverter);
|
|
373
|
+
const wchar_t* messages[1];
|
|
374
|
+
messages[0] = msg.c_str();
|
|
375
|
+
//
|
|
376
|
+
// We ignore any failures from ReportEvent since there isn't
|
|
377
|
+
// anything we can do about it.
|
|
378
|
+
//
|
|
379
|
+
ReportEventW(_source, EVENTLOG_ERROR_TYPE, 0, EVENT_LOGGER_MSG, 0, 1, 0, messages, 0);
|
|
379
380
|
}
|
|
380
|
-
s.append(message);
|
|
381
|
-
warning(s);
|
|
382
|
-
}
|
|
383
381
|
|
|
384
|
-
|
|
385
|
-
warning(const string& message)
|
|
386
|
-
{
|
|
387
|
-
//
|
|
388
|
-
// Don't need to use a wide string converter as the wide string is passed
|
|
389
|
-
// to Windows API.
|
|
390
|
-
//
|
|
391
|
-
wstring msg = stringToWstring(message, _stringConverter);
|
|
392
|
-
const wchar_t* messages[1];
|
|
393
|
-
messages[0] = msg.c_str();
|
|
394
|
-
//
|
|
395
|
-
// We ignore any failures from ReportEvent since there isn't
|
|
396
|
-
// anything we can do about it.
|
|
397
|
-
//
|
|
398
|
-
ReportEventW(_source, EVENTLOG_WARNING_TYPE, 0, EVENT_LOGGER_MSG, 0, 1, 0, messages, 0);
|
|
399
|
-
}
|
|
382
|
+
static void setModuleHandle(HMODULE module) { _module = module; }
|
|
400
383
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
{
|
|
404
|
-
string s;
|
|
405
|
-
if(!prefix.empty())
|
|
384
|
+
private:
|
|
385
|
+
static string mangleSource(string name)
|
|
406
386
|
{
|
|
407
|
-
|
|
408
|
-
|
|
387
|
+
//
|
|
388
|
+
// The source name cannot contain backslashes.
|
|
389
|
+
//
|
|
390
|
+
string::size_type pos = 0;
|
|
391
|
+
while ((pos = name.find('\\', pos)) != string::npos)
|
|
392
|
+
{
|
|
393
|
+
name[pos] = '/';
|
|
394
|
+
}
|
|
395
|
+
return name;
|
|
409
396
|
}
|
|
410
|
-
s.append(message);
|
|
411
|
-
error(s);
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
void
|
|
415
|
-
error(const string& message)
|
|
416
|
-
{
|
|
417
|
-
//
|
|
418
|
-
// Don't need to use a wide string converter as the wide string is passed
|
|
419
|
-
// to Windows API.
|
|
420
|
-
//
|
|
421
|
-
wstring msg = stringToWstring(message, _stringConverter);
|
|
422
|
-
const wchar_t* messages[1];
|
|
423
|
-
messages[0] = msg.c_str();
|
|
424
|
-
//
|
|
425
|
-
// We ignore any failures from ReportEvent since there isn't
|
|
426
|
-
// anything we can do about it.
|
|
427
|
-
//
|
|
428
|
-
ReportEventW(_source, EVENTLOG_ERROR_TYPE, 0, EVENT_LOGGER_MSG, 0, 1, 0, messages, 0);
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
static void
|
|
432
|
-
setModuleHandle(HMODULE module)
|
|
433
|
-
{
|
|
434
|
-
_module = module;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
private:
|
|
438
397
|
|
|
439
|
-
|
|
440
|
-
mangleSource(string name)
|
|
441
|
-
{
|
|
442
|
-
//
|
|
443
|
-
// The source name cannot contain backslashes.
|
|
444
|
-
//
|
|
445
|
-
string::size_type pos = 0;
|
|
446
|
-
while((pos = name.find('\\', pos)) != string::npos)
|
|
398
|
+
static string createKey(string name)
|
|
447
399
|
{
|
|
448
|
-
|
|
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);
|
|
449
406
|
}
|
|
450
|
-
return name;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
static string
|
|
454
|
-
createKey(string name)
|
|
455
|
-
{
|
|
456
|
-
//
|
|
457
|
-
// The registry key is:
|
|
458
|
-
//
|
|
459
|
-
// HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application.
|
|
460
|
-
//
|
|
461
|
-
return "SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\" + mangleSource(name);
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
StringConverterPtr _stringConverter;
|
|
465
|
-
HANDLE _source;
|
|
466
|
-
static HMODULE _module;
|
|
467
|
-
};
|
|
468
407
|
|
|
469
|
-
|
|
408
|
+
StringConverterPtr _stringConverter;
|
|
409
|
+
HANDLE _source;
|
|
410
|
+
static HMODULE _module;
|
|
411
|
+
};
|
|
470
412
|
|
|
413
|
+
HMODULE SMEventLoggerI::_module = 0;
|
|
471
414
|
}
|
|
472
415
|
|
|
473
416
|
#endif
|
|
474
417
|
|
|
475
418
|
Ice::Service::Service()
|
|
476
419
|
{
|
|
477
|
-
assert(_instance ==
|
|
478
|
-
_nohup = true;
|
|
479
|
-
_service = false;
|
|
420
|
+
assert(_instance == nullptr);
|
|
480
421
|
_instance = this;
|
|
481
|
-
#ifndef _WIN32
|
|
482
|
-
_changeDirectory = true;
|
|
483
|
-
_closeFiles = true;
|
|
484
|
-
#endif
|
|
485
422
|
}
|
|
486
423
|
|
|
487
424
|
Ice::Service::~Service()
|
|
488
425
|
{
|
|
489
|
-
_instance =
|
|
490
|
-
delete
|
|
426
|
+
_instance = nullptr;
|
|
427
|
+
delete ctrlCHandler;
|
|
491
428
|
}
|
|
492
429
|
|
|
493
430
|
bool
|
|
494
431
|
Ice::Service::shutdown()
|
|
495
432
|
{
|
|
496
|
-
if(_communicator)
|
|
433
|
+
if (_communicator)
|
|
497
434
|
{
|
|
498
435
|
try
|
|
499
436
|
{
|
|
500
437
|
_communicator->shutdown();
|
|
501
438
|
}
|
|
502
|
-
catch(const CommunicatorDestroyedException&)
|
|
439
|
+
catch (const CommunicatorDestroyedException&)
|
|
503
440
|
{
|
|
504
441
|
//
|
|
505
442
|
// Expected if the service communicator is being destroyed.
|
|
506
443
|
//
|
|
507
444
|
}
|
|
508
|
-
catch(const Ice::Exception& ex)
|
|
445
|
+
catch (const Ice::Exception& ex)
|
|
509
446
|
{
|
|
510
447
|
ServiceWarning warn(this);
|
|
511
448
|
warn << "exception during shutdown:\n" << ex;
|
|
512
449
|
}
|
|
513
|
-
catch(const std::exception& ex)
|
|
450
|
+
catch (const std::exception& ex)
|
|
514
451
|
{
|
|
515
452
|
ServiceWarning warn(this);
|
|
516
453
|
warn << "exception during shutdown:\n" << ex;
|
|
517
454
|
}
|
|
518
|
-
catch(...)
|
|
455
|
+
catch (...)
|
|
519
456
|
{
|
|
520
457
|
warning("unknown exception during shutdown");
|
|
521
458
|
}
|
|
@@ -530,10 +467,10 @@ Ice::Service::interrupt()
|
|
|
530
467
|
}
|
|
531
468
|
|
|
532
469
|
int
|
|
533
|
-
Ice::Service::main(int argc, const char* const argv[],
|
|
470
|
+
Ice::Service::main(int argc, const char* const argv[], InitializationData initData)
|
|
534
471
|
{
|
|
535
472
|
_name = "";
|
|
536
|
-
if(argc > 0)
|
|
473
|
+
if (argc > 0)
|
|
537
474
|
{
|
|
538
475
|
_name = argv[0];
|
|
539
476
|
}
|
|
@@ -544,12 +481,11 @@ Ice::Service::main(int argc, const char* const argv[], const InitializationData&
|
|
|
544
481
|
// We parse the properties here to extract Ice.ProgramName and
|
|
545
482
|
// Ice.EventLog.Source on Windows.
|
|
546
483
|
//
|
|
547
|
-
InitializationData initData = initializationData;
|
|
548
484
|
try
|
|
549
485
|
{
|
|
550
486
|
initData.properties = createProperties(av.argc, av.argv, initData.properties);
|
|
551
487
|
}
|
|
552
|
-
catch(const Ice::Exception& ex)
|
|
488
|
+
catch (const Ice::Exception& ex)
|
|
553
489
|
{
|
|
554
490
|
ServiceError err(this);
|
|
555
491
|
err << "createProperties failed: " << ex;
|
|
@@ -564,13 +500,13 @@ Ice::Service::main(int argc, const char* const argv[], const InitializationData&
|
|
|
564
500
|
string name;
|
|
565
501
|
int idx = 1;
|
|
566
502
|
const StringConverterPtr stringConverter = getProcessStringConverter();
|
|
567
|
-
while(idx < av.argc)
|
|
503
|
+
while (idx < av.argc)
|
|
568
504
|
{
|
|
569
|
-
if(strcmp(av.argv[idx], "--service") == 0)
|
|
505
|
+
if (strcmp(av.argv[idx], "--service") == 0)
|
|
570
506
|
{
|
|
571
|
-
if(idx + 1 >= av.argc)
|
|
507
|
+
if (idx + 1 >= av.argc)
|
|
572
508
|
{
|
|
573
|
-
error("service name argument expected for
|
|
509
|
+
error("service name argument expected for '" + string(av.argv[idx]) + "'");
|
|
574
510
|
return EXIT_FAILURE;
|
|
575
511
|
}
|
|
576
512
|
|
|
@@ -581,14 +517,20 @@ Ice::Service::main(int argc, const char* const argv[], const InitializationData&
|
|
|
581
517
|
// our own logger.
|
|
582
518
|
//
|
|
583
519
|
_logger = getProcessLogger();
|
|
584
|
-
if(
|
|
520
|
+
if (dynamic_pointer_cast<LoggerI>(_logger))
|
|
585
521
|
{
|
|
586
|
-
string eventLogSource = initData.properties->
|
|
587
|
-
|
|
522
|
+
string eventLogSource = initData.properties->getIceProperty("Ice.EventLog.Source");
|
|
523
|
+
if (eventLogSource.empty())
|
|
524
|
+
{
|
|
525
|
+
eventLogSource = name;
|
|
526
|
+
}
|
|
527
|
+
_logger = make_shared<SMEventLoggerIWrapper>(
|
|
528
|
+
make_shared<SMEventLoggerI>(eventLogSource, stringConverter),
|
|
529
|
+
"");
|
|
588
530
|
setProcessLogger(_logger);
|
|
589
531
|
}
|
|
590
532
|
|
|
591
|
-
for(int i = idx; i + 2 < av.argc; ++i)
|
|
533
|
+
for (int i = idx; i + 2 < av.argc; ++i)
|
|
592
534
|
{
|
|
593
535
|
av.argv[i] = av.argv[i + 2];
|
|
594
536
|
}
|
|
@@ -600,7 +542,7 @@ Ice::Service::main(int argc, const char* const argv[], const InitializationData&
|
|
|
600
542
|
}
|
|
601
543
|
}
|
|
602
544
|
|
|
603
|
-
if(!name.empty())
|
|
545
|
+
if (!name.empty())
|
|
604
546
|
{
|
|
605
547
|
configureService(name);
|
|
606
548
|
}
|
|
@@ -614,11 +556,11 @@ Ice::Service::main(int argc, const char* const argv[], const InitializationData&
|
|
|
614
556
|
bool changeDirectory = true;
|
|
615
557
|
string pidFile;
|
|
616
558
|
int idx = 1;
|
|
617
|
-
while(idx < av.argc)
|
|
559
|
+
while (idx < av.argc)
|
|
618
560
|
{
|
|
619
|
-
if(strcmp(av.argv[idx], "--daemon") == 0)
|
|
561
|
+
if (strcmp(av.argv[idx], "--daemon") == 0)
|
|
620
562
|
{
|
|
621
|
-
for(int i = idx; i + 1 < av.argc; ++i)
|
|
563
|
+
for (int i = idx; i + 1 < av.argc; ++i)
|
|
622
564
|
{
|
|
623
565
|
av.argv[i] = av.argv[i + 1];
|
|
624
566
|
}
|
|
@@ -626,9 +568,9 @@ Ice::Service::main(int argc, const char* const argv[], const InitializationData&
|
|
|
626
568
|
|
|
627
569
|
daemonize = true;
|
|
628
570
|
}
|
|
629
|
-
else if(strcmp(av.argv[idx], "--noclose") == 0)
|
|
571
|
+
else if (strcmp(av.argv[idx], "--noclose") == 0)
|
|
630
572
|
{
|
|
631
|
-
for(int i = idx; i + 1 < av.argc; ++i)
|
|
573
|
+
for (int i = idx; i + 1 < av.argc; ++i)
|
|
632
574
|
{
|
|
633
575
|
av.argv[i] = av.argv[i + 1];
|
|
634
576
|
}
|
|
@@ -636,9 +578,9 @@ Ice::Service::main(int argc, const char* const argv[], const InitializationData&
|
|
|
636
578
|
|
|
637
579
|
closeFiles = false;
|
|
638
580
|
}
|
|
639
|
-
else if(strcmp(av.argv[idx], "--nochdir") == 0)
|
|
581
|
+
else if (strcmp(av.argv[idx], "--nochdir") == 0)
|
|
640
582
|
{
|
|
641
|
-
for(int i = idx; i + 1 < av.argc; ++i)
|
|
583
|
+
for (int i = idx; i + 1 < av.argc; ++i)
|
|
642
584
|
{
|
|
643
585
|
av.argv[i] = av.argv[i + 1];
|
|
644
586
|
}
|
|
@@ -646,15 +588,15 @@ Ice::Service::main(int argc, const char* const argv[], const InitializationData&
|
|
|
646
588
|
|
|
647
589
|
changeDirectory = false;
|
|
648
590
|
}
|
|
649
|
-
else if(strcmp(av.argv[idx], "--pidfile") == 0)
|
|
591
|
+
else if (strcmp(av.argv[idx], "--pidfile") == 0)
|
|
650
592
|
{
|
|
651
|
-
if(idx + 1 < av.argc)
|
|
593
|
+
if (idx + 1 < av.argc)
|
|
652
594
|
{
|
|
653
595
|
pidFile = av.argv[idx + 1];
|
|
654
596
|
}
|
|
655
597
|
else
|
|
656
598
|
{
|
|
657
|
-
if(av.argv[0])
|
|
599
|
+
if (av.argv[0])
|
|
658
600
|
{
|
|
659
601
|
consoleErr << av.argv[0] << ": ";
|
|
660
602
|
}
|
|
@@ -662,7 +604,7 @@ Ice::Service::main(int argc, const char* const argv[], const InitializationData&
|
|
|
662
604
|
return EXIT_FAILURE;
|
|
663
605
|
}
|
|
664
606
|
|
|
665
|
-
for(int i = idx; i + 2 < av.argc; ++i)
|
|
607
|
+
for (int i = idx; i + 2 < av.argc; ++i)
|
|
666
608
|
{
|
|
667
609
|
av.argv[i] = av.argv[i + 2];
|
|
668
610
|
}
|
|
@@ -674,9 +616,9 @@ Ice::Service::main(int argc, const char* const argv[], const InitializationData&
|
|
|
674
616
|
}
|
|
675
617
|
}
|
|
676
618
|
|
|
677
|
-
if(!closeFiles && !daemonize)
|
|
619
|
+
if (!closeFiles && !daemonize)
|
|
678
620
|
{
|
|
679
|
-
if(av.argv[0])
|
|
621
|
+
if (av.argv[0])
|
|
680
622
|
{
|
|
681
623
|
consoleErr << av.argv[0] << ": ";
|
|
682
624
|
}
|
|
@@ -684,9 +626,9 @@ Ice::Service::main(int argc, const char* const argv[], const InitializationData&
|
|
|
684
626
|
return EXIT_FAILURE;
|
|
685
627
|
}
|
|
686
628
|
|
|
687
|
-
if(pidFile.size() > 0 && !daemonize)
|
|
629
|
+
if (pidFile.size() > 0 && !daemonize)
|
|
688
630
|
{
|
|
689
|
-
if(av.argv[0])
|
|
631
|
+
if (av.argv[0])
|
|
690
632
|
{
|
|
691
633
|
consoleErr << av.argv[0] << ": ";
|
|
692
634
|
}
|
|
@@ -694,7 +636,7 @@ Ice::Service::main(int argc, const char* const argv[], const InitializationData&
|
|
|
694
636
|
return EXIT_FAILURE;
|
|
695
637
|
}
|
|
696
638
|
|
|
697
|
-
if(daemonize)
|
|
639
|
+
if (daemonize)
|
|
698
640
|
{
|
|
699
641
|
configureDaemon(changeDirectory, closeFiles, pidFile);
|
|
700
642
|
}
|
|
@@ -705,36 +647,35 @@ Ice::Service::main(int argc, const char* const argv[], const InitializationData&
|
|
|
705
647
|
// process logger is the default logger, we change it to a logger which is
|
|
706
648
|
// using the program name for the prefix.
|
|
707
649
|
//
|
|
708
|
-
if(!_logger)
|
|
650
|
+
if (!_logger)
|
|
709
651
|
{
|
|
710
652
|
_logger = getProcessLogger();
|
|
711
|
-
if(
|
|
653
|
+
if (dynamic_pointer_cast<LoggerI>(_logger))
|
|
712
654
|
{
|
|
713
|
-
const bool convert =
|
|
714
|
-
|
|
715
|
-
initData.properties->getProperty("Ice.StdErr").empty();
|
|
655
|
+
const bool convert = initData.properties->getIcePropertyAsInt("Ice.LogStdErr.Convert") > 0 &&
|
|
656
|
+
initData.properties->getIceProperty("Ice.StdErr").empty();
|
|
716
657
|
|
|
717
|
-
_logger =
|
|
658
|
+
_logger = make_shared<LoggerI>(initData.properties->getIceProperty("Ice.ProgramName"), "", convert);
|
|
718
659
|
setProcessLogger(_logger);
|
|
719
660
|
}
|
|
720
661
|
}
|
|
721
662
|
|
|
722
|
-
return run(av.argc, av.argv, initData
|
|
663
|
+
return run(av.argc, av.argv, std::move(initData));
|
|
723
664
|
}
|
|
724
665
|
|
|
725
666
|
#ifdef _WIN32
|
|
726
667
|
int
|
|
727
|
-
Ice::Service::main(int argc, const wchar_t* const argv[],
|
|
668
|
+
Ice::Service::main(int argc, const wchar_t* const argv[], InitializationData initData)
|
|
728
669
|
{
|
|
729
|
-
return main(Ice::argsToStringSeq(argc, argv),
|
|
670
|
+
return main(Ice::argsToStringSeq(argc, argv), std::move(initData));
|
|
730
671
|
}
|
|
731
672
|
#endif
|
|
732
673
|
|
|
733
674
|
int
|
|
734
|
-
Ice::Service::main(const StringSeq& args,
|
|
675
|
+
Ice::Service::main(const StringSeq& args, InitializationData initData)
|
|
735
676
|
{
|
|
736
677
|
IceInternal::ArgVector av(args);
|
|
737
|
-
return main(av.argc, av.argv, initData
|
|
678
|
+
return main(av.argc, av.argv, std::move(initData));
|
|
738
679
|
}
|
|
739
680
|
|
|
740
681
|
Ice::CommunicatorPtr
|
|
@@ -761,27 +702,17 @@ Ice::Service::name() const
|
|
|
761
702
|
return _name;
|
|
762
703
|
}
|
|
763
704
|
|
|
764
|
-
#ifdef _WIN32
|
|
765
705
|
int
|
|
766
|
-
Ice::Service::run(int argc, const
|
|
767
|
-
{
|
|
768
|
-
StringSeq args = Ice::argsToStringSeq(argc, argv);
|
|
769
|
-
IceInternal::ArgVector av(args);
|
|
770
|
-
return run(av.argc, av.argv, initData, version);
|
|
771
|
-
}
|
|
772
|
-
#endif
|
|
773
|
-
|
|
774
|
-
int
|
|
775
|
-
Ice::Service::run(int argc, const char* const argv[], const InitializationData& initData, int version)
|
|
706
|
+
Ice::Service::run(int argc, const char* const argv[], InitializationData initData)
|
|
776
707
|
{
|
|
777
708
|
IceInternal::ArgVector av(argc, argv); // copy args
|
|
778
709
|
|
|
779
|
-
if(_service)
|
|
710
|
+
if (_service)
|
|
780
711
|
{
|
|
781
712
|
#ifdef _WIN32
|
|
782
|
-
return runService(av.argc, av.argv, initData);
|
|
713
|
+
return runService(av.argc, av.argv, std::move(initData));
|
|
783
714
|
#else
|
|
784
|
-
return runDaemon(av.argc, av.argv, initData
|
|
715
|
+
return runDaemon(av.argc, av.argv, std::move(initData));
|
|
785
716
|
#endif
|
|
786
717
|
}
|
|
787
718
|
|
|
@@ -797,12 +728,12 @@ Ice::Service::run(int argc, const char* const argv[], const InitializationData&
|
|
|
797
728
|
// communicator because we need to ensure that this is done before any
|
|
798
729
|
// additional threads are created.
|
|
799
730
|
//
|
|
800
|
-
|
|
731
|
+
ctrlCHandler = new CtrlCHandler;
|
|
801
732
|
|
|
802
733
|
//
|
|
803
734
|
// Initialize the communicator.
|
|
804
735
|
//
|
|
805
|
-
_communicator = initializeCommunicator(av.argc, av.argv, initData
|
|
736
|
+
_communicator = initializeCommunicator(av.argc, av.argv, std::move(initData));
|
|
806
737
|
|
|
807
738
|
//
|
|
808
739
|
// Use the configured logger.
|
|
@@ -812,12 +743,12 @@ Ice::Service::run(int argc, const char* const argv[], const InitializationData&
|
|
|
812
743
|
//
|
|
813
744
|
// Determines whether we ignore SIGHUP/CTRL_LOGOFF_EVENT.
|
|
814
745
|
//
|
|
815
|
-
_nohup = _communicator->getProperties()->
|
|
746
|
+
_nohup = _communicator->getProperties()->getIcePropertyAsInt("Ice.Nohup") > 0;
|
|
816
747
|
|
|
817
748
|
//
|
|
818
749
|
// Start the service.
|
|
819
750
|
//
|
|
820
|
-
if(start(av.argc, av.argv, status))
|
|
751
|
+
if (start(av.argc, av.argv, status))
|
|
821
752
|
{
|
|
822
753
|
#ifdef ICE_USE_SYSTEMD
|
|
823
754
|
sd_notify(0, "READY=1");
|
|
@@ -836,13 +767,13 @@ Ice::Service::run(int argc, const char* const argv[], const InitializationData&
|
|
|
836
767
|
//
|
|
837
768
|
// Stop the service.
|
|
838
769
|
//
|
|
839
|
-
if(stop())
|
|
770
|
+
if (stop())
|
|
840
771
|
{
|
|
841
772
|
status = EXIT_SUCCESS;
|
|
842
773
|
}
|
|
843
774
|
}
|
|
844
775
|
}
|
|
845
|
-
catch(const Ice::Exception& ex)
|
|
776
|
+
catch (const Ice::Exception& ex)
|
|
846
777
|
{
|
|
847
778
|
ServiceError err(this);
|
|
848
779
|
err << "service terminating after catching exception:\n" << ex;
|
|
@@ -851,7 +782,7 @@ Ice::Service::run(int argc, const char* const argv[], const InitializationData&
|
|
|
851
782
|
sd_notifyf(0, "STATUS=Failed service terminating after catching exception: %s", msg.c_str());
|
|
852
783
|
#endif
|
|
853
784
|
}
|
|
854
|
-
catch(const std::exception& ex)
|
|
785
|
+
catch (const std::exception& ex)
|
|
855
786
|
{
|
|
856
787
|
ServiceError err(this);
|
|
857
788
|
err << "service terminating after catching exception:\n" << ex;
|
|
@@ -860,23 +791,7 @@ Ice::Service::run(int argc, const char* const argv[], const InitializationData&
|
|
|
860
791
|
sd_notifyf(0, "STATUS=Failed service terminating after catching exception: %s", msg.c_str());
|
|
861
792
|
#endif
|
|
862
793
|
}
|
|
863
|
-
catch(
|
|
864
|
-
{
|
|
865
|
-
ServiceError err(this);
|
|
866
|
-
err << "service terminating after catching exception:\n" << msg;
|
|
867
|
-
#ifdef ICE_USE_SYSTEMD
|
|
868
|
-
sd_notifyf(0, "STATUS=Failed service terminating after catching exception: %s", msg.c_str());
|
|
869
|
-
#endif
|
|
870
|
-
}
|
|
871
|
-
catch(const char* msg)
|
|
872
|
-
{
|
|
873
|
-
ServiceError err(this);
|
|
874
|
-
err << "service terminating after catching exception:\n" << msg;
|
|
875
|
-
#ifdef ICE_USE_SYSTEMD
|
|
876
|
-
sd_notifyf(0, "STATUS=Failed service terminating after catching exception: %s", msg);
|
|
877
|
-
#endif
|
|
878
|
-
}
|
|
879
|
-
catch(...)
|
|
794
|
+
catch (...)
|
|
880
795
|
{
|
|
881
796
|
error("service terminating after catching unknown exception");
|
|
882
797
|
#ifdef ICE_USE_SYSTEMD
|
|
@@ -884,7 +799,7 @@ Ice::Service::run(int argc, const char* const argv[], const InitializationData&
|
|
|
884
799
|
#endif
|
|
885
800
|
}
|
|
886
801
|
|
|
887
|
-
if(_communicator)
|
|
802
|
+
if (_communicator)
|
|
888
803
|
{
|
|
889
804
|
_communicator->destroy();
|
|
890
805
|
}
|
|
@@ -924,12 +839,12 @@ void
|
|
|
924
839
|
Ice::Service::handleInterrupt(int sig)
|
|
925
840
|
{
|
|
926
841
|
#ifdef _WIN32
|
|
927
|
-
if(_nohup && sig == CTRL_LOGOFF_EVENT)
|
|
842
|
+
if (_nohup && sig == CTRL_LOGOFF_EVENT)
|
|
928
843
|
{
|
|
929
844
|
return;
|
|
930
845
|
}
|
|
931
846
|
#else
|
|
932
|
-
if(_nohup && sig == SIGHUP)
|
|
847
|
+
if (_nohup && sig == SIGHUP)
|
|
933
848
|
{
|
|
934
849
|
return;
|
|
935
850
|
}
|
|
@@ -941,7 +856,7 @@ Ice::Service::handleInterrupt(int sig)
|
|
|
941
856
|
void
|
|
942
857
|
Ice::Service::waitForShutdown()
|
|
943
858
|
{
|
|
944
|
-
if(_communicator)
|
|
859
|
+
if (_communicator)
|
|
945
860
|
{
|
|
946
861
|
enableInterrupt();
|
|
947
862
|
_communicator->waitForShutdown();
|
|
@@ -956,23 +871,24 @@ Ice::Service::stop()
|
|
|
956
871
|
}
|
|
957
872
|
|
|
958
873
|
Ice::CommunicatorPtr
|
|
959
|
-
Ice::Service::initializeCommunicator(int& argc, char* argv[],
|
|
874
|
+
Ice::Service::initializeCommunicator(int& argc, char* argv[], InitializationData initData)
|
|
960
875
|
{
|
|
961
|
-
|
|
876
|
+
initData.properties = createProperties(argc, argv, initData.properties);
|
|
877
|
+
return Ice::initialize(std::move(initData));
|
|
962
878
|
}
|
|
963
879
|
|
|
964
880
|
void
|
|
965
881
|
Ice::Service::syserror(const string& msg)
|
|
966
882
|
{
|
|
967
|
-
string errmsg =
|
|
968
|
-
if(_logger)
|
|
883
|
+
string errmsg = IceInternal::lastErrorToString();
|
|
884
|
+
if (_logger)
|
|
969
885
|
{
|
|
970
886
|
ostringstream ostr;
|
|
971
|
-
if(!msg.empty())
|
|
887
|
+
if (!msg.empty())
|
|
972
888
|
{
|
|
973
889
|
ostr << msg << endl;
|
|
974
890
|
}
|
|
975
|
-
if(!errmsg.empty())
|
|
891
|
+
if (!errmsg.empty())
|
|
976
892
|
{
|
|
977
893
|
ostr << errmsg;
|
|
978
894
|
}
|
|
@@ -980,15 +896,15 @@ Ice::Service::syserror(const string& msg)
|
|
|
980
896
|
}
|
|
981
897
|
else
|
|
982
898
|
{
|
|
983
|
-
if(!_name.empty())
|
|
899
|
+
if (!_name.empty())
|
|
984
900
|
{
|
|
985
901
|
consoleErr << _name << ": ";
|
|
986
902
|
}
|
|
987
|
-
if(!msg.empty())
|
|
903
|
+
if (!msg.empty())
|
|
988
904
|
{
|
|
989
905
|
consoleErr << msg << endl;
|
|
990
906
|
}
|
|
991
|
-
if(!errmsg.empty())
|
|
907
|
+
if (!errmsg.empty())
|
|
992
908
|
{
|
|
993
909
|
consoleErr << errmsg;
|
|
994
910
|
}
|
|
@@ -998,13 +914,13 @@ Ice::Service::syserror(const string& msg)
|
|
|
998
914
|
void
|
|
999
915
|
Ice::Service::error(const string& msg)
|
|
1000
916
|
{
|
|
1001
|
-
if(_logger)
|
|
917
|
+
if (_logger)
|
|
1002
918
|
{
|
|
1003
919
|
_logger->error(msg);
|
|
1004
920
|
}
|
|
1005
921
|
else
|
|
1006
922
|
{
|
|
1007
|
-
if(!_name.empty())
|
|
923
|
+
if (!_name.empty())
|
|
1008
924
|
{
|
|
1009
925
|
consoleErr << _name << ": ";
|
|
1010
926
|
}
|
|
@@ -1015,13 +931,13 @@ Ice::Service::error(const string& msg)
|
|
|
1015
931
|
void
|
|
1016
932
|
Ice::Service::warning(const string& msg)
|
|
1017
933
|
{
|
|
1018
|
-
if(_logger)
|
|
934
|
+
if (_logger)
|
|
1019
935
|
{
|
|
1020
936
|
_logger->warning(msg);
|
|
1021
937
|
}
|
|
1022
938
|
else
|
|
1023
939
|
{
|
|
1024
|
-
if(!_name.empty())
|
|
940
|
+
if (!_name.empty())
|
|
1025
941
|
{
|
|
1026
942
|
consoleErr << _name << ": ";
|
|
1027
943
|
}
|
|
@@ -1032,7 +948,7 @@ Ice::Service::warning(const string& msg)
|
|
|
1032
948
|
void
|
|
1033
949
|
Ice::Service::trace(const string& msg)
|
|
1034
950
|
{
|
|
1035
|
-
if(_logger)
|
|
951
|
+
if (_logger)
|
|
1036
952
|
{
|
|
1037
953
|
_logger->trace("", msg);
|
|
1038
954
|
}
|
|
@@ -1045,7 +961,7 @@ Ice::Service::trace(const string& msg)
|
|
|
1045
961
|
void
|
|
1046
962
|
Ice::Service::print(const string& msg)
|
|
1047
963
|
{
|
|
1048
|
-
if(_logger)
|
|
964
|
+
if (_logger)
|
|
1049
965
|
{
|
|
1050
966
|
_logger->print(msg);
|
|
1051
967
|
}
|
|
@@ -1058,23 +974,23 @@ Ice::Service::print(const string& msg)
|
|
|
1058
974
|
void
|
|
1059
975
|
Ice::Service::enableInterrupt()
|
|
1060
976
|
{
|
|
1061
|
-
|
|
977
|
+
ctrlCHandler->setCallback(ctrlCHandlerCallback);
|
|
1062
978
|
}
|
|
1063
979
|
|
|
1064
980
|
void
|
|
1065
981
|
Ice::Service::disableInterrupt()
|
|
1066
982
|
{
|
|
1067
|
-
|
|
983
|
+
ctrlCHandler->setCallback(nullptr);
|
|
1068
984
|
}
|
|
1069
985
|
|
|
1070
986
|
#ifdef _WIN32
|
|
1071
987
|
|
|
1072
988
|
int
|
|
1073
|
-
Ice::Service::runService(int argc, const char* const argv[],
|
|
989
|
+
Ice::Service::runService(int argc, const char* const argv[], InitializationData initData)
|
|
1074
990
|
{
|
|
1075
991
|
assert(_service);
|
|
1076
992
|
|
|
1077
|
-
if(_name.empty())
|
|
993
|
+
if (_name.empty())
|
|
1078
994
|
{
|
|
1079
995
|
error("invalid name for Win32 service");
|
|
1080
996
|
return EXIT_FAILURE;
|
|
@@ -1084,28 +1000,27 @@ Ice::Service::runService(int argc, const char* const argv[], const Initializatio
|
|
|
1084
1000
|
// Arguments passed to the executable are not passed to the service's main function,
|
|
1085
1001
|
// so save them now and serviceMain will merge them later.
|
|
1086
1002
|
//
|
|
1087
|
-
for(int idx = 1; idx < argc; ++idx)
|
|
1003
|
+
for (int idx = 1; idx < argc; ++idx)
|
|
1088
1004
|
{
|
|
1089
1005
|
_serviceArgs.push_back(argv[idx]);
|
|
1090
1006
|
}
|
|
1091
1007
|
|
|
1092
|
-
_initData = initData;
|
|
1008
|
+
_initData = std::move(initData);
|
|
1093
1009
|
|
|
1094
1010
|
//
|
|
1095
1011
|
// Don't need to use a wide string converter as the wide string is passed
|
|
1096
1012
|
// to Windows API.
|
|
1097
1013
|
//
|
|
1098
1014
|
const wstring serviceName = stringToWstring(_name, getProcessStringConverter());
|
|
1099
|
-
SERVICE_TABLE_ENTRYW ste[] =
|
|
1100
|
-
|
|
1101
|
-
{
|
|
1102
|
-
{ 0, 0 },
|
|
1015
|
+
SERVICE_TABLE_ENTRYW ste[] = {
|
|
1016
|
+
{const_cast<wchar_t*>(serviceName.c_str()), Ice_Service_ServiceMain},
|
|
1017
|
+
{0, 0},
|
|
1103
1018
|
};
|
|
1104
1019
|
|
|
1105
1020
|
//
|
|
1106
1021
|
// Start the service.
|
|
1107
1022
|
//
|
|
1108
|
-
if(!StartServiceCtrlDispatcherW(ste))
|
|
1023
|
+
if (!StartServiceCtrlDispatcherW(ste))
|
|
1109
1024
|
{
|
|
1110
1025
|
syserror("unable to start service control dispatcher");
|
|
1111
1026
|
return EXIT_FAILURE;
|
|
@@ -1126,7 +1041,7 @@ Ice::Service::terminateService(DWORD exitCode)
|
|
|
1126
1041
|
status.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
|
|
1127
1042
|
status.dwCurrentState = SERVICE_STOPPED;
|
|
1128
1043
|
status.dwControlsAccepted = 0;
|
|
1129
|
-
if(exitCode != 0)
|
|
1044
|
+
if (exitCode != 0)
|
|
1130
1045
|
{
|
|
1131
1046
|
status.dwWin32ExitCode = ERROR_SERVICE_SPECIFIC_ERROR;
|
|
1132
1047
|
}
|
|
@@ -1144,7 +1059,7 @@ Ice::Service::terminateService(DWORD exitCode)
|
|
|
1144
1059
|
bool
|
|
1145
1060
|
Ice::Service::waitForServiceState(SC_HANDLE hService, DWORD pendingState, SERVICE_STATUS& status)
|
|
1146
1061
|
{
|
|
1147
|
-
if(!QueryServiceStatus(hService, &status))
|
|
1062
|
+
if (!QueryServiceStatus(hService, &status))
|
|
1148
1063
|
{
|
|
1149
1064
|
return false;
|
|
1150
1065
|
}
|
|
@@ -1158,7 +1073,7 @@ Ice::Service::waitForServiceState(SC_HANDLE hService, DWORD pendingState, SERVIC
|
|
|
1158
1073
|
//
|
|
1159
1074
|
// Loop while the service is in the pending state.
|
|
1160
1075
|
//
|
|
1161
|
-
while(status.dwCurrentState == pendingState)
|
|
1076
|
+
while (status.dwCurrentState == pendingState)
|
|
1162
1077
|
{
|
|
1163
1078
|
//
|
|
1164
1079
|
// Do not wait longer than the wait hint. A good interval is
|
|
@@ -1168,11 +1083,11 @@ Ice::Service::waitForServiceState(SC_HANDLE hService, DWORD pendingState, SERVIC
|
|
|
1168
1083
|
|
|
1169
1084
|
DWORD waitTime = status.dwWaitHint / 10;
|
|
1170
1085
|
|
|
1171
|
-
if(waitTime < 1000)
|
|
1086
|
+
if (waitTime < 1000)
|
|
1172
1087
|
{
|
|
1173
1088
|
waitTime = 1000;
|
|
1174
1089
|
}
|
|
1175
|
-
else if(waitTime > 10000)
|
|
1090
|
+
else if (waitTime > 10000)
|
|
1176
1091
|
{
|
|
1177
1092
|
waitTime = 10000;
|
|
1178
1093
|
}
|
|
@@ -1182,12 +1097,12 @@ Ice::Service::waitForServiceState(SC_HANDLE hService, DWORD pendingState, SERVIC
|
|
|
1182
1097
|
//
|
|
1183
1098
|
// Check the status again.
|
|
1184
1099
|
//
|
|
1185
|
-
if(!QueryServiceStatus(hService, &status))
|
|
1100
|
+
if (!QueryServiceStatus(hService, &status))
|
|
1186
1101
|
{
|
|
1187
1102
|
return false;
|
|
1188
1103
|
}
|
|
1189
1104
|
|
|
1190
|
-
if(status.dwCheckPoint > oldCheckPoint)
|
|
1105
|
+
if (status.dwCheckPoint > oldCheckPoint)
|
|
1191
1106
|
{
|
|
1192
1107
|
//
|
|
1193
1108
|
// The service is making progress.
|
|
@@ -1197,7 +1112,7 @@ Ice::Service::waitForServiceState(SC_HANDLE hService, DWORD pendingState, SERVIC
|
|
|
1197
1112
|
}
|
|
1198
1113
|
else
|
|
1199
1114
|
{
|
|
1200
|
-
if(GetTickCount() - startTickCount > status.dwWaitHint)
|
|
1115
|
+
if (GetTickCount() - startTickCount > status.dwWaitHint)
|
|
1201
1116
|
{
|
|
1202
1117
|
//
|
|
1203
1118
|
// No progress made within the wait hint.
|
|
@@ -1214,53 +1129,50 @@ void
|
|
|
1214
1129
|
Ice::Service::showServiceStatus(const string& msg, SERVICE_STATUS& status)
|
|
1215
1130
|
{
|
|
1216
1131
|
string state;
|
|
1217
|
-
switch(status.dwCurrentState)
|
|
1218
|
-
{
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1132
|
+
switch (status.dwCurrentState)
|
|
1133
|
+
{
|
|
1134
|
+
case SERVICE_STOPPED:
|
|
1135
|
+
state = "STOPPED";
|
|
1136
|
+
break;
|
|
1137
|
+
case SERVICE_START_PENDING:
|
|
1138
|
+
state = "START PENDING";
|
|
1139
|
+
break;
|
|
1140
|
+
case SERVICE_STOP_PENDING:
|
|
1141
|
+
state = "STOP PENDING";
|
|
1142
|
+
break;
|
|
1143
|
+
case SERVICE_RUNNING:
|
|
1144
|
+
state = "RUNNING";
|
|
1145
|
+
break;
|
|
1146
|
+
case SERVICE_CONTINUE_PENDING:
|
|
1147
|
+
state = "CONTINUE PENDING";
|
|
1148
|
+
break;
|
|
1149
|
+
case SERVICE_PAUSE_PENDING:
|
|
1150
|
+
state = "PAUSE PENDING";
|
|
1151
|
+
break;
|
|
1152
|
+
case SERVICE_PAUSED:
|
|
1153
|
+
state = "PAUSED";
|
|
1154
|
+
break;
|
|
1155
|
+
default:
|
|
1156
|
+
state = "UNKNOWN";
|
|
1157
|
+
break;
|
|
1243
1158
|
}
|
|
1244
1159
|
|
|
1245
1160
|
ServiceTrace tr(this);
|
|
1246
|
-
tr << msg
|
|
1247
|
-
<< "\n Current state: " << state
|
|
1248
|
-
<< "\n Exit code: " << status.dwWin32ExitCode
|
|
1161
|
+
tr << msg << "\n Current state: " << state << "\n Exit code: " << status.dwWin32ExitCode
|
|
1249
1162
|
<< "\n Service specific exit code: " << status.dwServiceSpecificExitCode
|
|
1250
|
-
<< "\n Check point: " << status.dwCheckPoint
|
|
1251
|
-
<< "\n Wait hint: " << status.dwWaitHint;
|
|
1163
|
+
<< "\n Check point: " << status.dwCheckPoint << "\n Wait hint: " << status.dwWaitHint;
|
|
1252
1164
|
}
|
|
1253
1165
|
|
|
1254
1166
|
void
|
|
1255
1167
|
Ice::Service::serviceMain(int argc, const wchar_t* const argv[])
|
|
1256
1168
|
{
|
|
1257
|
-
|
|
1169
|
+
ctrlCHandler = new CtrlCHandler;
|
|
1258
1170
|
|
|
1259
1171
|
//
|
|
1260
1172
|
// Register the control handler function.
|
|
1261
1173
|
//
|
|
1262
1174
|
_statusHandle = RegisterServiceCtrlHandlerW(argv[0], Ice_Service_CtrlHandler);
|
|
1263
|
-
if(_statusHandle == 0)
|
|
1175
|
+
if (_statusHandle == 0)
|
|
1264
1176
|
{
|
|
1265
1177
|
syserror("unable to register service control handler");
|
|
1266
1178
|
return;
|
|
@@ -1279,7 +1191,7 @@ Ice::Service::serviceMain(int argc, const wchar_t* const argv[])
|
|
|
1279
1191
|
// Don't need to pass a wide string converter in the argv conversions
|
|
1280
1192
|
// as argv come from Windows API.
|
|
1281
1193
|
//
|
|
1282
|
-
const
|
|
1194
|
+
const Ice::StringConverterPtr converter = Ice::getProcessStringConverter();
|
|
1283
1195
|
|
|
1284
1196
|
//
|
|
1285
1197
|
// Merge the executable's arguments with the service's arguments.
|
|
@@ -1293,7 +1205,7 @@ Ice::Service::serviceMain(int argc, const wchar_t* const argv[])
|
|
|
1293
1205
|
args[0] = const_cast<char*>(serviceName.c_str());
|
|
1294
1206
|
|
|
1295
1207
|
int i = 1;
|
|
1296
|
-
for(vector<string>::iterator p = _serviceArgs.begin(); p != _serviceArgs.end(); ++p)
|
|
1208
|
+
for (vector<string>::iterator p = _serviceArgs.begin(); p != _serviceArgs.end(); ++p)
|
|
1297
1209
|
{
|
|
1298
1210
|
args[i++] = const_cast<char*>(p->c_str());
|
|
1299
1211
|
}
|
|
@@ -1303,13 +1215,13 @@ Ice::Service::serviceMain(int argc, const wchar_t* const argv[])
|
|
|
1303
1215
|
// the converted sequence into the args array.
|
|
1304
1216
|
//
|
|
1305
1217
|
vector<string> executableArgs;
|
|
1306
|
-
for(int j = 1; j < argc; ++j)
|
|
1218
|
+
for (int j = 1; j < argc; ++j)
|
|
1307
1219
|
{
|
|
1308
|
-
executableArgs.push_back(
|
|
1220
|
+
executableArgs.push_back(Ice::wstringToString(argv[j], converter));
|
|
1309
1221
|
}
|
|
1310
|
-
for(vector<string>::iterator p = executableArgs.begin(); p != executableArgs.end(); ++p)
|
|
1222
|
+
for (vector<string>::iterator p = executableArgs.begin(); p != executableArgs.end(); ++p)
|
|
1311
1223
|
{
|
|
1312
|
-
|
|
1224
|
+
args[i++] = const_cast<char*>(p->c_str());
|
|
1313
1225
|
}
|
|
1314
1226
|
argc += static_cast<int>(_serviceArgs.size());
|
|
1315
1227
|
|
|
@@ -1318,9 +1230,9 @@ Ice::Service::serviceMain(int argc, const wchar_t* const argv[])
|
|
|
1318
1230
|
//
|
|
1319
1231
|
try
|
|
1320
1232
|
{
|
|
1321
|
-
_communicator = initializeCommunicator(argc, args, _initData
|
|
1233
|
+
_communicator = initializeCommunicator(argc, args, _initData);
|
|
1322
1234
|
}
|
|
1323
|
-
catch(const Ice::Exception& ex)
|
|
1235
|
+
catch (const Ice::Exception& ex)
|
|
1324
1236
|
{
|
|
1325
1237
|
delete[] args;
|
|
1326
1238
|
{
|
|
@@ -1330,7 +1242,7 @@ Ice::Service::serviceMain(int argc, const wchar_t* const argv[])
|
|
|
1330
1242
|
terminateService(EXIT_FAILURE);
|
|
1331
1243
|
return;
|
|
1332
1244
|
}
|
|
1333
|
-
catch(...)
|
|
1245
|
+
catch (...)
|
|
1334
1246
|
{
|
|
1335
1247
|
delete[] args;
|
|
1336
1248
|
error("unknown exception occurred while initializing a communicator");
|
|
@@ -1346,13 +1258,13 @@ Ice::Service::serviceMain(int argc, const wchar_t* const argv[])
|
|
|
1346
1258
|
//
|
|
1347
1259
|
// Determines whether we ignore SIGHUP/CTRL_LOGOFF_EVENT.
|
|
1348
1260
|
//
|
|
1349
|
-
_nohup = _communicator->getProperties()->
|
|
1261
|
+
_nohup = _communicator->getProperties()->getIcePropertyAsInt("Ice.Nohup") > 0;
|
|
1350
1262
|
|
|
1351
1263
|
DWORD status = EXIT_FAILURE;
|
|
1352
1264
|
try
|
|
1353
1265
|
{
|
|
1354
1266
|
int tmpStatus = EXIT_FAILURE;
|
|
1355
|
-
if(start(argc, args, tmpStatus))
|
|
1267
|
+
if (start(argc, args, tmpStatus))
|
|
1356
1268
|
{
|
|
1357
1269
|
trace("Service started successfully.");
|
|
1358
1270
|
|
|
@@ -1370,7 +1282,7 @@ Ice::Service::serviceMain(int argc, const wchar_t* const argv[])
|
|
|
1370
1282
|
//
|
|
1371
1283
|
// Give the service a chance to clean up.
|
|
1372
1284
|
//
|
|
1373
|
-
if(stop())
|
|
1285
|
+
if (stop())
|
|
1374
1286
|
{
|
|
1375
1287
|
status = EXIT_SUCCESS;
|
|
1376
1288
|
}
|
|
@@ -1380,17 +1292,17 @@ Ice::Service::serviceMain(int argc, const wchar_t* const argv[])
|
|
|
1380
1292
|
status = tmpStatus;
|
|
1381
1293
|
}
|
|
1382
1294
|
}
|
|
1383
|
-
catch(const Ice::Exception& ex)
|
|
1295
|
+
catch (const Ice::Exception& ex)
|
|
1384
1296
|
{
|
|
1385
1297
|
ServiceError err(this);
|
|
1386
1298
|
err << "service terminating after catching exception:\n" << ex;
|
|
1387
1299
|
}
|
|
1388
|
-
catch(const std::exception& ex)
|
|
1300
|
+
catch (const std::exception& ex)
|
|
1389
1301
|
{
|
|
1390
1302
|
ServiceError err(this);
|
|
1391
1303
|
err << "service terminating after catching exception:\n" << ex;
|
|
1392
1304
|
}
|
|
1393
|
-
catch(...)
|
|
1305
|
+
catch (...)
|
|
1394
1306
|
{
|
|
1395
1307
|
error("service terminating after catching unknown exception");
|
|
1396
1308
|
}
|
|
@@ -1408,31 +1320,30 @@ Ice::Service::control(int ctrl)
|
|
|
1408
1320
|
{
|
|
1409
1321
|
assert(serviceStatusManager);
|
|
1410
1322
|
|
|
1411
|
-
switch(ctrl)
|
|
1412
|
-
{
|
|
1413
|
-
case SERVICE_CONTROL_SHUTDOWN:
|
|
1414
|
-
case SERVICE_CONTROL_STOP:
|
|
1415
|
-
{
|
|
1416
|
-
serviceStatusManager->startUpdate(SERVICE_STOP_PENDING);
|
|
1417
|
-
shutdown();
|
|
1418
|
-
break;
|
|
1419
|
-
}
|
|
1420
|
-
default:
|
|
1323
|
+
switch (ctrl)
|
|
1421
1324
|
{
|
|
1422
|
-
|
|
1325
|
+
case SERVICE_CONTROL_SHUTDOWN:
|
|
1326
|
+
case SERVICE_CONTROL_STOP:
|
|
1423
1327
|
{
|
|
1424
|
-
|
|
1425
|
-
|
|
1328
|
+
serviceStatusManager->startUpdate(SERVICE_STOP_PENDING);
|
|
1329
|
+
shutdown();
|
|
1330
|
+
break;
|
|
1426
1331
|
}
|
|
1332
|
+
default:
|
|
1333
|
+
{
|
|
1334
|
+
if (ctrl != SERVICE_CONTROL_INTERROGATE)
|
|
1335
|
+
{
|
|
1336
|
+
ServiceError err(this);
|
|
1337
|
+
err << "unrecognized service control code " << ctrl;
|
|
1338
|
+
}
|
|
1427
1339
|
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1340
|
+
serviceStatusManager->reportStatus();
|
|
1341
|
+
break;
|
|
1342
|
+
}
|
|
1431
1343
|
}
|
|
1432
1344
|
}
|
|
1433
1345
|
|
|
1434
|
-
ServiceStatusManager::ServiceStatusManager(SERVICE_STATUS_HANDLE handle) :
|
|
1435
|
-
_handle(handle), _stopped(false)
|
|
1346
|
+
ServiceStatusManager::ServiceStatusManager(SERVICE_STATUS_HANDLE handle) : _handle(handle), _stopped(false)
|
|
1436
1347
|
{
|
|
1437
1348
|
_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
|
|
1438
1349
|
_status.dwControlsAccepted = 0;
|
|
@@ -1445,47 +1356,42 @@ ServiceStatusManager::ServiceStatusManager(SERVICE_STATUS_HANDLE handle) :
|
|
|
1445
1356
|
void
|
|
1446
1357
|
ServiceStatusManager::startUpdate(DWORD state)
|
|
1447
1358
|
{
|
|
1448
|
-
|
|
1359
|
+
lock_guard lock(_mutex);
|
|
1449
1360
|
|
|
1450
1361
|
assert(state == SERVICE_START_PENDING || state == SERVICE_STOP_PENDING);
|
|
1451
|
-
assert(!_thread);
|
|
1362
|
+
assert(!_thread.joinable());
|
|
1452
1363
|
|
|
1453
1364
|
_status.dwCurrentState = state;
|
|
1454
1365
|
_status.dwControlsAccepted = 0; // Don't accept any other control messages while pending.
|
|
1455
1366
|
|
|
1456
1367
|
_stopped = false;
|
|
1457
1368
|
|
|
1458
|
-
_thread =
|
|
1459
|
-
_thread->start();
|
|
1369
|
+
_thread = std::thread(&ServiceStatusManager::run, this);
|
|
1460
1370
|
}
|
|
1461
1371
|
|
|
1462
1372
|
void
|
|
1463
1373
|
ServiceStatusManager::stopUpdate()
|
|
1464
1374
|
{
|
|
1465
|
-
|
|
1375
|
+
std::thread thread;
|
|
1466
1376
|
|
|
1467
1377
|
{
|
|
1468
|
-
|
|
1378
|
+
lock_guard lock(_mutex);
|
|
1469
1379
|
|
|
1470
|
-
if(_thread)
|
|
1380
|
+
if (_thread.joinable())
|
|
1471
1381
|
{
|
|
1472
1382
|
_stopped = true;
|
|
1473
|
-
|
|
1474
|
-
thread = _thread;
|
|
1475
|
-
_thread = 0;
|
|
1383
|
+
_conditionVariable.notify_one();
|
|
1384
|
+
thread = std::move(_thread);
|
|
1476
1385
|
}
|
|
1477
1386
|
}
|
|
1478
1387
|
|
|
1479
|
-
|
|
1480
|
-
{
|
|
1481
|
-
thread->getThreadControl().join();
|
|
1482
|
-
}
|
|
1388
|
+
thread.join();
|
|
1483
1389
|
}
|
|
1484
1390
|
|
|
1485
1391
|
void
|
|
1486
1392
|
ServiceStatusManager::changeStatus(DWORD state, DWORD controlsAccepted)
|
|
1487
1393
|
{
|
|
1488
|
-
|
|
1394
|
+
lock_guard lock(_mutex);
|
|
1489
1395
|
|
|
1490
1396
|
_status.dwCurrentState = state;
|
|
1491
1397
|
_status.dwControlsAccepted = controlsAccepted;
|
|
@@ -1496,7 +1402,7 @@ ServiceStatusManager::changeStatus(DWORD state, DWORD controlsAccepted)
|
|
|
1496
1402
|
void
|
|
1497
1403
|
ServiceStatusManager::reportStatus()
|
|
1498
1404
|
{
|
|
1499
|
-
|
|
1405
|
+
lock_guard lock(_mutex);
|
|
1500
1406
|
|
|
1501
1407
|
SetServiceStatus(_handle, &_status);
|
|
1502
1408
|
}
|
|
@@ -1504,24 +1410,24 @@ ServiceStatusManager::reportStatus()
|
|
|
1504
1410
|
void
|
|
1505
1411
|
ServiceStatusManager::run()
|
|
1506
1412
|
{
|
|
1507
|
-
|
|
1413
|
+
unique_lock lock(_mutex);
|
|
1508
1414
|
|
|
1509
|
-
|
|
1415
|
+
auto delay = chrono::milliseconds(1000);
|
|
1510
1416
|
_status.dwWaitHint = 2000;
|
|
1511
1417
|
_status.dwCheckPoint = 0;
|
|
1512
1418
|
|
|
1513
|
-
while(!_stopped)
|
|
1419
|
+
while (!_stopped)
|
|
1514
1420
|
{
|
|
1515
1421
|
_status.dwCheckPoint++;
|
|
1516
1422
|
SetServiceStatus(_handle, &_status);
|
|
1517
|
-
|
|
1423
|
+
_conditionVariable.wait_for(lock, delay);
|
|
1518
1424
|
}
|
|
1519
1425
|
}
|
|
1520
1426
|
|
|
1521
1427
|
#else
|
|
1522
1428
|
|
|
1523
1429
|
int
|
|
1524
|
-
Ice::Service::runDaemon(int argc, char* argv[],
|
|
1430
|
+
Ice::Service::runDaemon(int argc, char* argv[], InitializationData initData)
|
|
1525
1431
|
{
|
|
1526
1432
|
assert(_service);
|
|
1527
1433
|
|
|
@@ -1535,17 +1441,17 @@ Ice::Service::runDaemon(int argc, char* argv[], const InitializationData& initDa
|
|
|
1535
1441
|
// Fork the child.
|
|
1536
1442
|
//
|
|
1537
1443
|
pid_t pid = fork();
|
|
1538
|
-
if(pid < 0)
|
|
1444
|
+
if (pid < 0)
|
|
1539
1445
|
{
|
|
1540
|
-
if(argv[0])
|
|
1446
|
+
if (argv[0])
|
|
1541
1447
|
{
|
|
1542
1448
|
consoleErr << argv[0] << ": ";
|
|
1543
1449
|
}
|
|
1544
|
-
consoleErr <<
|
|
1450
|
+
consoleErr << IceInternal::errorToString(errno) << endl;
|
|
1545
1451
|
return EXIT_FAILURE;
|
|
1546
1452
|
}
|
|
1547
1453
|
|
|
1548
|
-
if(pid != 0)
|
|
1454
|
+
if (pid != 0)
|
|
1549
1455
|
{
|
|
1550
1456
|
//
|
|
1551
1457
|
// Parent process.
|
|
@@ -1561,26 +1467,26 @@ Ice::Service::runDaemon(int argc, char* argv[], const InitializationData& initDa
|
|
|
1561
1467
|
// is ready to receive requests, or that an error occurred.
|
|
1562
1468
|
//
|
|
1563
1469
|
char c = 0;
|
|
1564
|
-
while(true)
|
|
1470
|
+
while (true)
|
|
1565
1471
|
{
|
|
1566
|
-
if(read(fds[0], &c, 1) == -1)
|
|
1472
|
+
if (read(fds[0], &c, 1) == -1)
|
|
1567
1473
|
{
|
|
1568
|
-
if(IceInternal::interrupted())
|
|
1474
|
+
if (IceInternal::interrupted())
|
|
1569
1475
|
{
|
|
1570
1476
|
continue;
|
|
1571
1477
|
}
|
|
1572
1478
|
|
|
1573
|
-
if(argv[0])
|
|
1479
|
+
if (argv[0])
|
|
1574
1480
|
{
|
|
1575
1481
|
consoleErr << argv[0] << ": ";
|
|
1576
1482
|
}
|
|
1577
|
-
consoleErr <<
|
|
1483
|
+
consoleErr << IceInternal::errorToString(errno) << endl;
|
|
1578
1484
|
_exit(EXIT_FAILURE);
|
|
1579
1485
|
}
|
|
1580
1486
|
break;
|
|
1581
1487
|
}
|
|
1582
1488
|
|
|
1583
|
-
if(c != 0)
|
|
1489
|
+
if (c != 0)
|
|
1584
1490
|
{
|
|
1585
1491
|
//
|
|
1586
1492
|
// Read an error message.
|
|
@@ -1588,24 +1494,25 @@ Ice::Service::runDaemon(int argc, char* argv[], const InitializationData& initDa
|
|
|
1588
1494
|
ssize_t rs;
|
|
1589
1495
|
char s[16];
|
|
1590
1496
|
string message;
|
|
1591
|
-
while((rs = read(fds[0], &s, 16)) > 0)
|
|
1497
|
+
while ((rs = read(fds[0], &s, 16)) > 0)
|
|
1592
1498
|
{
|
|
1593
1499
|
message.append(s, static_cast<size_t>(rs));
|
|
1594
1500
|
}
|
|
1595
1501
|
|
|
1596
|
-
if(argv[0])
|
|
1502
|
+
if (argv[0])
|
|
1597
1503
|
{
|
|
1598
1504
|
consoleErr << argv[0] << ": ";
|
|
1599
1505
|
}
|
|
1600
1506
|
|
|
1601
|
-
if(rs == -1)
|
|
1507
|
+
if (rs == -1)
|
|
1602
1508
|
{
|
|
1603
|
-
consoleErr << "I/O error while reading error message from child:\n"
|
|
1509
|
+
consoleErr << "I/O error while reading error message from child:\n"
|
|
1510
|
+
<< IceInternal::errorToString(errno);
|
|
1604
1511
|
}
|
|
1605
1512
|
else
|
|
1606
1513
|
{
|
|
1607
1514
|
consoleErr << "failure occurred in daemon";
|
|
1608
|
-
if(!message.empty())
|
|
1515
|
+
if (!message.empty())
|
|
1609
1516
|
{
|
|
1610
1517
|
consoleErr << ":\n" << message;
|
|
1611
1518
|
}
|
|
@@ -1628,43 +1535,43 @@ Ice::Service::runDaemon(int argc, char* argv[], const InitializationData& initDa
|
|
|
1628
1535
|
//
|
|
1629
1536
|
// Become a session and process group leader.
|
|
1630
1537
|
//
|
|
1631
|
-
if(setsid() == -1)
|
|
1538
|
+
if (setsid() == -1)
|
|
1632
1539
|
{
|
|
1633
|
-
throw SyscallException
|
|
1540
|
+
throw SyscallException{__FILE__, __LINE__, "setsid failed", errno};
|
|
1634
1541
|
}
|
|
1635
1542
|
|
|
1636
1543
|
//
|
|
1637
1544
|
// Ignore SIGHUP so that the grandchild process is not sent SIGHUP when this
|
|
1638
1545
|
// process exits.
|
|
1639
1546
|
//
|
|
1640
|
-
signal(SIGHUP, SIG_IGN);
|
|
1547
|
+
signal(SIGHUP, SIG_IGN); // NOLINT(cert-err33-c)
|
|
1641
1548
|
|
|
1642
1549
|
//
|
|
1643
1550
|
// Fork again to eliminate the possibility of acquiring a controlling terminal.
|
|
1644
1551
|
//
|
|
1645
1552
|
pid = fork();
|
|
1646
|
-
if(pid < 0)
|
|
1553
|
+
if (pid < 0)
|
|
1647
1554
|
{
|
|
1648
|
-
throw SyscallException
|
|
1555
|
+
throw SyscallException{__FILE__, __LINE__, "fork failed", errno};
|
|
1649
1556
|
}
|
|
1650
|
-
if(pid != 0)
|
|
1557
|
+
if (pid != 0)
|
|
1651
1558
|
{
|
|
1652
1559
|
exit(0);
|
|
1653
1560
|
}
|
|
1654
1561
|
|
|
1655
|
-
if(_changeDirectory)
|
|
1562
|
+
if (_changeDirectory)
|
|
1656
1563
|
{
|
|
1657
1564
|
//
|
|
1658
1565
|
// Change the working directory.
|
|
1659
1566
|
//
|
|
1660
|
-
if(chdir("/") != 0)
|
|
1567
|
+
if (chdir("/") != 0)
|
|
1661
1568
|
{
|
|
1662
|
-
throw SyscallException
|
|
1569
|
+
throw SyscallException{__FILE__, __LINE__, "chdir failed", errno};
|
|
1663
1570
|
}
|
|
1664
1571
|
}
|
|
1665
1572
|
|
|
1666
1573
|
vector<int> fdsToClose;
|
|
1667
|
-
if(_closeFiles)
|
|
1574
|
+
if (_closeFiles)
|
|
1668
1575
|
{
|
|
1669
1576
|
//
|
|
1670
1577
|
// Take a snapshot of the open file descriptors. We don't actually close these
|
|
@@ -1673,21 +1580,21 @@ Ice::Service::runDaemon(int argc, char* argv[], const InitializationData& initDa
|
|
|
1673
1580
|
// conveniently allows the Ice.PrintProcessId property to work as expected.
|
|
1674
1581
|
//
|
|
1675
1582
|
int fdMax = static_cast<int>(sysconf(_SC_OPEN_MAX));
|
|
1676
|
-
if(fdMax <= 0)
|
|
1583
|
+
if (fdMax <= 0)
|
|
1677
1584
|
{
|
|
1678
|
-
throw SyscallException
|
|
1585
|
+
throw SyscallException{__FILE__, __LINE__, "sysconf failed", errno};
|
|
1679
1586
|
}
|
|
1680
1587
|
|
|
1681
|
-
for(int i = 0; i < fdMax; ++i)
|
|
1588
|
+
for (int i = 0; i < fdMax; ++i)
|
|
1682
1589
|
{
|
|
1683
|
-
if(fcntl(i, F_GETFL) != -1)
|
|
1590
|
+
if (fcntl(i, F_GETFL) != -1)
|
|
1684
1591
|
{
|
|
1685
1592
|
//
|
|
1686
1593
|
// Don't close the write end of the pipe.
|
|
1687
1594
|
//
|
|
1688
|
-
if(i != fds[1])
|
|
1595
|
+
if (i != fds[1])
|
|
1689
1596
|
{
|
|
1690
|
-
|
|
1597
|
+
fdsToClose.push_back(i);
|
|
1691
1598
|
}
|
|
1692
1599
|
}
|
|
1693
1600
|
}
|
|
@@ -1700,32 +1607,32 @@ Ice::Service::runDaemon(int argc, char* argv[], const InitializationData& initDa
|
|
|
1700
1607
|
// communicator thread pools currently use lazy initialization, but a thread can
|
|
1701
1608
|
// be created to monitor connections.
|
|
1702
1609
|
//
|
|
1703
|
-
|
|
1610
|
+
ctrlCHandler = new CtrlCHandler;
|
|
1704
1611
|
|
|
1705
1612
|
//
|
|
1706
1613
|
// Initialize the communicator.
|
|
1707
1614
|
//
|
|
1708
|
-
_communicator = initializeCommunicator(argc, argv, initData
|
|
1615
|
+
_communicator = initializeCommunicator(argc, argv, std::move(initData));
|
|
1709
1616
|
|
|
1710
|
-
if(_closeFiles)
|
|
1617
|
+
if (_closeFiles)
|
|
1711
1618
|
{
|
|
1712
1619
|
//
|
|
1713
1620
|
// Close unnecessary file descriptors.
|
|
1714
1621
|
//
|
|
1715
1622
|
PropertiesPtr properties = _communicator->getProperties();
|
|
1716
|
-
string stdOut = properties->
|
|
1717
|
-
string stdErr = properties->
|
|
1623
|
+
string stdOut = properties->getIceProperty("Ice.StdOut");
|
|
1624
|
+
string stdErr = properties->getIceProperty("Ice.StdErr");
|
|
1718
1625
|
|
|
1719
|
-
for(
|
|
1626
|
+
for (int& p : fdsToClose)
|
|
1720
1627
|
{
|
|
1721
1628
|
//
|
|
1722
1629
|
// NOTE: Do not close stdout if Ice.StdOut is defined. Likewise for Ice.StdErr.
|
|
1723
1630
|
//
|
|
1724
|
-
if((
|
|
1631
|
+
if ((p == 1 && !stdOut.empty()) || (p == 2 && !stdErr.empty()))
|
|
1725
1632
|
{
|
|
1726
1633
|
continue;
|
|
1727
1634
|
}
|
|
1728
|
-
close(
|
|
1635
|
+
close(p);
|
|
1729
1636
|
}
|
|
1730
1637
|
|
|
1731
1638
|
//
|
|
@@ -1733,26 +1640,26 @@ Ice::Service::runDaemon(int argc, char* argv[], const InitializationData& initDa
|
|
|
1733
1640
|
//
|
|
1734
1641
|
int fd = open("/dev/null", O_RDWR);
|
|
1735
1642
|
assert(fd == 0);
|
|
1736
|
-
if(fd != 0)
|
|
1643
|
+
if (fd != 0)
|
|
1737
1644
|
{
|
|
1738
|
-
throw SyscallException
|
|
1645
|
+
throw SyscallException{__FILE__, __LINE__, "open /dev/null failed", errno};
|
|
1739
1646
|
}
|
|
1740
|
-
if(stdOut.empty())
|
|
1647
|
+
if (stdOut.empty())
|
|
1741
1648
|
{
|
|
1742
1649
|
fd = dup2(0, 1);
|
|
1743
1650
|
assert(fd == 1);
|
|
1744
|
-
if(fd != 1)
|
|
1651
|
+
if (fd != 1)
|
|
1745
1652
|
{
|
|
1746
|
-
throw SyscallException
|
|
1653
|
+
throw SyscallException{__FILE__, __LINE__, "dup2(0, 1) failed", errno};
|
|
1747
1654
|
}
|
|
1748
1655
|
}
|
|
1749
|
-
if(stdErr.empty())
|
|
1656
|
+
if (stdErr.empty())
|
|
1750
1657
|
{
|
|
1751
1658
|
fd = dup2(1, 2);
|
|
1752
1659
|
assert(fd == 2);
|
|
1753
|
-
if(fd != 2)
|
|
1660
|
+
if (fd != 2)
|
|
1754
1661
|
{
|
|
1755
|
-
throw SyscallException
|
|
1662
|
+
throw SyscallException{__FILE__, __LINE__, "dup2(1, 2) failed", errno};
|
|
1756
1663
|
}
|
|
1757
1664
|
}
|
|
1758
1665
|
}
|
|
@@ -1760,12 +1667,12 @@ Ice::Service::runDaemon(int argc, char* argv[], const InitializationData& initDa
|
|
|
1760
1667
|
//
|
|
1761
1668
|
// Write PID
|
|
1762
1669
|
//
|
|
1763
|
-
if(_pidFile.size() > 0)
|
|
1670
|
+
if (_pidFile.size() > 0)
|
|
1764
1671
|
{
|
|
1765
1672
|
ofstream of(_pidFile.c_str());
|
|
1766
1673
|
of << getpid() << endl;
|
|
1767
1674
|
|
|
1768
|
-
if(!of)
|
|
1675
|
+
if (!of)
|
|
1769
1676
|
{
|
|
1770
1677
|
warning("Could not write PID file " + _pidFile);
|
|
1771
1678
|
}
|
|
@@ -1779,17 +1686,17 @@ Ice::Service::runDaemon(int argc, char* argv[], const InitializationData& initDa
|
|
|
1779
1686
|
//
|
|
1780
1687
|
// Start the service.
|
|
1781
1688
|
//
|
|
1782
|
-
if(start(argc, argv, status))
|
|
1689
|
+
if (start(argc, argv, status))
|
|
1783
1690
|
{
|
|
1784
1691
|
//
|
|
1785
1692
|
// Notify the parent that the child is ready.
|
|
1786
1693
|
//
|
|
1787
1694
|
char c = 0;
|
|
1788
|
-
while(true)
|
|
1695
|
+
while (true)
|
|
1789
1696
|
{
|
|
1790
|
-
if(write(fds[1], &c, 1) == -1)
|
|
1697
|
+
if (write(fds[1], &c, 1) == -1)
|
|
1791
1698
|
{
|
|
1792
|
-
if(IceInternal::interrupted())
|
|
1699
|
+
if (IceInternal::interrupted())
|
|
1793
1700
|
{
|
|
1794
1701
|
continue;
|
|
1795
1702
|
}
|
|
@@ -1807,25 +1714,25 @@ Ice::Service::runDaemon(int argc, char* argv[], const InitializationData& initDa
|
|
|
1807
1714
|
//
|
|
1808
1715
|
// Stop the service.
|
|
1809
1716
|
//
|
|
1810
|
-
if(stop())
|
|
1717
|
+
if (stop())
|
|
1811
1718
|
{
|
|
1812
1719
|
status = EXIT_SUCCESS;
|
|
1813
1720
|
}
|
|
1814
1721
|
}
|
|
1815
1722
|
}
|
|
1816
|
-
catch(const Ice::Exception& ex)
|
|
1723
|
+
catch (const Ice::Exception& ex)
|
|
1817
1724
|
{
|
|
1818
1725
|
ServiceError err(this);
|
|
1819
1726
|
err << "service terminating after catching exception:\n" << ex;
|
|
1820
1727
|
errMsg = err.str();
|
|
1821
1728
|
}
|
|
1822
|
-
catch(const std::exception& ex)
|
|
1729
|
+
catch (const std::exception& ex)
|
|
1823
1730
|
{
|
|
1824
1731
|
ServiceError err(this);
|
|
1825
1732
|
err << "service terminating after catching exception:\n" << ex;
|
|
1826
1733
|
errMsg = err.str();
|
|
1827
1734
|
}
|
|
1828
|
-
catch(...)
|
|
1735
|
+
catch (...)
|
|
1829
1736
|
{
|
|
1830
1737
|
errMsg = "service terminating after catching unknown exception";
|
|
1831
1738
|
error(errMsg);
|
|
@@ -1835,14 +1742,14 @@ Ice::Service::runDaemon(int argc, char* argv[], const InitializationData& initDa
|
|
|
1835
1742
|
// If the service failed and the pipe to the parent is still open,
|
|
1836
1743
|
// then send an error notification to the parent.
|
|
1837
1744
|
//
|
|
1838
|
-
if(status != EXIT_SUCCESS && fds[1] != -1)
|
|
1745
|
+
if (status != EXIT_SUCCESS && fds[1] != -1)
|
|
1839
1746
|
{
|
|
1840
1747
|
char c = 1;
|
|
1841
|
-
while(true)
|
|
1748
|
+
while (true)
|
|
1842
1749
|
{
|
|
1843
|
-
if(write(fds[1], &c, 1) == -1)
|
|
1750
|
+
if (write(fds[1], &c, 1) == -1)
|
|
1844
1751
|
{
|
|
1845
|
-
if(IceInternal::interrupted())
|
|
1752
|
+
if (IceInternal::interrupted())
|
|
1846
1753
|
{
|
|
1847
1754
|
continue;
|
|
1848
1755
|
}
|
|
@@ -1852,12 +1759,12 @@ Ice::Service::runDaemon(int argc, char* argv[], const InitializationData& initDa
|
|
|
1852
1759
|
const char* msg = errMsg.c_str();
|
|
1853
1760
|
size_t len = strlen(msg) + 1; // Include null byte
|
|
1854
1761
|
size_t pos = 0;
|
|
1855
|
-
while(len > 0)
|
|
1762
|
+
while (len > 0)
|
|
1856
1763
|
{
|
|
1857
1764
|
ssize_t n = write(fds[1], &msg[pos], len);
|
|
1858
|
-
if(n == -1)
|
|
1765
|
+
if (n == -1)
|
|
1859
1766
|
{
|
|
1860
|
-
if(IceInternal::interrupted())
|
|
1767
|
+
if (IceInternal::interrupted())
|
|
1861
1768
|
{
|
|
1862
1769
|
continue;
|
|
1863
1770
|
}
|
|
@@ -1872,7 +1779,7 @@ Ice::Service::runDaemon(int argc, char* argv[], const InitializationData& initDa
|
|
|
1872
1779
|
close(fds[1]);
|
|
1873
1780
|
}
|
|
1874
1781
|
|
|
1875
|
-
if(_communicator)
|
|
1782
|
+
if (_communicator)
|
|
1876
1783
|
{
|
|
1877
1784
|
_communicator->destroy();
|
|
1878
1785
|
}
|