zeroc-ice 3.8.1 → 3.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/dist/IceRuby/Communicator.cpp +26 -9
- data/dist/IceRuby/Config.h +0 -12
- data/dist/IceRuby/Connection.cpp +18 -9
- data/dist/IceRuby/DefaultSliceLoader.h +1 -1
- data/dist/IceRuby/Endpoint.cpp +21 -8
- data/dist/IceRuby/Operation.cpp +29 -11
- data/dist/IceRuby/Properties.cpp +3 -4
- data/dist/IceRuby/Proxy.cpp +11 -19
- data/dist/IceRuby/RubySliceLoader.cpp +1 -1
- data/dist/IceRuby/RubySliceLoader.h +6 -0
- data/dist/IceRuby/Types.cpp +162 -138
- data/dist/IceRuby/Types.h +68 -28
- data/dist/IceRuby/Util.cpp +14 -78
- data/dist/IceRuby/Util.h +7 -17
- data/dist/ice/cpp/include/Ice/Communicator.h +31 -8
- data/dist/ice/cpp/include/Ice/Config.h +2 -2
- data/dist/ice/cpp/include/Ice/Connection.h +24 -8
- data/dist/ice/cpp/include/Ice/CtrlCHandler.h +1 -1
- data/dist/ice/cpp/include/Ice/Demangle.h +1 -1
- data/dist/ice/cpp/include/Ice/Endpoint.h +4 -4
- data/dist/ice/cpp/include/Ice/Initialize.h +4 -4
- data/dist/ice/cpp/include/Ice/InputStream.h +5 -5
- data/dist/ice/cpp/include/Ice/Instrumentation.h +13 -7
- data/dist/ice/cpp/include/Ice/LocalExceptions.h +26 -5
- data/dist/ice/cpp/include/Ice/Logger.h +7 -0
- data/dist/ice/cpp/include/Ice/LoggerUtil.h +1 -1
- data/dist/ice/cpp/include/Ice/Object.h +10 -8
- data/dist/ice/cpp/include/Ice/ObjectAdapter.h +1 -1
- data/dist/ice/cpp/include/Ice/OutgoingAsync.h +5 -2
- data/dist/ice/cpp/include/Ice/OutgoingResponse.h +2 -1
- data/dist/ice/cpp/include/Ice/OutputStream.h +14 -11
- data/dist/ice/cpp/include/Ice/PluginFactory.h +1 -1
- data/dist/ice/cpp/include/Ice/Properties.h +3 -3
- data/dist/ice/cpp/include/Ice/Proxy.h +192 -50
- data/dist/ice/cpp/include/Ice/SSL/ClientAuthenticationOptions.h +3 -3
- data/dist/ice/cpp/include/Ice/SSL/EndpointInfo.h +1 -1
- data/dist/ice/cpp/include/Ice/SSL/ServerAuthenticationOptions.h +5 -5
- data/dist/ice/cpp/include/Ice/ServantLocator.h +1 -1
- data/dist/ice/cpp/include/Ice/Service.h +2 -5
- data/dist/ice/cpp/include/Ice/SliceLoader.h +1 -1
- data/dist/ice/cpp/include/Ice/SlicedData.h +5 -3
- data/dist/ice/cpp/include/Ice/StreamHelpers.h +1 -1
- data/dist/ice/cpp/include/Ice/StreamableTraits.h +2 -2
- data/dist/ice/cpp/include/Ice/StringConverter.h +2 -3
- data/dist/ice/cpp/include/Ice/StringUtil.h +2 -7
- data/dist/ice/cpp/include/Ice/UUID.h +1 -0
- data/dist/ice/cpp/include/Ice/Value.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/BuiltinSequences.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Context.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/EndpointTypes.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Identity.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Locator.h +57 -23
- data/dist/ice/cpp/include/generated/Ice/LocatorRegistry.h +38 -11
- data/dist/ice/cpp/include/generated/Ice/Metrics.h +99 -44
- data/dist/ice/cpp/include/generated/Ice/OperationMode.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Process.h +34 -8
- data/dist/ice/cpp/include/generated/Ice/PropertiesAdmin.h +42 -11
- data/dist/ice/cpp/include/generated/Ice/PropertyDict.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/RemoteLogger.h +93 -40
- data/dist/ice/cpp/include/generated/Ice/ReplyStatus.h +8 -4
- data/dist/ice/cpp/include/generated/Ice/Router.h +55 -19
- data/dist/ice/cpp/include/generated/Ice/SliceChecksumDict.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Version.h +2 -2
- data/dist/ice/cpp/include/generated/IceDiscovery/Lookup.h +66 -14
- data/dist/ice/cpp/include/generated/IceLocatorDiscovery/Lookup.h +34 -8
- data/dist/ice/cpp/src/Ice/AddDefaultPluginFactories_all.cpp +1 -1
- data/dist/ice/cpp/src/Ice/Base64.cpp +47 -137
- data/dist/ice/cpp/src/Ice/Base64.h +2 -2
- data/dist/ice/cpp/src/Ice/BatchRequestQueue.cpp +28 -13
- data/dist/ice/cpp/src/Ice/BatchRequestQueue.h +5 -1
- data/dist/ice/cpp/src/Ice/Buffer.cpp +1 -1
- data/dist/ice/cpp/src/Ice/CollocatedRequestHandler.cpp +6 -4
- data/dist/ice/cpp/src/Ice/CollocatedRequestHandler.h +1 -1
- data/dist/ice/cpp/src/Ice/Communicator.cpp +4 -3
- data/dist/ice/cpp/src/Ice/CommunicatorFlushBatchAsync.cpp +8 -0
- data/dist/ice/cpp/src/Ice/ConnectRequestHandler.cpp +5 -15
- data/dist/ice/cpp/src/Ice/ConnectRequestHandler.h +1 -1
- data/dist/ice/cpp/src/Ice/ConnectionFactory.cpp +6 -8
- data/dist/ice/cpp/src/Ice/ConnectionFactory.h +0 -3
- data/dist/ice/cpp/src/Ice/ConnectionI.cpp +121 -108
- data/dist/ice/cpp/src/Ice/ConnectionI.h +12 -9
- data/dist/ice/cpp/src/Ice/ConsoleUtil.cpp +1 -1
- data/dist/ice/cpp/src/Ice/DefaultsAndOverrides.cpp +10 -14
- data/dist/ice/cpp/src/Ice/EndpointI.h +1 -1
- data/dist/ice/cpp/src/Ice/FileUtil.cpp +15 -79
- data/dist/ice/cpp/src/Ice/FileUtil.h +0 -3
- data/dist/ice/cpp/src/Ice/FixedRequestHandler.cpp +1 -1
- data/dist/ice/cpp/src/Ice/FixedRequestHandler.h +1 -1
- data/dist/ice/cpp/src/Ice/HttpParser.h +0 -2
- data/dist/ice/cpp/src/Ice/IPEndpointI.cpp +4 -0
- data/dist/ice/cpp/src/Ice/IdleTimeoutTransceiverDecorator.cpp +6 -3
- data/dist/ice/cpp/src/Ice/IncomingRequest.cpp +2 -4
- data/dist/ice/cpp/src/Ice/InputStream.cpp +50 -33
- data/dist/ice/cpp/src/Ice/Instance.cpp +73 -50
- data/dist/ice/cpp/src/Ice/Instance.h +1 -6
- data/dist/ice/cpp/src/Ice/LocalExceptions.cpp +7 -1
- data/dist/ice/cpp/src/Ice/LocatorInfo.cpp +2 -2
- data/dist/ice/cpp/src/Ice/LoggerAdminI.cpp +13 -18
- data/dist/ice/cpp/src/Ice/LoggerI.cpp +1 -1
- data/dist/ice/cpp/src/Ice/LoggerI.h +2 -2
- data/dist/ice/cpp/src/Ice/MetricsAdminI.h +6 -1
- data/dist/ice/cpp/src/Ice/MetricsObserverI.h +22 -18
- data/dist/ice/cpp/src/Ice/NativePropertiesAdmin.cpp +5 -2
- data/dist/ice/cpp/src/Ice/Network.cpp +168 -103
- data/dist/ice/cpp/src/Ice/Network.h +12 -7
- data/dist/ice/cpp/src/Ice/NetworkProxy.cpp +17 -6
- data/dist/ice/cpp/src/Ice/NetworkProxy.h +2 -1
- data/dist/ice/cpp/src/Ice/Object.cpp +1 -1
- data/dist/ice/cpp/src/Ice/ObjectAdapterI.cpp +56 -19
- data/dist/ice/cpp/src/Ice/OpaqueEndpointI.cpp +10 -10
- data/dist/ice/cpp/src/Ice/Options.cpp +7 -2
- data/dist/ice/cpp/src/Ice/OutgoingAsync.cpp +2 -2
- data/dist/ice/cpp/src/Ice/OutgoingResponse.cpp +127 -127
- data/dist/ice/cpp/src/Ice/OutgoingResponseInternal.h +21 -0
- data/dist/ice/cpp/src/Ice/OutputStream.cpp +50 -65
- data/dist/ice/cpp/src/Ice/PluginManagerI.cpp +7 -1
- data/dist/ice/cpp/src/Ice/Properties.cpp +26 -16
- data/dist/ice/cpp/src/Ice/PropertyNames.cpp +2 -1
- data/dist/ice/cpp/src/Ice/PropertyUtil.cpp +1 -1
- data/dist/ice/cpp/src/Ice/ProtocolInstance.cpp +0 -11
- data/dist/ice/cpp/src/Ice/ProtocolInstance.h +1 -2
- data/dist/ice/cpp/src/Ice/Proxy.cpp +9 -1
- data/dist/ice/cpp/src/Ice/ProxyAsync.cpp +110 -13
- data/dist/ice/cpp/src/Ice/ProxyFunctions.cpp +4 -4
- data/dist/ice/cpp/src/Ice/Random.cpp +68 -7
- data/dist/ice/cpp/src/Ice/Random.h +6 -2
- data/dist/ice/cpp/src/Ice/Reference.cpp +37 -26
- data/dist/ice/cpp/src/Ice/Reference.h +3 -0
- data/dist/ice/cpp/src/Ice/ReferenceFactory.cpp +26 -13
- data/dist/ice/cpp/src/Ice/RequestHandler.h +3 -1
- data/dist/ice/cpp/src/Ice/RequestHandlerCache.cpp +1 -1
- data/dist/ice/cpp/src/Ice/RequestHandlerCache.h +1 -1
- data/dist/ice/cpp/src/Ice/ResourceConfig.h +3 -3
- data/dist/ice/cpp/src/Ice/RetryQueue.cpp +8 -12
- data/dist/ice/cpp/src/Ice/SHA1.cpp +11 -11
- data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.cpp +0 -6
- data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.h +0 -6
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngine.cpp +27 -12
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngine.h +1 -2
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.cpp +77 -27
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.h +2 -1
- data/dist/ice/cpp/src/Ice/SSL/RFC2253.cpp +2 -2
- data/dist/ice/cpp/src/Ice/SSL/SSLEndpointI.cpp +1 -1
- data/dist/ice/cpp/src/Ice/SSL/SSLEngine.h +1 -4
- data/dist/ice/cpp/src/Ice/SSL/SSLUtil.cpp +39 -34
- data/dist/ice/cpp/src/Ice/SSL/SchannelEngine.cpp +165 -80
- data/dist/ice/cpp/src/Ice/SSL/SchannelEngine.h +1 -5
- data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.cpp +73 -33
- data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.h +0 -1
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngine.cpp +110 -17
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngine.h +7 -2
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportTransceiverI.cpp +9 -3
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.cpp +73 -51
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.h +0 -8
- data/dist/ice/cpp/src/Ice/Selector.cpp +13 -11
- data/dist/ice/cpp/src/Ice/ServantManager.cpp +3 -3
- data/dist/ice/cpp/src/Ice/Service.cpp +33 -115
- data/dist/ice/cpp/src/Ice/StreamSocket.cpp +33 -40
- data/dist/ice/cpp/src/Ice/StreamSocket.h +4 -4
- data/dist/ice/cpp/src/Ice/StringConverter.cpp +1 -1
- data/dist/ice/cpp/src/Ice/StringUtil.cpp +12 -21
- data/dist/ice/cpp/src/Ice/SysLoggerI.cpp +136 -100
- data/dist/ice/cpp/src/Ice/SysLoggerI.h +7 -3
- data/dist/ice/cpp/src/Ice/SystemdJournalI.cpp +1 -1
- data/dist/ice/cpp/src/Ice/TcpAcceptor.cpp +7 -7
- data/dist/ice/cpp/src/Ice/TcpAcceptor.h +2 -1
- data/dist/ice/cpp/src/Ice/TcpBufSize.h +40 -0
- data/dist/ice/cpp/src/Ice/TcpConnector.cpp +5 -2
- data/dist/ice/cpp/src/Ice/TcpConnector.h +2 -0
- data/dist/ice/cpp/src/Ice/TcpEndpointI.cpp +2 -2
- data/dist/ice/cpp/src/Ice/TcpTransceiver.cpp +6 -2
- data/dist/ice/cpp/src/Ice/ThreadPool.cpp +2 -8
- data/dist/ice/cpp/src/Ice/ThreadPool.h +0 -2
- data/dist/ice/cpp/src/Ice/Timer.cpp +7 -3
- data/dist/ice/cpp/src/Ice/UUID.cpp +1 -2
- data/dist/ice/cpp/src/Ice/UdpEndpointI.cpp +6 -3
- data/dist/ice/cpp/src/Ice/UdpTransceiver.cpp +136 -123
- data/dist/ice/cpp/src/Ice/UdpTransceiver.h +3 -4
- data/dist/ice/cpp/src/Ice/WSAcceptor.cpp +8 -3
- data/dist/ice/cpp/src/Ice/WSAcceptor.h +5 -1
- data/dist/ice/cpp/src/Ice/WSEndpoint.cpp +45 -2
- data/dist/ice/cpp/src/Ice/WSTransceiver.cpp +214 -34
- data/dist/ice/cpp/src/Ice/WSTransceiver.h +13 -2
- data/dist/ice/cpp/src/Ice/generated/BuiltinSequences.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Context.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/EndpointTypes.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Identity.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Locator.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/LocatorRegistry.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Metrics.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/OperationMode.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Process.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/PropertiesAdmin.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/PropertyDict.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/RemoteLogger.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/ReplyStatus.cpp +4 -2
- data/dist/ice/cpp/src/Ice/generated/Router.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/SliceChecksumDict.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Version.cpp +2 -2
- data/dist/ice/cpp/src/IceDiscovery/LookupI.cpp +47 -9
- data/dist/ice/cpp/src/IceDiscovery/LookupI.h +8 -3
- data/dist/ice/cpp/src/IceDiscovery/generated/Lookup.cpp +2 -2
- data/dist/ice/cpp/src/IceLocatorDiscovery/PluginI.cpp +43 -14
- data/dist/ice/cpp/src/IceLocatorDiscovery/generated/Lookup.cpp +2 -2
- data/dist/ice/cpp/src/Slice/DocCommentParser.cpp +32 -26
- data/dist/ice/cpp/src/Slice/DocCommentParser.h +6 -4
- data/dist/ice/cpp/src/Slice/FileTracker.cpp +3 -11
- data/dist/ice/cpp/src/Slice/FileTracker.h +0 -2
- data/dist/ice/cpp/src/Slice/Grammar.cpp +211 -210
- data/dist/ice/cpp/src/Slice/MetadataValidation.cpp +34 -14
- data/dist/ice/cpp/src/Slice/MetadataValidation.h +3 -2
- data/dist/ice/cpp/src/Slice/Parser.cpp +145 -97
- data/dist/ice/cpp/src/Slice/Parser.h +22 -8
- data/dist/ice/cpp/src/Slice/Preprocessor.cpp +77 -29
- data/dist/ice/cpp/src/Slice/Preprocessor.h +0 -3
- data/dist/ice/cpp/src/Slice/Scanner.cpp +3 -3
- data/dist/ice/cpp/src/Slice/SliceUtil.cpp +203 -172
- data/dist/ice/cpp/src/Slice/StringLiteralUtil.cpp +0 -2
- data/dist/ice/cpp/src/Slice/Util.h +21 -12
- data/dist/ice/cpp/src/slice2rb/Ruby.cpp +7 -3
- data/dist/ice/cpp/src/slice2rb/RubyUtil.cpp +26 -20
- data/dist/ice/cpp/src/slice2rb/RubyUtil.h +10 -13
- data/dist/ice/slice/Glacier2/Router.ice +3 -3
- data/dist/ice/slice/Ice/Identity.ice +3 -0
- data/dist/ice/slice/Ice/Locator.ice +6 -5
- data/dist/ice/slice/Ice/LocatorRegistry.ice +3 -0
- data/dist/ice/slice/Ice/Metrics.ice +7 -6
- data/dist/ice/slice/Ice/OperationMode.ice +8 -0
- data/dist/ice/slice/Ice/Process.ice +3 -0
- data/dist/ice/slice/Ice/RemoteLogger.ice +5 -5
- data/dist/ice/slice/Ice/ReplyStatus.ice +13 -0
- data/dist/ice/slice/IceGrid/Admin.ice +9 -9
- data/dist/ice/slice/IceGrid/Descriptor.ice +5 -5
- data/dist/ice/slice/IceStorm/Metrics.ice +1 -1
- data/dist/lib/Glacier2/Metrics.rb +1 -1
- data/dist/lib/Glacier2/PermissionsVerifier.rb +3 -3
- data/dist/lib/Glacier2/Router.rb +9 -9
- data/dist/lib/Glacier2/SSLInfo.rb +1 -1
- data/dist/lib/Glacier2/Session.rb +15 -15
- data/dist/lib/Ice/BuiltinSequences.rb +1 -1
- data/dist/lib/Ice/CompressBatch.rb +1 -2
- data/dist/lib/Ice/Context.rb +1 -1
- data/dist/lib/Ice/EndpointSelectionType.rb +1 -2
- data/dist/lib/Ice/EndpointTypes.rb +1 -1
- data/dist/lib/Ice/Identity.rb +1 -1
- data/dist/lib/Ice/IdentitySpaceship.rb +1 -0
- data/dist/lib/Ice/LocalExceptions.rb +3 -0
- data/dist/lib/Ice/Locator.rb +5 -5
- data/dist/lib/Ice/LocatorRegistry.rb +4 -4
- data/dist/lib/Ice/Metrics.rb +7 -7
- data/dist/lib/Ice/OperationMode.rb +2 -3
- data/dist/lib/Ice/Process.rb +3 -3
- data/dist/lib/Ice/PropertiesAdmin.rb +4 -4
- data/dist/lib/Ice/PropertyDict.rb +1 -1
- data/dist/lib/Ice/ProxyFunctions.rb +8 -4
- data/dist/lib/Ice/RemoteLogger.rb +7 -8
- data/dist/lib/Ice/ReplyStatus.rb +4 -4
- data/dist/lib/Ice/Router.rb +5 -5
- data/dist/lib/Ice/SliceChecksumDict.rb +1 -1
- data/dist/lib/Ice/SliceUtil.rb +2 -2
- data/dist/lib/Ice/Struct.rb +1 -0
- data/dist/lib/Ice/ToStringMode.rb +1 -2
- data/dist/lib/Ice/Value.rb +2 -2
- data/dist/lib/Ice/Version.rb +1 -1
- data/dist/lib/IceBox/ServiceManager.rb +8 -8
- data/dist/lib/IceGrid/Admin.rb +85 -86
- data/dist/lib/IceGrid/Descriptor.rb +1 -1
- data/dist/lib/IceGrid/Exception.rb +1 -1
- data/dist/lib/IceGrid/FileParser.rb +2 -2
- data/dist/lib/IceGrid/Registry.rb +14 -15
- data/dist/lib/IceGrid/Session.rb +7 -7
- data/dist/lib/IceGrid/UserAccountMapper.rb +2 -2
- data/dist/lib/IceStorm/IceStorm.rb +16 -16
- data/dist/lib/IceStorm/Metrics.rb +1 -1
- data/extconf.rb +1 -1
- data/ice.gemspec +3 -3
- metadata +5 -5
- data/dist/ice/cpp/src/Ice/DLLMain.cpp +0 -40
- data/dist/ice/cpp/src/Ice/UndefSysMacros.h +0 -37
|
@@ -4,145 +4,181 @@
|
|
|
4
4
|
|
|
5
5
|
# include "SysLoggerI.h"
|
|
6
6
|
# include "Ice/LocalExceptions.h"
|
|
7
|
+
|
|
8
|
+
# include <mutex>
|
|
7
9
|
# include <syslog.h>
|
|
8
10
|
|
|
9
11
|
using namespace std;
|
|
10
12
|
using namespace Ice;
|
|
11
13
|
using namespace IceInternal;
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
namespace
|
|
14
16
|
{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
17
|
+
// openlog/closelog and the syslog ident are process-global, and openlog retains the ident pointer rather than
|
|
18
|
+
// copying it. All SysLoggerI instances therefore share a single openlog call: the first instance donates its
|
|
19
|
+
// prefix as the process-wide ident, and the last instance to be destroyed calls closelog. sysLogMutex guards
|
|
20
|
+
// this state and serializes the syslog calls.
|
|
21
|
+
mutex sysLogMutex;
|
|
22
|
+
int sysLogCount = 0;
|
|
23
|
+
|
|
24
|
+
// Intentionally leaked: openlog retains the ident pointer, and a logger stored in a global can still call syslog
|
|
25
|
+
// during static destruction, so this buffer must never be freed.
|
|
26
|
+
string& sysLogIdent = *new string; // NOLINT(cert-err58-cpp)
|
|
27
|
+
|
|
28
|
+
int parseFacility(string_view facilityString)
|
|
29
|
+
{
|
|
30
|
+
if (facilityString == "LOG_KERN")
|
|
31
|
+
{
|
|
32
|
+
return LOG_KERN;
|
|
33
|
+
}
|
|
34
|
+
else if (facilityString == "LOG_USER")
|
|
35
|
+
{
|
|
36
|
+
return LOG_USER;
|
|
37
|
+
}
|
|
38
|
+
else if (facilityString == "LOG_MAIL")
|
|
39
|
+
{
|
|
40
|
+
return LOG_MAIL;
|
|
41
|
+
}
|
|
42
|
+
else if (facilityString == "LOG_DAEMON")
|
|
43
|
+
{
|
|
44
|
+
return LOG_DAEMON;
|
|
45
|
+
}
|
|
46
|
+
else if (facilityString == "LOG_AUTH")
|
|
47
|
+
{
|
|
48
|
+
return LOG_AUTH;
|
|
49
|
+
}
|
|
50
|
+
else if (facilityString == "LOG_SYSLOG")
|
|
51
|
+
{
|
|
52
|
+
return LOG_SYSLOG;
|
|
53
|
+
}
|
|
54
|
+
else if (facilityString == "LOG_LPR")
|
|
55
|
+
{
|
|
56
|
+
return LOG_LPR;
|
|
57
|
+
}
|
|
58
|
+
else if (facilityString == "LOG_NEWS")
|
|
59
|
+
{
|
|
60
|
+
return LOG_NEWS;
|
|
61
|
+
}
|
|
62
|
+
else if (facilityString == "LOG_UUCP")
|
|
63
|
+
{
|
|
64
|
+
return LOG_UUCP;
|
|
65
|
+
}
|
|
66
|
+
else if (facilityString == "LOG_CRON")
|
|
67
|
+
{
|
|
68
|
+
return LOG_CRON;
|
|
69
|
+
}
|
|
55
70
|
# ifdef LOG_AUTHPRIV
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
71
|
+
else if (facilityString == "LOG_AUTHPRIV")
|
|
72
|
+
{
|
|
73
|
+
return LOG_AUTHPRIV;
|
|
74
|
+
}
|
|
60
75
|
# endif
|
|
61
76
|
# ifdef LOG_FTP
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
77
|
+
else if (facilityString == "LOG_FTP")
|
|
78
|
+
{
|
|
79
|
+
return LOG_FTP;
|
|
80
|
+
}
|
|
66
81
|
# endif
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
82
|
+
else if (facilityString == "LOG_LOCAL0")
|
|
83
|
+
{
|
|
84
|
+
return LOG_LOCAL0;
|
|
85
|
+
}
|
|
86
|
+
else if (facilityString == "LOG_LOCAL1")
|
|
87
|
+
{
|
|
88
|
+
return LOG_LOCAL1;
|
|
89
|
+
}
|
|
90
|
+
else if (facilityString == "LOG_LOCAL2")
|
|
91
|
+
{
|
|
92
|
+
return LOG_LOCAL2;
|
|
93
|
+
}
|
|
94
|
+
else if (facilityString == "LOG_LOCAL3")
|
|
95
|
+
{
|
|
96
|
+
return LOG_LOCAL3;
|
|
97
|
+
}
|
|
98
|
+
else if (facilityString == "LOG_LOCAL4")
|
|
99
|
+
{
|
|
100
|
+
return LOG_LOCAL4;
|
|
101
|
+
}
|
|
102
|
+
else if (facilityString == "LOG_LOCAL5")
|
|
103
|
+
{
|
|
104
|
+
return LOG_LOCAL5;
|
|
105
|
+
}
|
|
106
|
+
else if (facilityString == "LOG_LOCAL6")
|
|
107
|
+
{
|
|
108
|
+
return LOG_LOCAL6;
|
|
109
|
+
}
|
|
110
|
+
else if (facilityString == "LOG_LOCAL7")
|
|
111
|
+
{
|
|
112
|
+
return LOG_LOCAL7;
|
|
113
|
+
}
|
|
114
|
+
else
|
|
115
|
+
{
|
|
116
|
+
throw InitializationException(
|
|
117
|
+
__FILE__,
|
|
118
|
+
__LINE__,
|
|
119
|
+
"Invalid value for Ice.SyslogFacility: " + string{facilityString});
|
|
120
|
+
}
|
|
94
121
|
}
|
|
95
|
-
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
Ice::SysLoggerI::SysLoggerI(string prefix, string_view facilityString)
|
|
125
|
+
: SysLoggerI(std::move(prefix), parseFacility(facilityString))
|
|
126
|
+
{
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
Ice::SysLoggerI::SysLoggerI(string prefix, int facility) : _facility(facility), _prefix(std::move(prefix))
|
|
130
|
+
{
|
|
131
|
+
lock_guard lock(sysLogMutex);
|
|
132
|
+
if (sysLogCount++ == 0)
|
|
96
133
|
{
|
|
97
|
-
|
|
134
|
+
sysLogIdent = _prefix;
|
|
135
|
+
// The facility argument is only a default for syslog calls that don't specify one; each log method passes
|
|
136
|
+
// this logger's facility with the message priority.
|
|
137
|
+
openlog(sysLogIdent.c_str(), LOG_PID | LOG_CONS, 0);
|
|
98
138
|
}
|
|
99
|
-
|
|
139
|
+
if (!_prefix.empty() && _prefix != sysLogIdent)
|
|
100
140
|
{
|
|
101
|
-
|
|
102
|
-
__FILE__,
|
|
103
|
-
__LINE__,
|
|
104
|
-
"Invalid value for Ice.SyslogFacility: " + string{facilityString});
|
|
141
|
+
_bodyPrefix = _prefix + ": ";
|
|
105
142
|
}
|
|
106
|
-
|
|
107
|
-
int logopt = LOG_PID | LOG_CONS;
|
|
108
|
-
openlog(_prefix.c_str(), logopt, _facility);
|
|
109
143
|
}
|
|
110
144
|
|
|
111
|
-
Ice::SysLoggerI
|
|
145
|
+
Ice::SysLoggerI::~SysLoggerI()
|
|
112
146
|
{
|
|
113
|
-
|
|
114
|
-
|
|
147
|
+
lock_guard lock(sysLogMutex);
|
|
148
|
+
if (--sysLogCount == 0)
|
|
149
|
+
{
|
|
150
|
+
closelog();
|
|
151
|
+
}
|
|
115
152
|
}
|
|
116
153
|
|
|
117
|
-
Ice::SysLoggerI::~SysLoggerI() { closelog(); }
|
|
118
|
-
|
|
119
154
|
void
|
|
120
155
|
Ice::SysLoggerI::print(const string& message)
|
|
121
156
|
{
|
|
122
|
-
|
|
123
|
-
|
|
157
|
+
// The Logger contract requires these methods not to throw, so we let syslog do the formatting instead of
|
|
158
|
+
// building a std::string that could throw bad_alloc.
|
|
159
|
+
lock_guard lock(sysLogMutex);
|
|
160
|
+
syslog(_facility | LOG_INFO, "%s%s", _bodyPrefix.c_str(), message.c_str());
|
|
124
161
|
}
|
|
125
162
|
|
|
126
163
|
void
|
|
127
164
|
Ice::SysLoggerI::trace(const string& category, const string& message)
|
|
128
165
|
{
|
|
129
|
-
lock_guard lock(
|
|
130
|
-
|
|
131
|
-
syslog(LOG_INFO, "%s", s.c_str());
|
|
166
|
+
lock_guard lock(sysLogMutex);
|
|
167
|
+
syslog(_facility | LOG_INFO, "%s%s: %s", _bodyPrefix.c_str(), category.c_str(), message.c_str());
|
|
132
168
|
}
|
|
133
169
|
|
|
134
170
|
void
|
|
135
171
|
Ice::SysLoggerI::warning(const string& message)
|
|
136
172
|
{
|
|
137
|
-
lock_guard lock(
|
|
138
|
-
syslog(LOG_WARNING, "%s", message.c_str());
|
|
173
|
+
lock_guard lock(sysLogMutex);
|
|
174
|
+
syslog(_facility | LOG_WARNING, "%s%s", _bodyPrefix.c_str(), message.c_str());
|
|
139
175
|
}
|
|
140
176
|
|
|
141
177
|
void
|
|
142
178
|
Ice::SysLoggerI::error(const string& message)
|
|
143
179
|
{
|
|
144
|
-
lock_guard lock(
|
|
145
|
-
syslog(LOG_ERR, "%s", message.c_str());
|
|
180
|
+
lock_guard lock(sysLogMutex);
|
|
181
|
+
syslog(_facility | LOG_ERR, "%s%s", _bodyPrefix.c_str(), message.c_str());
|
|
146
182
|
}
|
|
147
183
|
|
|
148
184
|
string
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
#include "Ice/Logger.h"
|
|
7
7
|
|
|
8
|
-
#include <mutex>
|
|
9
8
|
#include <string_view>
|
|
10
9
|
|
|
11
10
|
namespace Ice
|
|
@@ -17,6 +16,9 @@ namespace Ice
|
|
|
17
16
|
SysLoggerI(std::string prefix, int facility);
|
|
18
17
|
~SysLoggerI() override;
|
|
19
18
|
|
|
19
|
+
SysLoggerI(const SysLoggerI&) = delete;
|
|
20
|
+
SysLoggerI& operator=(const SysLoggerI&) = delete;
|
|
21
|
+
|
|
20
22
|
void print(const std::string&) final;
|
|
21
23
|
void trace(const std::string&, const std::string&) final;
|
|
22
24
|
void warning(const std::string&) final;
|
|
@@ -25,9 +27,11 @@ namespace Ice
|
|
|
25
27
|
LoggerPtr cloneWithPrefix(std::string) final;
|
|
26
28
|
|
|
27
29
|
private:
|
|
28
|
-
int _facility;
|
|
30
|
+
const int _facility;
|
|
29
31
|
const std::string _prefix;
|
|
30
|
-
|
|
32
|
+
|
|
33
|
+
// Prepended to each message when this logger's prefix differs from the process-wide syslog ident.
|
|
34
|
+
std::string _bodyPrefix;
|
|
31
35
|
};
|
|
32
36
|
}
|
|
33
37
|
|
|
@@ -59,7 +59,7 @@ Ice::SystemdJournalI::write(int priority, const string& message) const
|
|
|
59
59
|
priority,
|
|
60
60
|
"SYSLOG_IDENTIFIER=%s",
|
|
61
61
|
_prefix.c_str(),
|
|
62
|
-
NULL); //
|
|
62
|
+
NULL); // The sd_journal_send argument list must be NULL-terminated.
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
#endif
|
|
@@ -96,7 +96,7 @@ IceInternal::TcpAcceptor::startAccept()
|
|
|
96
96
|
_acceptFd = createSocket(false, _addr);
|
|
97
97
|
const int sz = static_cast<int>(_acceptBuf.size() / 2);
|
|
98
98
|
_info.error = ERROR_SUCCESS;
|
|
99
|
-
if (!AcceptEx(_fd, _acceptFd,
|
|
99
|
+
if (!AcceptEx(_fd, _acceptFd, _acceptBuf.data(), 0, sz, sz, &_info.count, &_info))
|
|
100
100
|
{
|
|
101
101
|
if (!wouldBlock())
|
|
102
102
|
{
|
|
@@ -123,8 +123,7 @@ IceInternal::TcpAcceptor::accept()
|
|
|
123
123
|
{
|
|
124
124
|
throw SocketException(__FILE__, __LINE__, _acceptError);
|
|
125
125
|
}
|
|
126
|
-
if (setsockopt(_acceptFd, SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT, (char*)&
|
|
127
|
-
SOCKET_ERROR)
|
|
126
|
+
if (setsockopt(_acceptFd, SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT, (char*)&_fd, sizeof(_fd)) == SOCKET_ERROR)
|
|
128
127
|
{
|
|
129
128
|
closeSocketNoThrow(_acceptFd);
|
|
130
129
|
_acceptFd = INVALID_SOCKET;
|
|
@@ -133,14 +132,14 @@ IceInternal::TcpAcceptor::accept()
|
|
|
133
132
|
|
|
134
133
|
SOCKET fd = _acceptFd;
|
|
135
134
|
_acceptFd = INVALID_SOCKET;
|
|
136
|
-
return make_shared<TcpTransceiver>(_instance, make_shared<StreamSocket>(_instance, fd));
|
|
135
|
+
return make_shared<TcpTransceiver>(_instance, make_shared<StreamSocket>(_instance, fd, _bufSize));
|
|
137
136
|
}
|
|
138
137
|
# else
|
|
139
138
|
|
|
140
139
|
TransceiverPtr
|
|
141
140
|
IceInternal::TcpAcceptor::accept()
|
|
142
141
|
{
|
|
143
|
-
return make_shared<TcpTransceiver>(_instance, make_shared<StreamSocket>(_instance, doAccept(_fd)));
|
|
142
|
+
return make_shared<TcpTransceiver>(_instance, make_shared<StreamSocket>(_instance, doAccept(_fd), _bufSize));
|
|
144
143
|
}
|
|
145
144
|
|
|
146
145
|
# endif
|
|
@@ -178,7 +177,8 @@ IceInternal::TcpAcceptor::TcpAcceptor(
|
|
|
178
177
|
int port)
|
|
179
178
|
: _endpoint(std::move(endpoint)),
|
|
180
179
|
_instance(instance),
|
|
181
|
-
_addr(getAddressForServer(host, port, _instance->protocolSupport(), instance->preferIPv6(), true))
|
|
180
|
+
_addr(getAddressForServer(host, port, _instance->protocolSupport(), instance->preferIPv6(), true)),
|
|
181
|
+
_bufSize(instance->properties())
|
|
182
182
|
# ifdef ICE_USE_IOCP
|
|
183
183
|
,
|
|
184
184
|
_acceptFd(INVALID_SOCKET),
|
|
@@ -193,7 +193,7 @@ IceInternal::TcpAcceptor::TcpAcceptor(
|
|
|
193
193
|
# endif
|
|
194
194
|
|
|
195
195
|
setBlock(_fd, false);
|
|
196
|
-
setTcpBufSize(_fd, _instance);
|
|
196
|
+
setTcpBufSize(_fd, _bufSize.rcvSize(), _bufSize.sndSize(), _instance);
|
|
197
197
|
|
|
198
198
|
# ifndef _WIN32
|
|
199
199
|
// Set SO_REUSEADDR socket option on Unix platforms to allow re-using the address even if the socket remains in
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
#include "Acceptor.h"
|
|
7
7
|
#include "Network.h"
|
|
8
8
|
#include "ProtocolInstanceF.h"
|
|
9
|
+
#include "TcpBufSize.h"
|
|
9
10
|
#include "TransceiverF.h"
|
|
10
11
|
|
|
11
12
|
namespace IceInternal
|
|
12
13
|
{
|
|
13
|
-
class TcpEndpoint;
|
|
14
14
|
|
|
15
15
|
class TcpAcceptor final : public Acceptor, public NativeInfo, public std::enable_shared_from_this<TcpAcceptor>
|
|
16
16
|
{
|
|
@@ -42,6 +42,7 @@ namespace IceInternal
|
|
|
42
42
|
TcpEndpointIPtr _endpoint;
|
|
43
43
|
const ProtocolInstancePtr _instance;
|
|
44
44
|
const Address _addr;
|
|
45
|
+
const TcpBufSize _bufSize;
|
|
45
46
|
|
|
46
47
|
int _backlog;
|
|
47
48
|
#if defined(ICE_USE_IOCP)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Copyright (c) ZeroC, Inc.
|
|
2
|
+
|
|
3
|
+
#ifndef ICE_TCP_BUF_SIZE_H
|
|
4
|
+
#define ICE_TCP_BUF_SIZE_H
|
|
5
|
+
|
|
6
|
+
#include "Ice/Properties.h"
|
|
7
|
+
|
|
8
|
+
#include <cstdint>
|
|
9
|
+
|
|
10
|
+
namespace IceInternal
|
|
11
|
+
{
|
|
12
|
+
// The TCP send and receive buffer sizes, as configured by the Ice.TCP.SndSize and Ice.TCP.RcvSize properties.
|
|
13
|
+
class TcpBufSize
|
|
14
|
+
{
|
|
15
|
+
public:
|
|
16
|
+
// Reads the Ice.TCP.RcvSize and Ice.TCP.SndSize properties. Throws PropertyException if a value is not a
|
|
17
|
+
// valid integer.
|
|
18
|
+
explicit TcpBufSize(const Ice::PropertiesPtr& properties)
|
|
19
|
+
: _rcvSize(properties->getPropertyAsIntWithDefault("Ice.TCP.RcvSize", dfltBufSize)),
|
|
20
|
+
_sndSize(properties->getPropertyAsIntWithDefault("Ice.TCP.SndSize", dfltBufSize))
|
|
21
|
+
{
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
[[nodiscard]] std::int32_t rcvSize() const noexcept { return _rcvSize; }
|
|
25
|
+
[[nodiscard]] std::int32_t sndSize() const noexcept { return _sndSize; }
|
|
26
|
+
|
|
27
|
+
private:
|
|
28
|
+
// By default, on Windows we use a 128KB buffer size. On Unix platforms, we use the system defaults.
|
|
29
|
+
#ifdef _WIN32
|
|
30
|
+
static constexpr std::int32_t dfltBufSize = 128 * 1024;
|
|
31
|
+
#else
|
|
32
|
+
static constexpr std::int32_t dfltBufSize = 0;
|
|
33
|
+
#endif
|
|
34
|
+
|
|
35
|
+
std::int32_t _rcvSize;
|
|
36
|
+
std::int32_t _sndSize;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
#endif
|
|
@@ -22,7 +22,9 @@ using namespace IceInternal;
|
|
|
22
22
|
TransceiverPtr
|
|
23
23
|
IceInternal::TcpConnector::connect()
|
|
24
24
|
{
|
|
25
|
-
return make_shared<TcpTransceiver>(
|
|
25
|
+
return make_shared<TcpTransceiver>(
|
|
26
|
+
_instance,
|
|
27
|
+
make_shared<StreamSocket>(_instance, _proxy, _addr, _sourceAddr, _bufSize));
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
int16_t
|
|
@@ -120,7 +122,8 @@ IceInternal::TcpConnector::TcpConnector(
|
|
|
120
122
|
_proxy(std::move(proxy)),
|
|
121
123
|
_sourceAddr(sourceAddr),
|
|
122
124
|
_timeout(timeout),
|
|
123
|
-
_connectionId(std::move(connectionId))
|
|
125
|
+
_connectionId(std::move(connectionId)),
|
|
126
|
+
_bufSize(_instance->properties())
|
|
124
127
|
{
|
|
125
128
|
}
|
|
126
129
|
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
#include "Connector.h"
|
|
7
7
|
#include "Network.h"
|
|
8
8
|
#include "ProtocolInstanceF.h"
|
|
9
|
+
#include "TcpBufSize.h"
|
|
9
10
|
#include "TransceiverF.h"
|
|
10
11
|
|
|
11
12
|
namespace IceInternal
|
|
@@ -30,6 +31,7 @@ namespace IceInternal
|
|
|
30
31
|
const Address _sourceAddr;
|
|
31
32
|
const std::int32_t _timeout;
|
|
32
33
|
const std::string _connectionId;
|
|
34
|
+
const TcpBufSize _bufSize;
|
|
33
35
|
};
|
|
34
36
|
}
|
|
35
37
|
|
|
@@ -169,7 +169,7 @@ AcceptorPtr
|
|
|
169
169
|
IceInternal::TcpEndpointI::acceptor(const string&, const optional<Ice::SSL::ServerAuthenticationOptions>&) const
|
|
170
170
|
{
|
|
171
171
|
return make_shared<TcpAcceptor>(
|
|
172
|
-
|
|
172
|
+
static_pointer_cast<TcpEndpointI>(const_cast<TcpEndpointI*>(this)->shared_from_this()),
|
|
173
173
|
_instance,
|
|
174
174
|
_host,
|
|
175
175
|
_port);
|
|
@@ -181,7 +181,7 @@ IceInternal::TcpEndpointI::endpoint(const TcpAcceptorPtr& acceptor) const
|
|
|
181
181
|
int port = acceptor->effectivePort();
|
|
182
182
|
if (_port == port)
|
|
183
183
|
{
|
|
184
|
-
return
|
|
184
|
+
return static_pointer_cast<TcpEndpointI>(const_cast<TcpEndpointI*>(this)->shared_from_this());
|
|
185
185
|
}
|
|
186
186
|
else
|
|
187
187
|
{
|
|
@@ -113,6 +113,10 @@ IceInternal::TcpTransceiver::getInfo(bool incoming, string adapterName, string c
|
|
|
113
113
|
string remoteAddress;
|
|
114
114
|
int remotePort;
|
|
115
115
|
fdToAddressAndPort(_stream->fd(), localAddress, localPort, remoteAddress, remotePort);
|
|
116
|
+
|
|
117
|
+
int rcvSize = getRecvBufferSizeNoThrow(_stream->fd());
|
|
118
|
+
int sndSize = getSendBufferSizeNoThrow(_stream->fd());
|
|
119
|
+
|
|
116
120
|
return make_shared<TCPConnectionInfo>(
|
|
117
121
|
incoming,
|
|
118
122
|
std::move(adapterName),
|
|
@@ -121,8 +125,8 @@ IceInternal::TcpTransceiver::getInfo(bool incoming, string adapterName, string c
|
|
|
121
125
|
localPort,
|
|
122
126
|
std::move(remoteAddress),
|
|
123
127
|
remotePort,
|
|
124
|
-
|
|
125
|
-
|
|
128
|
+
rcvSize,
|
|
129
|
+
sndSize);
|
|
126
130
|
}
|
|
127
131
|
}
|
|
128
132
|
|
|
@@ -468,12 +468,6 @@ IceInternal::ThreadPool::joinWithAllThreads()
|
|
|
468
468
|
_selector.destroy();
|
|
469
469
|
}
|
|
470
470
|
|
|
471
|
-
string
|
|
472
|
-
IceInternal::ThreadPool::prefix() const
|
|
473
|
-
{
|
|
474
|
-
return _prefix;
|
|
475
|
-
}
|
|
476
|
-
|
|
477
471
|
void
|
|
478
472
|
IceInternal::ThreadPool::run(const EventHandlerThreadPtr& thread)
|
|
479
473
|
{
|
|
@@ -554,7 +548,7 @@ IceInternal::ThreadPool::run(const EventHandlerThreadPtr& thread)
|
|
|
554
548
|
{
|
|
555
549
|
//
|
|
556
550
|
// If the handler called ioCompleted(), we re-enable the handler in
|
|
557
|
-
// case it was disabled and we decrease the number of
|
|
551
|
+
// case it was disabled and we decrease the number of threads in use.
|
|
558
552
|
//
|
|
559
553
|
if (_serialize && current._handler.get() != _workQueue.get())
|
|
560
554
|
{
|
|
@@ -805,7 +799,7 @@ IceInternal::ThreadPool::ioCompleted(ThreadPoolCurrent& current)
|
|
|
805
799
|
}
|
|
806
800
|
}
|
|
807
801
|
|
|
808
|
-
return _serialize && current._handler.get() != _workQueue.get();
|
|
802
|
+
return _sizeMax > 1 && _serialize && current._handler.get() != _workQueue.get();
|
|
809
803
|
}
|
|
810
804
|
|
|
811
805
|
#if defined(ICE_USE_IOCP)
|
|
@@ -19,6 +19,10 @@ Timer::destroy()
|
|
|
19
19
|
{
|
|
20
20
|
throw std::runtime_error("a timer task cannot destroy the timer");
|
|
21
21
|
}
|
|
22
|
+
// Destroy the tasks after the lock is released and the worker joined: a task's destructor can re-enter the timer
|
|
23
|
+
// via cancel() (e.g. when it holds the last reference to a connection), which would deadlock while _mutex is held.
|
|
24
|
+
std::set<Token> tokens;
|
|
25
|
+
std::map<TimerTaskPtr, std::chrono::steady_clock::time_point> tasks;
|
|
22
26
|
{
|
|
23
27
|
std::lock_guard lock(_mutex);
|
|
24
28
|
if (_destroyed)
|
|
@@ -26,8 +30,8 @@ Timer::destroy()
|
|
|
26
30
|
return;
|
|
27
31
|
}
|
|
28
32
|
_destroyed = true;
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
tokens.swap(_tokens);
|
|
34
|
+
tasks.swap(_tasks);
|
|
31
35
|
_condition.notify_one();
|
|
32
36
|
}
|
|
33
37
|
_worker.join();
|
|
@@ -135,7 +139,7 @@ Timer::run()
|
|
|
135
139
|
{
|
|
136
140
|
// If the task is not a repeated task, clear the task reference now rather than
|
|
137
141
|
// in the synchronization block above. Clearing the task reference might end up
|
|
138
|
-
// calling user code which could trigger a deadlock.
|
|
142
|
+
// calling user code which could trigger a deadlock.
|
|
139
143
|
token.task = nullptr;
|
|
140
144
|
}
|
|
141
145
|
}
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
#include "Ice/UUID.h"
|
|
4
4
|
|
|
5
|
-
// We use
|
|
6
|
-
// (std::random_device) to generate "version 4" UUIDs, as described in
|
|
5
|
+
// We use the operating system's CSPRNG (see Random.h) to generate "version 4" UUIDs, as described in
|
|
7
6
|
// http://www.ietf.org/internet-drafts/draft-mealling-uuid-urn-00.txt
|
|
8
7
|
#include "Random.h"
|
|
9
8
|
|
|
@@ -162,7 +162,7 @@ TransceiverPtr
|
|
|
162
162
|
IceInternal::UdpEndpointI::transceiver() const
|
|
163
163
|
{
|
|
164
164
|
return make_shared<UdpTransceiver>(
|
|
165
|
-
|
|
165
|
+
static_pointer_cast<UdpEndpointI>(const_cast<UdpEndpointI*>(this)->shared_from_this()),
|
|
166
166
|
_instance,
|
|
167
167
|
_host,
|
|
168
168
|
_port,
|
|
@@ -181,7 +181,7 @@ IceInternal::UdpEndpointI::endpoint(const UdpTransceiverPtr& transceiver) const
|
|
|
181
181
|
int port = transceiver->effectivePort();
|
|
182
182
|
if (port == _port)
|
|
183
183
|
{
|
|
184
|
-
return
|
|
184
|
+
return static_pointer_cast<UdpEndpointI>(const_cast<UdpEndpointI*>(this)->shared_from_this());
|
|
185
185
|
}
|
|
186
186
|
else
|
|
187
187
|
{
|
|
@@ -227,7 +227,10 @@ IceInternal::UdpEndpointI::options() const
|
|
|
227
227
|
if (_mcastInterface.length() > 0)
|
|
228
228
|
{
|
|
229
229
|
s << " --interface ";
|
|
230
|
-
|
|
230
|
+
// Quote the interface if it contains a character that would be re-parsed as a separator: whitespace, on
|
|
231
|
+
// which the endpoint parser splits options (e.g. a Windows adapter name like "Ethernet 2"), or ':', on
|
|
232
|
+
// which the proxy-string parser splits endpoints (e.g. an IPv6 interface address).
|
|
233
|
+
bool addQuote = _mcastInterface.find_first_of(" :\t\n\r") != string::npos;
|
|
231
234
|
if (addQuote)
|
|
232
235
|
{
|
|
233
236
|
s << "\"";
|