zeroc-ice 3.6.2 → 3.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. checksums.yaml +4 -4
  2. data/bin/slice2rb +0 -0
  3. data/ext/Slice.cpp +32 -39
  4. data/ext/ice/cpp/include/Ice/BasicStream.h +15 -4
  5. data/ext/ice/cpp/include/Ice/BuiltinSequences.h +2 -2
  6. data/ext/ice/cpp/include/Ice/Communicator.h +2 -2
  7. data/ext/ice/cpp/include/Ice/CommunicatorF.h +2 -2
  8. data/ext/ice/cpp/include/Ice/Connection.h +2 -2
  9. data/ext/ice/cpp/include/Ice/ConnectionF.h +2 -2
  10. data/ext/ice/cpp/include/Ice/Current.h +2 -2
  11. data/ext/ice/cpp/include/Ice/Endpoint.h +2 -2
  12. data/ext/ice/cpp/include/Ice/EndpointF.h +2 -2
  13. data/ext/ice/cpp/include/Ice/EndpointTypes.h +2 -2
  14. data/ext/ice/cpp/include/Ice/FacetMap.h +2 -2
  15. data/ext/ice/cpp/include/Ice/Identity.h +2 -2
  16. data/ext/ice/cpp/include/Ice/ImplicitContext.h +2 -2
  17. data/ext/ice/cpp/include/Ice/ImplicitContextF.h +2 -2
  18. data/ext/ice/cpp/include/Ice/Instrumentation.h +2 -2
  19. data/ext/ice/cpp/include/Ice/InstrumentationF.h +2 -2
  20. data/ext/ice/cpp/include/Ice/LocalException.h +2 -2
  21. data/ext/ice/cpp/include/Ice/Locator.h +2 -2
  22. data/ext/ice/cpp/include/Ice/LocatorF.h +2 -2
  23. data/ext/ice/cpp/include/Ice/Logger.h +2 -2
  24. data/ext/ice/cpp/include/Ice/LoggerF.h +2 -2
  25. data/ext/ice/cpp/include/Ice/Metrics.h +2 -2
  26. data/ext/ice/cpp/include/Ice/ObjectAdapter.h +2 -2
  27. data/ext/ice/cpp/include/Ice/ObjectAdapterF.h +2 -2
  28. data/ext/ice/cpp/include/Ice/ObjectFactory.h +2 -2
  29. data/ext/ice/cpp/include/Ice/ObjectFactoryF.h +2 -2
  30. data/ext/ice/cpp/include/Ice/Plugin.h +2 -2
  31. data/ext/ice/cpp/include/Ice/PluginF.h +2 -2
  32. data/ext/ice/cpp/include/Ice/Process.h +2 -2
  33. data/ext/ice/cpp/include/Ice/ProcessF.h +2 -2
  34. data/ext/ice/cpp/include/Ice/Properties.h +2 -2
  35. data/ext/ice/cpp/include/Ice/PropertiesAdmin.h +2 -2
  36. data/ext/ice/cpp/include/Ice/PropertiesF.h +2 -2
  37. data/ext/ice/cpp/include/Ice/RemoteLogger.h +2 -2
  38. data/ext/ice/cpp/include/Ice/Router.h +2 -2
  39. data/ext/ice/cpp/include/Ice/RouterF.h +2 -2
  40. data/ext/ice/cpp/include/Ice/ServantLocator.h +2 -2
  41. data/ext/ice/cpp/include/Ice/ServantLocatorF.h +2 -2
  42. data/ext/ice/cpp/include/Ice/SliceChecksumDict.h +2 -2
  43. data/ext/ice/cpp/include/Ice/SlicedData.h +6 -0
  44. data/ext/ice/cpp/include/Ice/Version.h +2 -2
  45. data/ext/ice/cpp/include/IceSSL/ConnectionInfo.h +2 -2
  46. data/ext/ice/cpp/include/IceSSL/EndpointInfo.h +2 -2
  47. data/ext/ice/cpp/include/IceUtil/Config.h +86 -26
  48. data/ext/ice/cpp/include/IceUtil/IconvStringConverter.h +1 -1
  49. data/ext/ice/cpp/include/IceUtil/Time.h +3 -2
  50. data/ext/ice/cpp/include/Slice/PythonUtil.h +1 -1
  51. data/ext/ice/cpp/include/Slice/RubyUtil.h +1 -1
  52. data/ext/ice/cpp/include/Slice/Util.h +5 -0
  53. data/ext/ice/cpp/src/Ice/BuiltinSequences.cpp +2 -2
  54. data/ext/ice/cpp/src/Ice/Communicator.cpp +2 -2
  55. data/ext/ice/cpp/src/Ice/CommunicatorF.cpp +2 -2
  56. data/ext/ice/cpp/src/Ice/Connection.cpp +2 -2
  57. data/ext/ice/cpp/src/Ice/ConnectionF.cpp +2 -2
  58. data/ext/ice/cpp/src/Ice/ConnectionFactory.cpp +57 -42
  59. data/ext/ice/cpp/src/Ice/ConnectionFactory.h +2 -0
  60. data/ext/ice/cpp/src/Ice/Current.cpp +2 -2
  61. data/ext/ice/cpp/src/Ice/DynamicLibrary.cpp +9 -5
  62. data/ext/ice/cpp/src/Ice/Endpoint.cpp +2 -2
  63. data/ext/ice/cpp/src/Ice/EndpointF.cpp +2 -2
  64. data/ext/ice/cpp/src/Ice/EndpointTypes.cpp +2 -2
  65. data/ext/ice/cpp/src/Ice/FacetMap.cpp +2 -2
  66. data/ext/ice/cpp/src/Ice/Identity.cpp +2 -2
  67. data/ext/ice/cpp/src/Ice/ImplicitContext.cpp +2 -2
  68. data/ext/ice/cpp/src/Ice/ImplicitContextF.cpp +2 -2
  69. data/ext/ice/cpp/src/Ice/Incoming.cpp +11 -4
  70. data/ext/ice/cpp/src/Ice/Instance.cpp +4 -2
  71. data/ext/ice/cpp/src/Ice/Instrumentation.cpp +2 -2
  72. data/ext/ice/cpp/src/Ice/InstrumentationF.cpp +2 -2
  73. data/ext/ice/cpp/src/Ice/InstrumentationI.cpp +1 -3
  74. data/ext/ice/cpp/src/Ice/LocalException.cpp +2 -2
  75. data/ext/ice/cpp/src/Ice/Locator.cpp +2 -2
  76. data/ext/ice/cpp/src/Ice/LocatorF.cpp +2 -2
  77. data/ext/ice/cpp/src/Ice/Logger.cpp +2 -2
  78. data/ext/ice/cpp/src/Ice/LoggerF.cpp +2 -2
  79. data/ext/ice/cpp/src/Ice/LoggerI.cpp +94 -5
  80. data/ext/ice/cpp/src/Ice/LoggerI.h +7 -1
  81. data/ext/ice/cpp/src/Ice/Metrics.cpp +2 -2
  82. data/ext/ice/cpp/src/Ice/Network.cpp +23 -7
  83. data/ext/ice/cpp/src/Ice/Network.h +1 -1
  84. data/ext/ice/cpp/src/Ice/ObjectAdapter.cpp +2 -2
  85. data/ext/ice/cpp/src/Ice/ObjectAdapterF.cpp +2 -2
  86. data/ext/ice/cpp/src/Ice/ObjectFactory.cpp +2 -2
  87. data/ext/ice/cpp/src/Ice/ObjectFactoryF.cpp +2 -2
  88. data/ext/ice/cpp/src/Ice/Plugin.cpp +2 -2
  89. data/ext/ice/cpp/src/Ice/PluginF.cpp +2 -2
  90. data/ext/ice/cpp/src/Ice/PluginManagerI.cpp +5 -0
  91. data/ext/ice/cpp/src/Ice/Process.cpp +2 -2
  92. data/ext/ice/cpp/src/Ice/ProcessF.cpp +2 -2
  93. data/ext/ice/cpp/src/Ice/Properties.cpp +2 -2
  94. data/ext/ice/cpp/src/Ice/PropertiesAdmin.cpp +2 -2
  95. data/ext/ice/cpp/src/Ice/PropertiesF.cpp +2 -2
  96. data/ext/ice/cpp/src/Ice/PropertyNames.cpp +4 -3
  97. data/ext/ice/cpp/src/Ice/PropertyNames.h +1 -1
  98. data/ext/ice/cpp/src/Ice/RemoteLogger.cpp +2 -2
  99. data/ext/ice/cpp/src/Ice/RetryQueue.cpp +1 -1
  100. data/ext/ice/cpp/src/Ice/Router.cpp +2 -2
  101. data/ext/ice/cpp/src/Ice/RouterF.cpp +2 -2
  102. data/ext/ice/cpp/src/Ice/ServantLocator.cpp +2 -2
  103. data/ext/ice/cpp/src/Ice/ServantLocatorF.cpp +2 -2
  104. data/ext/ice/cpp/src/Ice/SliceChecksumDict.cpp +2 -2
  105. data/ext/ice/cpp/src/Ice/StreamSocket.cpp +19 -3
  106. data/ext/ice/cpp/src/Ice/Version.cpp +2 -2
  107. data/ext/ice/cpp/src/Ice/WSConnector.h +2 -2
  108. data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.cpp +2 -2
  109. data/ext/ice/cpp/src/IceDiscovery/IceDiscovery.h +2 -2
  110. data/ext/ice/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.cpp +2 -2
  111. data/ext/ice/cpp/src/IceLocatorDiscovery/IceLocatorDiscovery.h +2 -2
  112. data/ext/ice/cpp/src/IceSSL/ConnectionInfo.cpp +2 -2
  113. data/ext/ice/cpp/src/IceSSL/EndpointInfo.cpp +2 -2
  114. data/ext/ice/cpp/src/IceSSL/OpenSSLEngine.cpp +54 -39
  115. data/ext/ice/cpp/src/IceSSL/SecureTransportTransceiverI.cpp +5 -8
  116. data/ext/ice/cpp/src/IceSSL/Util.cpp +155 -4
  117. data/ext/ice/cpp/src/IceUtil/Cond.cpp +1 -1
  118. data/ext/ice/cpp/src/IceUtil/FileUtil.cpp +8 -0
  119. data/ext/ice/cpp/src/IceUtil/FileUtil.h +18 -5
  120. data/ext/ice/cpp/src/IceUtil/OutputUtil.cpp +5 -5
  121. data/ext/ice/cpp/src/IceUtil/Time.cpp +25 -17
  122. data/ext/ice/cpp/src/Slice/JavaUtil.cpp +5 -11
  123. data/ext/ice/cpp/src/Slice/Preprocessor.cpp +3 -3
  124. data/ext/ice/cpp/src/Slice/Python.cpp +14 -17
  125. data/ext/ice/cpp/src/Slice/PythonUtil.cpp +183 -48
  126. data/ext/ice/cpp/src/Slice/Ruby.cpp +6 -6
  127. data/ext/ice/cpp/src/Slice/RubyUtil.cpp +0 -10
  128. data/ext/ice/cpp/src/Slice/Util.cpp +28 -3
  129. data/ext/ice/mcpp/Makefile +10 -6
  130. data/ext/ice/mcpp/configed.H +3 -0
  131. data/ext/ice/mcpp/main.c +2 -2
  132. data/ext/ice/mcpp/mcpp.gyp +6 -0
  133. data/ext/ice/mcpp/support.c +1 -1
  134. data/ext/ice/mcpp/system.H +6 -1
  135. data/ext/ice/mcpp/system.c +52 -15
  136. data/ice.gemspec +1 -1
  137. data/lib/Glacier2/Metrics.rb +1 -1
  138. data/lib/Glacier2/PermissionsVerifier.rb +1 -1
  139. data/lib/Glacier2/PermissionsVerifierF.rb +1 -1
  140. data/lib/Glacier2/Router.rb +1 -1
  141. data/lib/Glacier2/RouterF.rb +1 -1
  142. data/lib/Glacier2/SSLInfo.rb +1 -1
  143. data/lib/Glacier2/Session.rb +1 -1
  144. data/lib/Ice/BuiltinSequences.rb +1 -1
  145. data/lib/Ice/Communicator.rb +1 -1
  146. data/lib/Ice/CommunicatorF.rb +1 -1
  147. data/lib/Ice/Connection.rb +1 -1
  148. data/lib/Ice/ConnectionF.rb +1 -1
  149. data/lib/Ice/Current.rb +1 -1
  150. data/lib/Ice/Endpoint.rb +1 -1
  151. data/lib/Ice/EndpointF.rb +1 -1
  152. data/lib/Ice/EndpointTypes.rb +1 -1
  153. data/lib/Ice/FacetMap.rb +1 -1
  154. data/lib/Ice/Identity.rb +1 -1
  155. data/lib/Ice/ImplicitContext.rb +1 -1
  156. data/lib/Ice/ImplicitContextF.rb +1 -1
  157. data/lib/Ice/Instrumentation.rb +1 -1
  158. data/lib/Ice/InstrumentationF.rb +1 -1
  159. data/lib/Ice/LocalException.rb +1 -1
  160. data/lib/Ice/Locator.rb +1 -1
  161. data/lib/Ice/LocatorF.rb +1 -1
  162. data/lib/Ice/Logger.rb +1 -1
  163. data/lib/Ice/LoggerF.rb +1 -1
  164. data/lib/Ice/Metrics.rb +1 -1
  165. data/lib/Ice/ObjectAdapterF.rb +1 -1
  166. data/lib/Ice/ObjectFactory.rb +1 -1
  167. data/lib/Ice/ObjectFactoryF.rb +1 -1
  168. data/lib/Ice/Plugin.rb +1 -1
  169. data/lib/Ice/PluginF.rb +1 -1
  170. data/lib/Ice/Process.rb +1 -1
  171. data/lib/Ice/ProcessF.rb +1 -1
  172. data/lib/Ice/Properties.rb +1 -1
  173. data/lib/Ice/PropertiesAdmin.rb +1 -1
  174. data/lib/Ice/PropertiesF.rb +1 -1
  175. data/lib/Ice/RemoteLogger.rb +1 -1
  176. data/lib/Ice/Router.rb +1 -1
  177. data/lib/Ice/RouterF.rb +1 -1
  178. data/lib/Ice/SliceChecksumDict.rb +1 -1
  179. data/lib/Ice/Version.rb +1 -1
  180. data/lib/IceBox/IceBox.rb +1 -1
  181. data/lib/IceGrid/Admin.rb +1 -1
  182. data/lib/IceGrid/Descriptor.rb +1 -1
  183. data/lib/IceGrid/Exception.rb +1 -1
  184. data/lib/IceGrid/FileParser.rb +1 -1
  185. data/lib/IceGrid/Locator.rb +1 -1
  186. data/lib/IceGrid/Observer.rb +1 -1
  187. data/lib/IceGrid/Query.rb +1 -1
  188. data/lib/IceGrid/Registry.rb +1 -1
  189. data/lib/IceGrid/Session.rb +1 -1
  190. data/lib/IceGrid/UserAccountMapper.rb +1 -1
  191. data/lib/IcePatch2/FileInfo.rb +1 -1
  192. data/lib/IcePatch2/FileServer.rb +1 -1
  193. data/lib/IceStorm/IceStorm.rb +1 -1
  194. data/lib/IceStorm/Metrics.rb +1 -1
  195. data/slice/Glacier2/PermissionsVerifier.ice +0 -3
  196. data/slice/Glacier2/Session.ice +2 -9
  197. data/slice/Ice/Communicator.ice +3 -3
  198. data/slice/Ice/ImplicitContext.ice +4 -5
  199. data/slice/Ice/Instrumentation.ice +26 -26
  200. data/slice/Ice/LocalException.ice +1 -1
  201. data/slice/Ice/Locator.ice +5 -3
  202. data/slice/Ice/Metrics.ice +1 -1
  203. data/slice/Ice/ObjectFactory.ice +0 -2
  204. data/slice/Ice/RemoteLogger.ice +32 -32
  205. data/slice/Ice/Router.ice +3 -0
  206. data/slice/IceGrid/Session.ice +5 -9
  207. data/slice/IceLocatorDiscovery/IceLocatorDiscovery.ice +7 -7
  208. data/slice/IcePatch2/FileServer.ice +28 -34
  209. metadata +30 -30
