summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/demo/Ice/minimal/Server.cpp11
-rwxr-xr-xcpp/demo/Ice/session/Client.cpp33
-rwxr-xr-xcpp/demo/Ice/session/ReapThread.cpp2
-rw-r--r--cpp/demo/book/lifecycle/Grammar.y2
-rw-r--r--cpp/doc/swish/swishcgi.conf7
-rw-r--r--cpp/install/common/README.DEMOS40
-rw-r--r--cpp/install/rpm/ice.spec43
-rw-r--r--cpp/install/unix/README.Linux-RPM2
-rw-r--r--cpp/install/unix/README.RHEL28
-rw-r--r--cpp/install/unix/README.SLES2
-rw-r--r--cpp/src/IceGrid/ServerAdapterI.cpp17
-rw-r--r--cpp/src/IceGrid/ServerAdapterI.h1
-rw-r--r--cpp/test/IceGrid/distribution/application.xml4
13 files changed, 150 insertions, 42 deletions
diff --git a/cpp/demo/Ice/minimal/Server.cpp b/cpp/demo/Ice/minimal/Server.cpp
index 7cf3c25cfc9..7446f6fefa4 100644
--- a/cpp/demo/Ice/minimal/Server.cpp
+++ b/cpp/demo/Ice/minimal/Server.cpp
@@ -20,7 +20,16 @@ onCtrlC(int)
{
if(communicator)
{
- communicator->shutdown();
+ try
+ {
+ communicator->shutdown();
+ }
+ catch(const Ice::CommunicatorDestroyedException&)
+ {
+ //
+ // This might occur if we receive more than one signal.
+ //
+ }
}
}
diff --git a/cpp/demo/Ice/session/Client.cpp b/cpp/demo/Ice/session/Client.cpp
index aeb58d692ac..c8cf00f4d87 100755
--- a/cpp/demo/Ice/session/Client.cpp
+++ b/cpp/demo/Ice/session/Client.cpp
@@ -11,6 +11,12 @@
#include <Ice/Ice.h>
#include <Session.h>
+#ifdef _WIN32
+const DWORD SIGHUP = CTRL_LOGOFF_EVENT;
+#else
+# include <csignal>
+#endif
+
using namespace std;
using namespace Demo;
@@ -192,12 +198,6 @@ SessionClient::run(int argc, char* argv[])
}
}
- //
- // The refresher thread must be terminated before destroy is
- // called, otherwise it might get ObjectNotExistException. refresh
- // is set to 0 so that if session->destroy() raises an exception
- // the thread will not be re-terminated and re-joined.
- //
cleanup(destroy);
if(shutdown)
{
@@ -220,9 +220,19 @@ SessionClient::run(int argc, char* argv[])
}
void
-SessionClient::interruptCallback(int)
+SessionClient::interruptCallback(int sig)
{
//
+ // Workaround for older Linux platforms where SIGHUP is received
+ // when the process has a controlling terminal (such as under
+ // expect).
+ //
+ if(sig == SIGHUP)
+ {
+ return;
+ }
+
+ //
// Terminate the refresh thread, destroy the session and then
// destroy the communicator, followed by an exit. We have to call
// exit because main may be blocked in a cin >> s call which
@@ -249,6 +259,13 @@ void
SessionClient::cleanup(bool destroy)
{
IceUtil::Mutex::Lock sync(_mutex);
+
+ //
+ // The refresher thread must be terminated before destroy is
+ // called, otherwise it might get ObjectNotExistException. refresh
+ // is set to 0 so that if session->destroy() raises an exception
+ // the thread will not be re-terminated and re-joined.
+ //
if(_refresh)
{
_refresh->terminate();
@@ -259,8 +276,8 @@ SessionClient::cleanup(bool destroy)
if(destroy && _session)
{
_session->destroy();
- _session = 0;
}
+ _session = 0;
}
void
diff --git a/cpp/demo/Ice/session/ReapThread.cpp b/cpp/demo/Ice/session/ReapThread.cpp
index 7257bd0994c..0676f5c8b91 100755
--- a/cpp/demo/Ice/session/ReapThread.cpp
+++ b/cpp/demo/Ice/session/ReapThread.cpp
@@ -25,7 +25,7 @@ ReapThread::run()
while(!_terminated)
{
- timedWait(_timeout);
+ timedWait(IceUtil::Time::seconds(1));
if(!_terminated)
{
diff --git a/cpp/demo/book/lifecycle/Grammar.y b/cpp/demo/book/lifecycle/Grammar.y
index 26f9f4be107..2566b6146ca 100644
--- a/cpp/demo/book/lifecycle/Grammar.y
+++ b/cpp/demo/book/lifecycle/Grammar.y
@@ -105,7 +105,7 @@ command
}
| TOK_CD strings
{
- parser->error($2.front());
+ parser->cd($2.front());
}
| TOK_CAT TOK_STRING
{
diff --git a/cpp/doc/swish/swishcgi.conf b/cpp/doc/swish/swishcgi.conf
index bc25cc9ad5a..2d107e758b6 100644
--- a/cpp/doc/swish/swishcgi.conf
+++ b/cpp/doc/swish/swishcgi.conf
@@ -1,7 +1,12 @@
use lib '/var/www/html/doc/swishdir';
+my $referer = $ENV{HTTP_REFERER};
+$referer =~ m{/Ice-([0-9]+\.[0-9]+\.[0-9]+)/};;
+my $ice_version = $1;
+$index_loc = '../html/doc/Ice-' . $ice_version . '/swishdir/index.swish-e';
+
return {
- swish_index => '../html/doc/swishdir/index.swish-e',
+ swish_index => $index_loc,
template => {
package => 'TemplateSlice',
options => {
diff --git a/cpp/install/common/README.DEMOS b/cpp/install/common/README.DEMOS
index 0b26c086a4e..3c91059a85c 100644
--- a/cpp/install/common/README.DEMOS
+++ b/cpp/install/common/README.DEMOS
@@ -11,8 +11,8 @@ distributions. Distributions for specific platform/tool combinations
may not support every Ice language mapping.
The build systems included in the demo distribution are either
-'makefile' based or 'ant' based. The C++ and C# demos use makefiles and
-the Java demos use the Apache Foundation's ant build tool.
+'makefile' based or 'ant' based. The C++ and C# demos use makefiles
+and the Java demos use the Apache Foundation's ant build tool.
NOTE: The Ruby, Python and PHP demos do not need to be built.
@@ -134,11 +134,10 @@ on this to start a console window with your development environment
already configured.
-Building the demos on Windows using Mono, Cygwin, etc.
-------------------------------------------------------
+Mono on Windows
+---------------
-Building the demos with Mono using the NMAKE makefiles or using
-Cygwin and the gmake makefiles is not currently supported.
+We do not currently support the use of Mono on Windows.
Running the Ice Demos
@@ -156,12 +155,12 @@ Running the C++ demos
To run a demo, open a terminal terminal window, change to the desired
demo directory, and enter the following command to run the server:
-$ ./server
+$ server
To run the client, open another terminal window, also change to the
desired demo directory, and run:
-$ ./client
+$ client
Running the Java demos
@@ -198,12 +197,23 @@ distributions.
To run a demo, open a terminal window, change to the desired demo
directory, and enter the following command to run the server:
-$ ./server.exe
+$ server.exe
To run the client, open another terminal window, also change to the
desired demo directory, and run:
-$ ./client.exe
+$ client.exe
+
+When using Mono on Linux, the compiled programs may not be directly
+executable unless you have configured Linux as described in the
+installation instructions included with the Ice distribution. As a
+result, you will need to start Mono executables as shown below:
+
+$ mono server.exe
+
+In another window:
+
+$ mono client.exe
Running the Python demos
@@ -228,13 +238,13 @@ support server-side activities. In order to run a sample client, you
must first start its corresponding server from another Ice language
mapping, such as C++:
-# for example in the /tmp/Ice-@ver@/demo/Ice/hello directory
+# for example in $HOME/testing/Ice-@ver@-demos/demo/Ice/hello
$ server
To run the client, open another terminal window, change to the
corresponding demo directory, and run:
-# for example in the /tmp/Ice-@ver@/demorb/Ice/hello directory
+# for example in $HOME/testing/Ice-@ver@-demos/demorb/Ice/hello
$ ruby Client.rb
@@ -256,6 +266,6 @@ examples require that an Ice server be available; a matching server
from any of the other language mappings can be used. A README file is
provided in each of the example directories.
-Note that you must modify the php.ini files in each demo directory to
-match your PHP installation and ensure that the Ice extension is
-loaded properly.
+Note that you may need to modify the php.ini files in each demo
+directory to match your PHP installation and ensure that the Ice
+extension is loaded properly.
diff --git a/cpp/install/rpm/ice.spec b/cpp/install/rpm/ice.spec
index b865be5e19c..d6a8d1b9899 100644
--- a/cpp/install/rpm/ice.spec
+++ b/cpp/install/rpm/ice.spec
@@ -1,4 +1,4 @@
-%if "%{_target_cpu}" != "noarch" && "%{dist}" == ".rhel4"
+%if "%{_target_cpu}" != "noarch" && "%{dist}" != ".sles10"
%define ruby_included 1
%else
%define ruby_included 0
@@ -59,6 +59,14 @@ BuildRequires: ruby-devel >= 1.8.1
BuildRequires: php >= 5.1.4
BuildRequires: php-devel >= 5.1.4
%endif
+%if "%{dist}" == ".rhel5"
+BuildRequires: bzip2-devel >= 1.0.3
+BuildRequires: expat-devel >= 1.95.8
+BuildRequires: ruby >= 1.8.5
+BuildRequires: ruby-devel >= 1.8.5
+BuildRequires: php >= 5.1.6
+BuildRequires: php-devel >= 5.1.6
+%endif
%if "%{dist}" == ".sles10"
BuildRequires: php5 >= 5.1.2
BuildRequires: php5-devel >= 5.1.2
@@ -183,6 +191,7 @@ done
#
# RPM-support files
#
+cp $RPM_BUILD_DIR/Ice-rpmbuild-%{version}/RELEASE_NOTES.txt $RPM_BUILD_ROOT
cp $RPM_BUILD_DIR/Ice-rpmbuild-%{version}/README.Linux-RPM $RPM_BUILD_ROOT/README
cp $RPM_BUILD_DIR/Ice-rpmbuild-%{version}/THIRD_PARTY_LICENSE.Linux $RPM_BUILD_ROOT/THIRD_PARTY_LICENSE
cp $RPM_BUILD_DIR/Ice-rpmbuild-%{version}/SOURCES.Linux $RPM_BUILD_ROOT/SOURCES
@@ -241,7 +250,7 @@ fi
# Move ice.ini and IcePHP.so to distribution-dependent directories
#
-%if "%{dist}" == ".rhel4"
+%if "%{dist}" == ".rhel4" || "%{dist}" == ".rhel5"
mkdir -p $RPM_BUILD_ROOT/etc/php.d
mv $RPM_BUILD_ROOT/ice.ini $RPM_BUILD_ROOT/etc/php.d
mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/php/modules
@@ -267,11 +276,12 @@ mv $RPM_BUILD_ROOT/python ${RPM_BUILD_ROOT}%{_libdir}/Ice-%{version}/python
mkdir -p ${RPM_BUILD_ROOT}%{_defaultdocdir}
mv $RPM_BUILD_ROOT/help ${RPM_BUILD_ROOT}%{_defaultdocdir}/Ice-%{version}
-mv $RPM_BUILD_ROOT/README ${RPM_BUILD_ROOT}%{_defaultdocdir}/Ice-%{version}/README
-mv $RPM_BUILD_ROOT/ICE_LICENSE ${RPM_BUILD_ROOT}%{_defaultdocdir}/Ice-%{version}/ICE_LICENSE
-mv $RPM_BUILD_ROOT/LICENSE ${RPM_BUILD_ROOT}%{_defaultdocdir}/Ice-%{version}/LICENSE
-mv $RPM_BUILD_ROOT/THIRD_PARTY_LICENSE ${RPM_BUILD_ROOT}%{_defaultdocdir}/Ice-%{version}/THIRD_PARTY_LICENSE
-mv $RPM_BUILD_ROOT/SOURCES ${RPM_BUILD_ROOT}%{_defaultdocdir}/Ice-%{version}/SOURCES
+mv $RPM_BUILD_ROOT/RELEASE_NOTES.txt ${RPM_BUILD_ROOT}%{_defaultdocdir}/Ice-%{version}
+mv $RPM_BUILD_ROOT/README ${RPM_BUILD_ROOT}%{_defaultdocdir}/Ice-%{version}
+mv $RPM_BUILD_ROOT/ICE_LICENSE ${RPM_BUILD_ROOT}%{_defaultdocdir}/Ice-%{version}
+mv $RPM_BUILD_ROOT/LICENSE ${RPM_BUILD_ROOT}%{_defaultdocdir}/Ice-%{version}
+mv $RPM_BUILD_ROOT/THIRD_PARTY_LICENSE ${RPM_BUILD_ROOT}%{_defaultdocdir}/Ice-%{version}
+mv $RPM_BUILD_ROOT/SOURCES ${RPM_BUILD_ROOT}%{_defaultdocdir}/Ice-%{version}
mkdir -p $RPM_BUILD_ROOT/usr/lib/Ice-%{version}
mv $RPM_BUILD_ROOT/ant $RPM_BUILD_ROOT/usr/lib/Ice-%{version}/ant
@@ -320,6 +330,12 @@ mv $RPM_BUILD_ROOT/bin $RPM_BUILD_ROOT/usr/bin
rm -rf ${RPM_BUILD_ROOT}
%changelog
+* Fri Jul 27 2007 Bernard Normier
+- Updated for Ice 3.2.1 release
+
+* Wed Jun 13 2007 Bernard Normier
+- Added patch with new IceGrid.Node.AllowRunningServersAsRoot property.
+
* Fri Dec 6 2006 ZeroC Staff
- See source distributions or the ZeroC website for more information
about the changes in this release
@@ -472,6 +488,9 @@ Group: System Environment/Libraries
%if "%{dist}" == ".rhel4"
Requires: ice = %{version}, php >= 5.1.4
%endif
+%if "%{dist}" == ".rhel5"
+Requires: ice = %{version}, php >= 5.1.6
+%endif
%if "%{dist}" == ".sles10"
Requires: ice-%{_target_cpu}, php5 >= 5.1.2
%endif
@@ -581,6 +600,14 @@ firewall solution, and much more.
%attr(755, root, root) %{_datadir}/Ice-%{version}/convertssl.py
%attr(755, root, root) %{_datadir}/Ice-%{version}/upgradeicegrid.py
%attr(755, root, root) %{_datadir}/Ice-%{version}/upgradeicestorm.py
+%if "%{dist}" == ".rhel5"
+%attr(755, root, root) %{_datadir}/Ice-%{version}/convertssl.pyc
+%attr(755, root, root) %{_datadir}/Ice-%{version}/upgradeicegrid.pyc
+%attr(755, root, root) %{_datadir}/Ice-%{version}/upgradeicestorm.pyc
+%attr(755, root, root) %{_datadir}/Ice-%{version}/convertssl.pyo
+%attr(755, root, root) %{_datadir}/Ice-%{version}/upgradeicegrid.pyo
+%attr(755, root, root) %{_datadir}/Ice-%{version}/upgradeicestorm.pyo
+%endif
%{_datadir}/Ice-%{version}/icegrid-slice.3.1.ice.gz
%attr(755, root, root) /etc/init.d/icegridregistry
%attr(755, root, root) /etc/init.d/icegridnode
@@ -737,7 +764,7 @@ pklibdir="lib64"
%files php
%defattr(644, root, root, 755)
-%if "%{dist}" == ".rhel4"
+%if "%{dist}" == ".rhel4" || "%{dist}" == ".rhel5"
%attr(755, root, root) %{_libdir}/php/modules
/etc/php.d/ice.ini
%endif
diff --git a/cpp/install/unix/README.Linux-RPM b/cpp/install/unix/README.Linux-RPM
index 20e4d4e4e37..0f6eef39c82 100644
--- a/cpp/install/unix/README.Linux-RPM
+++ b/cpp/install/unix/README.Linux-RPM
@@ -95,7 +95,7 @@ command-line option shown below:
$ java -Djava.security.egd=file:/dev/urandom MyClass ...
-On SuSE Linux Enterprise Server, you may experience occasional hangs
+On Linux systems with IPv6 enabled, you may experience occasional hangs
the first time an Ice object adapter is activated within a JVM. A
work-around is to disable IPv6 support by setting the Java property
java.net.preferIPv4Stack to true. For example:
diff --git a/cpp/install/unix/README.RHEL b/cpp/install/unix/README.RHEL
index fb910895036..4e16471eb23 100644
--- a/cpp/install/unix/README.RHEL
+++ b/cpp/install/unix/README.RHEL
@@ -184,6 +184,34 @@ In addition, the JVM requires that the directory containing the
Berkeley DB libraries be listed in java.library.path, therefore you
must add this directory to your LD_LIBRARY_PATH.
+In addition, the JVM requires that the directory containing the
+Berkeley DB libraries be listed in java.library.path, therefore you
+must add this directory to your LD_LIBRARY_PATH.
+
+When using the Ice for Java SSL plugin (IceSSL), you may experience
+occasional hangs. The most likely reason is that your system's entropy
+pool is empty. If you have sufficient system privileges, you can solve
+this issue by editing the following file
+
+<java.home>/jre/lib/security/java.security
+
+and changing it to use /dev/urandom instead of /dev/random. If you do
+not have permission to modify the security file, you can also use the
+command line option shown below:
+
+$ java -Djava.security.egd=file:/dev/urandom MyClass ...
+
+On Linux systems with IPv6 enabled, you may experience occasional hangs
+the first time an Ice object adapter is activated within a JVM. A
+work-around is to disable IPv6 support by setting the Java property
+java.net.preferIPv4Stack to true. For example:
+
+$ java -Djava.net.preferIPv4Stack=true MyClass ...
+
+For more information on this issue, refer to Sun's bug database:
+
+ http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6483406
+
Python
------
diff --git a/cpp/install/unix/README.SLES b/cpp/install/unix/README.SLES
index d5c4bf14344..ec2d4eab07f 100644
--- a/cpp/install/unix/README.SLES
+++ b/cpp/install/unix/README.SLES
@@ -185,7 +185,7 @@ command line option shown below:
$ java -Djava.security.egd=file:/dev/urandom MyClass ...
-On SuSE Linux Enterprise Server, you may experience occasional hangs
+On Linux systems with IPv6 enabled, you may experience occasional hangs
the first time an Ice object adapter is activated within a JVM. A
work-around is to disable IPv6 support by setting the Java property
java.net.preferIPv4Stack to true. For example:
diff --git a/cpp/src/IceGrid/ServerAdapterI.cpp b/cpp/src/IceGrid/ServerAdapterI.cpp
index 85023b27a3d..b6835e6d90f 100644
--- a/cpp/src/IceGrid/ServerAdapterI.cpp
+++ b/cpp/src/IceGrid/ServerAdapterI.cpp
@@ -70,6 +70,7 @@ ServerAdapterI::activate_async(const AMD_Adapter_activatePtr& cb, const Ice::Cur
{
return;
}
+ _activateAfterDeactivating = _server->getState() >= Deactivating;
}
//
@@ -141,11 +142,20 @@ ServerAdapterI::setDirectProxy(const Ice::ObjectPrx& prx, const Ice::Current&)
bool updated = _proxy != prx;
_proxy = prx;
- for(vector<AMD_Adapter_activatePtr>::const_iterator p = _activateCB.begin(); p != _activateCB.end(); ++p)
+ //
+ // If the server is being deactivated and the activation callback
+ // was added during the deactivation, we don't send the response
+ // now. The server is going to be activated again and the adapter
+ // activated.
+ //
+ if(_server->getState() < Deactivating || !_activateAfterDeactivating)
{
- (*p)->ice_response(_proxy);
+ for(vector<AMD_Adapter_activatePtr>::const_iterator p = _activateCB.begin(); p != _activateCB.end(); ++p)
+ {
+ (*p)->ice_response(_proxy);
+ }
+ _activateCB.clear();
}
- _activateCB.clear();
if(updated)
{
@@ -186,6 +196,7 @@ ServerAdapterI::clear()
{
Lock sync(*this);
_proxy = 0;
+ _activateAfterDeactivating = false;
}
void
diff --git a/cpp/src/IceGrid/ServerAdapterI.h b/cpp/src/IceGrid/ServerAdapterI.h
index 50bbedd6854..c8cd68e5d0f 100644
--- a/cpp/src/IceGrid/ServerAdapterI.h
+++ b/cpp/src/IceGrid/ServerAdapterI.h
@@ -48,6 +48,7 @@ private:
Ice::ObjectPrx _proxy;
std::vector<AMD_Adapter_activatePtr> _activateCB;
+ bool _activateAfterDeactivating;
};
typedef IceUtil::Handle<ServerAdapterI> ServerAdapterIPtr;
diff --git a/cpp/test/IceGrid/distribution/application.xml b/cpp/test/IceGrid/distribution/application.xml
index 91b492dbc96..1ca369759aa 100644
--- a/cpp/test/IceGrid/distribution/application.xml
+++ b/cpp/test/IceGrid/distribution/application.xml
@@ -15,9 +15,9 @@
<adapter name="IcePatch2" endpoints="${endpoints}">
<object identity="${instance-name}/server" type="::IcePatch2::FileServer"/>
</adapter>
+ <adapter name="IcePatch2.Admin" endpoints="tcp -h 127.0.0.1"
+ register-process="true"/>
<properties>
- <property name="IcePatch2.Admin.Endpoints" value="tcp -h 127.0.0.1"/>
- <property name="IcePatch2.Admin.RegisterProcess" value="1"/>
<property name="IcePatch2.InstanceName" value="${instance-name}"/>
<property name="IcePatch2.Directory" value="${directory}"/>
</properties>