diff options
Diffstat (limited to 'cppe/src')
-rwxr-xr-x | cppe/src/IceE/Connection.cpp | 4 | ||||
-rwxr-xr-x | cppe/src/IceE/LocalException.cpp | 57 | ||||
-rw-r--r-- | cppe/src/IceE/Reference.cpp | 78 |
3 files changed, 92 insertions, 47 deletions
diff --git a/cppe/src/IceE/Connection.cpp b/cppe/src/IceE/Connection.cpp index ad4b5e89bd3..dd1e9cbd7b4 100755 --- a/cppe/src/IceE/Connection.cpp +++ b/cppe/src/IceE/Connection.cpp @@ -1251,7 +1251,9 @@ Ice::Connection::parseMessage(BasicStream& stream, Int& requestId stream.read(compress); if(compress == 2) { - throw CompressionNotSupportedException(__FILE__, __LINE__); + FeatureNotSupportedException ex(__FILE__, __LINE__); + ex.unsupportedFeature = "compression"; + throw ex; } stream.i = stream.b.begin() + headerSize; diff --git a/cppe/src/IceE/LocalException.cpp b/cppe/src/IceE/LocalException.cpp index 00531301eb2..98415674bc6 100755 --- a/cppe/src/IceE/LocalException.cpp +++ b/cppe/src/IceE/LocalException.cpp @@ -1538,31 +1538,31 @@ Ice::IllegalMessageSizeException::ice_throw() const throw *this;
}
-Ice::CompressionNotSupportedException::CompressionNotSupportedException(const char* __file, int __line) :
+Ice::FeatureNotSupportedException::FeatureNotSupportedException(const char* __file, int __line) :
#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug
- ProtocolException(__file, __line)
+ LocalException(__file, __line)
#else
- ::Ice::ProtocolException(__file, __line)
+ ::Ice::LocalException(__file, __line)
#endif
{
}
-static const char* __Ice__CompressionNotSupportedException_name = "Ice::CompressionNotSupportedException";
+static const char* __Ice__FeatureNotSupportedException_name = "Ice::FeatureNotSupportedException";
const ::std::string
-Ice::CompressionNotSupportedException::ice_name() const
+Ice::FeatureNotSupportedException::ice_name() const
{
- return __Ice__CompressionNotSupportedException_name;
+ return __Ice__FeatureNotSupportedException_name;
}
::Ice::Exception*
-Ice::CompressionNotSupportedException::ice_clone() const
+Ice::FeatureNotSupportedException::ice_clone() const
{
- return new CompressionNotSupportedException(*this);
+ return new FeatureNotSupportedException(*this);
}
void
-Ice::CompressionNotSupportedException::ice_throw() const
+Ice::FeatureNotSupportedException::ice_throw() const
{
throw *this;
}
@@ -1850,7 +1850,8 @@ Ice::CommunicatorDestroyedException::toString() const out += ":\ncommunicator object destroyed";
return out;
}
-
+ +
#ifdef never
#endif
@@ -1974,16 +1975,26 @@ Ice::SocketException::toString() const string
Ice::FileException::toString() const
-{
- string out = Exception::toString();
- out += ":\nfile exception: ";
- out += errorToString(error);
- if(!path.empty())
- {
- out += "\npath: ";
- out += path;
- }
- return out;
+{ +
+ string out = Exception::toString(); +
+ out += ":\nfile exception: "; +
+ out += errorToString(error); +
+ if(!path.empty()) +
+ { +
+ out += "\npath: "; +
+ out += path; +
+ } +
+ return out; +
}
string
@@ -2165,10 +2176,12 @@ Ice::IllegalMessageSizeException::toString() const }
string
-Ice::CompressionNotSupportedException::toString() const
+Ice::FeatureNotSupportedException::toString() const
{
string out = Exception::toString();
- out += ":\nprotocol error: compressed messages not supported";
+ out += ":\nfeature `";
+ out += unsupportedFeature;
+ out += "' is not supported.";
return out;
}
diff --git a/cppe/src/IceE/Reference.cpp b/cppe/src/IceE/Reference.cpp index 5250e2fb502..678914b9d37 100644 --- a/cppe/src/IceE/Reference.cpp +++ b/cppe/src/IceE/Reference.cpp @@ -495,8 +495,32 @@ IceInternal::FixedReference::getConnection() const #endif ) { - NoEndpointException ex(__FILE__, __LINE__); - ex.proxy = toString(); + if(_fixedConnections.empty()) + { + NoEndpointException ex(__FILE__, __LINE__); + ex.proxy = toString(); + throw ex; + } + + FeatureNotSupportedException ex(__FILE__, __LINE__); + if(getSecure()) + { + ex.unsupportedFeature = "ssl"; + } + else if(getMode() == ModeDatagram) + { + ex.unsupportedFeature = "datagram"; + } + else if(getMode() == ModeBatchDatagram) + { + ex.unsupportedFeature = "batch datagram"; + } +#ifndef ICEE_HAS_BATCH + else if(getMode() == ModeBatchOneway) + { + ex.unsupportedFeature = "batch"; + } +#endif throw ex; } @@ -826,15 +850,6 @@ IceInternal::DirectReference::toString() const ConnectionPtr IceInternal::DirectReference::getConnection() const { -#ifndef ICEE_HAS_BATCH - if(getMode() == ModeBatchOneway) - { - NoEndpointException ex(__FILE__, __LINE__); - ex.proxy = toString(); - throw ex; - } -#endif - #ifdef ICEE_HAS_ROUTER vector<EndpointPtr> endpts = Parent::getRoutedEndpoints(); if(endpts.empty()) @@ -1066,15 +1081,6 @@ IceInternal::IndirectReference::toString() const ConnectionPtr IceInternal::IndirectReference::getConnection() const { -#ifndef ICEE_HAS_BATCH - if(getMode() == ModeBatchOneway) - { - NoEndpointException ex(__FILE__, __LINE__); - ex.proxy = toString(); - throw ex; - } -#endif - ConnectionPtr connection; while(true) @@ -1220,12 +1226,36 @@ IceInternal::filterEndpoints(const vector<EndpointPtr>& allEndpoints, Reference: vector<EndpointPtr> endpoints; // - // If a secure endpoint, datagram or batch datagram endpoint is - // requested since IceE lacks this support we return no endpoints. + // If a secure endpoint, batch (if batch is not supported), + // datagram or batch datagram endpoint is requested since IceE + // lacks this support we throw an unsupported feature. // - if(sec || m == Reference::ModeDatagram || m == Reference::ModeBatchDatagram) + if(sec || m == Reference::ModeDatagram || m == Reference::ModeBatchDatagram +#ifndef ICEE_HAS_BATCH + || m == Reference::ModeBatchOneway +#endif + ) { - return endpoints; + FeatureNotSupportedException ex(__FILE__, __LINE__); + if(sec) + { + ex.unsupportedFeature = "ssl"; + } + else if(m == Reference::ModeDatagram) + { + ex.unsupportedFeature = "datagram"; + } + else if(m == Reference::ModeBatchDatagram) + { + ex.unsupportedFeature = "batch datagram"; + } +#ifndef ICEE_HAS_BATCH + else if(m == Reference::ModeBatchOneway) + { + ex.unsupportedFeature = "batch"; + } +#endif + throw ex; } endpoints = allEndpoints; |