@@ -7,7 +7,7 @@
7
7
  //
8
8
  // **********************************************************************
9
9
  //
10
- // Ice version 3.6.2
10
+ // Ice version 3.6.3
11
11
  //
12
12
  // <auto-generated>
13
13
  //
@@ -33,7 +33,7 @@
33
33
  # if ICE_INT_VERSION % 100 > 50
34
34
  # error Beta header file detected
35
35
  # endif
36
- # if ICE_INT_VERSION % 100 < 2
36
+ # if ICE_INT_VERSION % 100 < 3
37
37
  # error Ice patch level mismatch!
38
38
  # endif
39
39
  #endif
@@ -178,11 +178,18 @@ IceInternal::IncomingBase::__warning(const Exception& ex) const
178
178
 
179
179
  if(_current.con)
180
180
  {
181
- Ice::ConnectionInfoPtr connInfo = _current.con->getInfo();
182
- Ice::IPConnectionInfoPtr ipConnInfo = Ice::IPConnectionInfoPtr::dynamicCast(connInfo);
183
- if(ipConnInfo)
181
+ try
184
182
  {
185
- out << "\nremote host: " << ipConnInfo->remoteAddress << " remote port: " << ipConnInfo->remotePort;
183
+ Ice::ConnectionInfoPtr connInfo = _current.con->getInfo();
184
+ Ice::IPConnectionInfoPtr ipConnInfo = Ice::IPConnectionInfoPtr::dynamicCast(connInfo);
185
+ if(ipConnInfo)
186
+ {
187
+ out << "\nremote host: " << ipConnInfo->remoteAddress << " remote port: " << ipConnInfo->remotePort;
188
+ }
189
+ }
190
+ catch(const Ice::LocalException&)
191
+ {
192
+ // Ignore.
186
193
  }
187
194
  }
