summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rwxr-xr-xcpp/src/Ice/StreamSocket.cpp18
-rwxr-xr-xcpp/src/IceSSL/Certificate.cpp2
2 files changed, 5 insertions, 15 deletions
diff --git a/cpp/src/Ice/StreamSocket.cpp b/cpp/src/Ice/StreamSocket.cpp
index 7d186e15dd4..e890be1f829 100755
--- a/cpp/src/Ice/StreamSocket.cpp
+++ b/cpp/src/Ice/StreamSocket.cpp
@@ -562,13 +562,8 @@ StreamSocket::startWrite(Buffer& buf)
assert(!buf.b.empty());
assert(buf.i != buf.b.end());
- size_t packetSize = static_cast<size_t>(buf.b.end() - buf.i);
- if(_maxSendPacketSize > 0 && packetSize > _maxSendPacketSize)
- {
- packetSize = _maxSendPacketSize;
- }
- assert(packetSize > 0);
- _writer->WriteBytes(ref new Array<unsigned char>(&*buf.i, packetSize));
+ size_t packetSize = getSendPacketSize(buf.b.end() - buf.i);
+ _writer->WriteBytes(ref new Array<unsigned char>(&*buf.i, static_cast<unsigned int>(packetSize)));
try
{
queueOperation(SocketOperationWrite, _writer->StoreAsync());
@@ -599,16 +594,11 @@ StreamSocket::finishWrite(Buffer& buf)
void
StreamSocket::startRead(Buffer& buf)
{
- size_t packetSize = static_cast<size_t>(buf.b.end() - buf.i);
- if(_maxRecvPacketSize > 0 && packetSize > _maxRecvPacketSize)
- {
- packetSize = _maxRecvPacketSize;
- }
assert(!buf.b.empty() && buf.i != buf.b.end());
-
+ size_t packetSize = getRecvPacketSize(buf.b.end() - buf.i);
try
{
- queueOperation(SocketOperationRead, _reader->LoadAsync(packetSize));
+ queueOperation(SocketOperationRead, _reader->LoadAsync(static_cast<unsigned int>(packetSize)));
}
catch(Platform::Exception^ ex)
{
diff --git a/cpp/src/IceSSL/Certificate.cpp b/cpp/src/IceSSL/Certificate.cpp
index 5429a96b2e9..f73c86de212 100755
--- a/cpp/src/IceSSL/Certificate.cpp
+++ b/cpp/src/IceSSL/Certificate.cpp
@@ -1440,7 +1440,7 @@ Certificate::encode() const
std::vector<unsigned char> data(reader->UnconsumedBufferLength);
if (!data.empty())
{
- reader->ReadBytes(Platform::ArrayReference<unsigned char>(&data[0], data.size()));
+ reader->ReadBytes(Platform::ArrayReference<unsigned char>(&data[0], static_cast<unsigned int>(data.size())));
}
ostringstream os;
os << "-----BEGIN CERTIFICATE-----\n";