diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/BasicStream.cpp | 44 | ||||
-rw-r--r-- | cpp/src/Ice/ConnectionI.cpp | 12 | ||||
-rw-r--r-- | cpp/src/Ice/ThreadPool.cpp | 6 |
3 files changed, 9 insertions, 53 deletions
diff --git a/cpp/src/Ice/BasicStream.cpp b/cpp/src/Ice/BasicStream.cpp index c81d2aa552f..1db2a1c2ac2 100644 --- a/cpp/src/Ice/BasicStream.cpp +++ b/cpp/src/Ice/BasicStream.cpp @@ -680,50 +680,6 @@ IceInternal::BasicStream::readBlob(vector<Byte>& v, Int sz) } void -IceInternal::BasicStream::writeBlob(const Ice::Byte* v, Container::size_type sz) -{ - if(sz > 0) - { - Container::size_type pos = b.size(); - resize(pos + sz); - memcpy(&b[pos], v, sz); - } -} - -void -IceInternal::BasicStream::readBlob(Ice::Byte* v, Container::size_type sz) -{ - if(sz > 0) - { - if(static_cast<Container::size_type>(b.end() - i) < sz) - { - throw UnmarshalOutOfBoundsException(__FILE__, __LINE__); - } - memcpy(v, &*i, sz); - i += sz; - } -} - -void -IceInternal::BasicStream::readBlob(pair<const Byte*, const Byte*>& v, Int sz) -{ - if(sz > 0) - { - if(b.end() - i < sz) - { - throw UnmarshalOutOfBoundsException(__FILE__, __LINE__); - } - v.first = i; - v.second = i + sz; - i += sz; - } - else - { - v.first = v.second = 0; - } -} - -void IceInternal::BasicStream::write(const Byte* begin, const Byte* end) { Int sz = static_cast<Int>(end - begin); diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp index 10d7ade49de..593c5da9fb9 100644 --- a/cpp/src/Ice/ConnectionI.cpp +++ b/cpp/src/Ice/ConnectionI.cpp @@ -148,12 +148,12 @@ Ice::ConnectionI::validate() } assert(is.i == is.b.end()); is.i = is.b.begin(); - pair<const Byte*, const Byte*> m; + const Byte* m; is.readBlob(m, static_cast<Int>(sizeof(magic))); - if(!equal(m.first, m.second, magic)) + if(m[0] != magic[0] || m[1] != magic[1] || m[2] != magic[2] || m[3] != magic[3]) { BadMagicException ex(__FILE__, __LINE__); - ex.badMagic = vector<Byte>(m.first, m.second); + ex.badMagic = Ice::ByteSeq(&m[0], &m[0] + sizeof(magic)); throw ex; } Byte pMajor; @@ -2365,12 +2365,12 @@ Ice::ConnectionI::run() throw IllegalMessageSizeException(__FILE__, __LINE__); } stream.i = stream.b.begin(); - pair<const Byte*, const Byte*> m; + const Byte* m; stream.readBlob(m, static_cast<Int>(sizeof(magic))); - if(!equal(m.first, m.second, magic)) + if(m[0] != magic[0] || m[1] != magic[1] || m[2] != magic[2] || m[3] != magic[3]) { BadMagicException ex(__FILE__, __LINE__); - ex.badMagic = vector<Byte>(m.first, m.second); + ex.badMagic = Ice::ByteSeq(&m[0], &m[0] + sizeof(magic)); throw ex; } Byte pMajor; diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp index 15bda6f74fe..627c2a943da 100644 --- a/cpp/src/Ice/ThreadPool.cpp +++ b/cpp/src/Ice/ThreadPool.cpp @@ -763,12 +763,12 @@ IceInternal::ThreadPool::read(const EventHandlerPtr& handler) throw IllegalMessageSizeException(__FILE__, __LINE__); } stream.i = stream.b.begin(); - pair<const Byte*, const Byte*> m; + const Byte* m; stream.readBlob(m, static_cast<Int>(sizeof(magic))); - if(!equal(m.first, m.second, magic)) + if(m[0] != magic[0] || m[1] != magic[1] || m[2] != magic[2] || m[3] != magic[3]) { BadMagicException ex(__FILE__, __LINE__); - ex.badMagic = vector<Byte>(m.first, m.second); + ex.badMagic = Ice::ByteSeq(&m[0], &m[0] + sizeof(magic)); throw ex; } Byte pMajor; |