188
195
  }
@@ -61,7 +61,7 @@
61
61
  # include <sys/types.h>
62
62
  #endif
63
63
 
64
- #if defined(__linux) || defined(__sun)
64
+ #if defined(__linux) || defined(__sun) || defined(_AIX) || defined(__GLIBC__)
65
65
  # include <grp.h> // for initgroups
66
66
  #endif
67
67
 
@@ -1230,7 +1230,9 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi
1230
1230
  #endif
1231
1231
  if(!logfile.empty())
1232
1232
  {
1233
- _initData.logger = new LoggerI(_initData.properties->getProperty("Ice.ProgramName"), logfile);
1233
+ _initData.logger =
1234
+ new LoggerI(_initData.properties->getProperty("Ice.ProgramName"), logfile, true, 0,
1235
+ _initData.properties->getPropertyAsIntWithDefault("Ice.LogFile.SizeMax", 0));
1234
1236
  }
1235
1237
  else
1236
1238
  {
@@ -7,7 +7,7 @@
7
7
  //
8
8
  // **********************************************************************
9
9
  //
10
- // Ice version 3.6.2
10
+ // Ice version 3.6.3
11
11
  //
12
12
  // <auto-generated>
13
13
  //
@@ -34,7 +34,7 @@
34
34
  # if ICE_INT_VERSION % 100 > 50
35
35
  # error Beta header file detected
36
36
  # endif
37
- # if ICE_INT_VERSION % 100 < 2
37
+ # if ICE_INT_VERSION % 100 < 3
38
38
  # error Ice patch level mismatch!
39
39
  # endif
40
40
  #endif
@@ -7,7 +7,7 @@
7
7
  //
8
8
  // **********************************************************************
9
9
  //
10
- // Ice version 3.6.2
10
+ // Ice version 3.6.3
11
11
  //
12
12
  // <auto-generated>
13
13
  //
@@ -33,7 +33,7 @@
33
33
  # if ICE_INT_VERSION % 100 > 50
34
34
  # error Beta header file detected
35
35
  # endif
36
- # if ICE_INT_VERSION % 100 < 2
36
+ # if ICE_INT_VERSION % 100 < 3
37
37
  # error Ice patch level mismatch!
38
38
  # endif
39
39
  #endif
@@ -25,8 +25,6 @@ using namespace IceMX;
25
25
  namespace
26
26
  {
27
27
 
28
- Context emptyCtx;
29
-
30
28
  int ThreadMetrics::*
31
29
  getThreadStateMetric(ThreadState s)
32
30
  {
@@ -354,7 +352,7 @@ public:
354
352
  };
355
353
  static Attributes attributes;
356
354
 
357
- InvocationHelper(const ObjectPrx& proxy, const string& op, const Context& ctx = emptyCtx) :
355
+ InvocationHelper(const ObjectPrx& proxy, const string& op, const Context& ctx) :
358
356
  _proxy(proxy), _operation(op), _context(ctx)
359
357
  {
360
358
  }
@@ -7,7 +7,7 @@
7
7
  //
8
8
  // **********************************************************************
9
9
  //
10
- // Ice version 3.6.2
10
+ // Ice version 3.6.3
11
11
  //
12
12
  // <auto-generated>
13
13
  //
@@ -34,7 +34,7 @@
34
34
  # if ICE_INT_VERSION % 100 > 50
35
35
  # error Beta header file detected
36
36
  # endif
37
- # if ICE_INT_VERSION % 100 < 2
37
+ # if ICE_INT_VERSION % 100 < 3
38
38
  # error Ice patch level mismatch!
39
39
  # endif
40
40
  #endif
@@ -7,7 +7,7 @@
7
7
  //
8
8
  // **********************************************************************
9
9
  //
10
- // Ice version 3.6.2
10
+ // Ice version 3.6.3
11
11
  //
12
12
  // <auto-generated>
13
13
  //
@@ -38,7 +38,7 @@
38
38
  # if ICE_INT_VERSION % 100 > 50
39
39
  # error Beta header file detected
40
40
  # endif
41
- # if ICE_INT_VERSION % 100 < 2
41
+ # if ICE_INT_VERSION % 100 < 3
42
42
  # error Ice patch level mismatch!
43
43
  # endif
44
44
  #endif
@@ -7,7 +7,7 @@
7
7
  //
8
8
  // **********************************************************************
9
9
  //
10
- // Ice version 3.6.2
10
+ // Ice version 3.6.3
11
11
  //
12
12
  // <auto-generated>
13
13
  //
@@ -34,7 +34,7 @@
34
34
  # if ICE_INT_VERSION % 100 > 50
35
35
  # error Beta header file detected
36
36
  # endif
37
- # if ICE_INT_VERSION % 100 < 2
37
+ # if ICE_INT_VERSION % 100 < 3
38
38
  # error Ice patch level mismatch!
39
39
  # endif
40
40
  #endif
@@ -7,7 +7,7 @@
7
7
  //
8
8
  // **********************************************************************
9
9
  //
10
- // Ice version 3.6.2
10
+ // Ice version 3.6.3
11
11
  //
12
12
  // <auto-generated>
13
13
  //
@@ -33,7 +33,7 @@
33
33
  # if ICE_INT_VERSION % 100 > 50
34
34
  # error Beta header file detected
35
35
  # endif
36
- # if ICE_INT_VERSION % 100 < 2
36
+ # if ICE_INT_VERSION % 100 < 3
37
37
  # error Ice patch level mismatch!
38
38
  # endif
39
39
  #endif
@@ -7,7 +7,7 @@
7
7
  //
8
8
  // **********************************************************************
9
9
  //
10
- // Ice version 3.6.2
10
+ // Ice version 3.6.3
11
11
  //
12
12
  // <auto-generated>
13
13
  //
@@ -33,7 +33,7 @@
33
33
  # if ICE_INT_VERSION % 100 > 50
34
34
  # error Beta header file detected
35
35
  # endif
36
- # if ICE_INT_VERSION % 100 < 2
36
+ # if ICE_INT_VERSION % 100 < 3
37
37
  # error Ice patch level mismatch!
38
38
  # endif
39
39
  #endif
@@ -9,11 +9,11 @@
9
9
 
10
10
  #include <IceUtil/Time.h>
11
11
  #include <Ice/LoggerI.h>
12
+ #include <IceUtil/StringUtil.h>
12
13
  #include <IceUtil/Mutex.h>
13
14
  #include <IceUtil/MutexPtrLock.h>
14
15
 
15
16
  #ifdef _WIN32
16
- # include <IceUtil/StringUtil.h>
17
17
  # include <IceUtil/ScopedArray.h>
18
18
  #endif
19
19
 
@@ -46,17 +46,24 @@ public:
46
46
 
47
47
  Init init;
48
48
 
49
+ //
50
+ // Timeout in milliseconds after which rename will be attempted
51
+ // in case of failures renaming files. That is set to 5 minutes.
52
+ //
53
+ const IceUtil::Time retryTimeout = IceUtil::Time::seconds(5 * 60);
54
+
49
55
  }
50
56
 
51
57
  Ice::LoggerI::LoggerI(const string& prefix, const string& file,
52
- bool convert, const IceUtil::StringConverterPtr& converter) :
58
+ bool convert, const IceUtil::StringConverterPtr& converter,
59
+ size_t sizeMax) :
53
60
  _prefix(prefix),
54
61
  _convert(convert),
55
- _converter(converter)
62
+ _converter(converter),
63
+ _sizeMax(sizeMax)
56
64
  #if defined(_WIN32) && !defined(ICE_OS_WINRT)
57
- , _consoleConverter(new IceUtil::WindowsStringConverter(GetConsoleOutputCP()))
65
+ ,_consoleConverter(new IceUtil::WindowsStringConverter(GetConsoleOutputCP()))
58
66
  #endif
59
-
60
67
  {
61
68
  if(!prefix.empty())
62
69
  {
@@ -71,6 +78,11 @@ Ice::LoggerI::LoggerI(const string& prefix, const string& file,
71
78
  {
72
79
  throw InitializationException(__FILE__, __LINE__, "FileLogger: cannot open " + _file);
73
80
  }
81
+
82
+ if(_sizeMax > 0)
83
+ {
84
+ _out.seekp(0, _out.end);
85
+ }
74
86
  }
75
87
  }
76
88
 
@@ -144,6 +156,83 @@ Ice::LoggerI::write(const string& message, bool indent)
144
156
 
145
157
  if(_out.is_open())
146
158
  {
159
+ if(_sizeMax > 0)
160
+ {
161
+ //
162
+ // If file size + message size exceeds max size we archive the log file,
163
+ // but we do not archive empty files or truncate messages.
164
+ //
165
+ size_t sz = static_cast<size_t>(_out.tellp());
166
+ if(sz > 0 && sz + message.size() >= _sizeMax && _nextRetry <= IceUtil::Time::now())
167
+ {
168
+ string basename = _file;
169
+ string ext;
170
+
171
+ size_t i = basename.rfind(".");
172
+ if(i != string::npos && i + 1 < basename.size())
173
+ {
174
+ ext = basename.substr(i + 1);
175
+ basename = basename.substr(0, i);
176
+ }
177
+ _out.close();
178
+
179
+ int id = 0;
180
+ string archive;
181
+ string date = IceUtil::Time::now().toString("%Y%m%d-%H%M%S");
182
+ while(true)
183
+ {
184
+ ostringstream s;
185
+ s << basename << "-" << date;
186
+ if(id > 0)
187
+ {
188
+ s << "-" << id;
189
+ }
190
+ if(!ext.empty())
191
+ {
192
+ s << "." << ext;
193
+ }
194
+ if(IceUtilInternal::fileExists(s.str()))
195
+ {
196
+ id++;
197
+ continue;
198
+ }
199
+ archive = s.str();
200
+ break;
201
+ }
202
+
203
+ int err = IceUtilInternal::rename(_file, archive);
204
+
205
+ _out.open(_file, fstream::out | fstream::app);
206
+
207
+ if(err)
208
+ {
209
+ _nextRetry = IceUtil::Time::now() + retryTimeout;
210
+
211
+ //
212
+ // We temporarily set the maximum size to 0 to ensure there isn't more rename attempts
213
+ // in the nested error call.
214
+ //
215
+ size_t sizeMax = _sizeMax;
216
+ _sizeMax = 0;
217
+ sync.release();
218
+ error("FileLogger: cannot rename `" + _file + "'\n" + IceUtilInternal::lastErrorToString());
219
+ sync.acquire();
220
+ _sizeMax = sizeMax;
221
+ }
222
+ else
223
+ {
224
+ _nextRetry = IceUtil::Time();
225
+ }
226
+
227
+ if(!_out.is_open())
228
+ {
229
+ sync.release();
230
+ error("FileLogger: cannot open `" + _file + "':\nlog messages will be sent to stderr");
231
+ write(message, indent);
232
+ return;
233
+ }
234
+ }
235
+ }
147
236
  _out << s << endl;
148
237
  }
149
238
  else
@@ -22,7 +22,7 @@ class LoggerI : public Logger
22
22
  public:
23
23
 
24
24
  LoggerI(const std::string&, const std::string&, bool convert = true,
25
- const IceUtil::StringConverterPtr& converter = 0);
25
+ const IceUtil::StringConverterPtr& converter = 0, std::size_t sizeMax = 0);
26
26
  ~LoggerI();
27
27
 
28
28
  virtual void print(const std::string&);
@@ -43,7 +43,13 @@ private:
43
43
  IceUtilInternal::ofstream _out;
44
44
 
45
45
  std::string _file;
46
+ std::size_t _sizeMax;
46
47
 
48
+ //
49
+ // In case of a log file rename failure is set to the time in milliseconds
50
+ // after which rename could be attempted again. Otherwise is set to zero.
51
+ //
52
+ IceUtil::Time _nextRetry;
47
53
  #if defined(_WIN32) && !defined(ICE_OS_WINRT)
48
54
  const IceUtil::StringConverterPtr _consoleConverter;
49
55
  #endif
@@ -7,7 +7,7 @@
7
7
  //
8
8
  // **********************************************************************
9
9
  //
10
- // Ice version 3.6.2
10
+ // Ice version 3.6.3
11
11
  //
12
12
  // <auto-generated>
13
13
  //
@@ -38,7 +38,7 @@
38
38
  # if ICE_INT_VERSION % 100 > 50
39
39
  # error Beta header file detected
40
40
  # endif
41
- # if ICE_INT_VERSION % 100 < 2
41
+ # if ICE_INT_VERSION % 100 < 3
42
42
  # error Ice patch level mismatch!
43
43
  # endif
44
44
  #endif
@@ -1238,7 +1238,17 @@ IceInternal::closeSocket(SOCKET fd)
1238
1238
  WSASetLastError(error);
1239
1239
  #else
1240
1240
  int error = errno;
1241
+
1242
+ # if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
1243
+ //
1244
+ // FreeBSD returns ECONNRESET if the underlying object was
1245
+ // a stream socket that was shut down by the peer before all
1246
+ // pending data was delivered.
1247
+ //
1248
+ if(close(fd) == SOCKET_ERROR && getSocketErrno() != ECONNRESET)
1249
+ # else
1241
1250
  if(close(fd) == SOCKET_ERROR)
1251
+ # endif
1242
1252
  {
1243
1253
  SocketException ex(__FILE__, __LINE__);
1244
1254
  ex.error = getSocketErrno();
@@ -1263,7 +1273,6 @@ IceInternal::fdToLocalAddress(SOCKET fd, Address& addr)
1263
1273
  socklen_t len = static_cast<socklen_t>(sizeof(sockaddr_storage));
1264
1274
  if(getsockname(fd, &addr.sa, &len) == SOCKET_ERROR)
1265
1275
  {
1266
- closeSocketNoThrow(fd);
1267
1276
  SocketException ex(__FILE__, __LINE__);
1268
1277
  ex.error = getSocketErrno();
1269
1278
  throw ex;
@@ -1297,7 +1306,6 @@ IceInternal::fdToRemoteAddress(SOCKET fd, Address& addr)
1297
1306
  }
1298
1307
  else
1299
1308
  {
1300
- closeSocketNoThrow(fd);
1301
1309
  SocketException ex(__FILE__, __LINE__);
1302
1310
  ex.error = getSocketErrno();
1303
1311
  throw ex;
@@ -2316,12 +2324,20 @@ repeatConnect:
2316
2324
  // port as the server).
2317
2325
  //
2318
2326
  Address localAddr;
2319
- fdToLocalAddress(fd, localAddr);
2320
- if(compareAddress(addr, localAddr) == 0)
2327
+ try
2321
2328
  {
2322
- ConnectionRefusedException ex(__FILE__, __LINE__);
2323
- ex.error = 0; // No appropriate errno
2324
- throw ex;
2329
+ fdToLocalAddress(fd, localAddr);
2330
+ if(compareAddress(addr, localAddr) == 0)
2331
+ {
2332
+ ConnectionRefusedException ex(__FILE__, __LINE__);
2333
+ ex.error = 0; // No appropriate errno
2334
+ throw ex;
2335
+ }
2336
+ }
2337
+ catch(const LocalException&)
2338
+ {
2339
+ closeSocketNoThrow(fd);
2340
+ throw;
2325
2341
  }
2326
2342
  #endif
2327
2343
  return true;
@@ -45,7 +45,7 @@ typedef int ssize_t;
45
45
 
46
46
  #if defined(__linux) && !defined(ICE_NO_EPOLL)
47
47
  # define ICE_USE_EPOLL 1
48
- #elif (defined(__APPLE__) || defined(__FreeBSD__)) && TARGET_OS_IPHONE == 0 && !defined(ICE_NO_KQUEUE)
48
+ #elif (defined(__APPLE__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && TARGET_OS_IPHONE == 0 && !defined(ICE_NO_KQUEUE)
49
49
  # define ICE_USE_KQUEUE 1
50
50
  #elif defined(__APPLE__) && !defined(ICE_NO_CFSTREAM)
51
51
  # define ICE_USE_CFSTREAM 1