summaryrefslogtreecommitdiff
path: root/io
diff options
context:
space:
mode:
Diffstat (limited to 'io')
-rw-r--r--io/source/acceptor/acc_socket.cxx10
-rw-r--r--io/source/connector/ctr_pipe.cxx9
-rw-r--r--io/source/connector/ctr_socket.cxx7
3 files changed, 8 insertions, 18 deletions
diff --git a/io/source/acceptor/acc_socket.cxx b/io/source/acceptor/acc_socket.cxx
index 3fe29f3c0596..b1a30a15a82f 100644
--- a/io/source/acceptor/acc_socket.cxx
+++ b/io/source/acceptor/acc_socket.cxx
@@ -198,12 +198,13 @@ namespace io_acceptor {
{
notifyListeners(this, &_started, callStarted);
- if( aReadBytes.getLength() < nBytesToRead )
+ if( aReadBytes.getLength() != nBytesToRead )
{
aReadBytes.realloc( nBytesToRead );
}
- sal_Int32 i = m_socket.read( aReadBytes.getArray() , aReadBytes.getLength() );
+ sal_Int32 i = 0;
+ i = m_socket.read( aReadBytes.getArray() , aReadBytes.getLength() );
if(i != nBytesToRead)
{
@@ -219,10 +220,7 @@ namespace io_acceptor {
throw ioException;
}
- if( i < aReadBytes.getLength() )
- {
- aReadBytes.realloc( i );
- }
+
return i;
}
else
diff --git a/io/source/connector/ctr_pipe.cxx b/io/source/connector/ctr_pipe.cxx
index dafdc4208019..df1529173ba6 100644
--- a/io/source/connector/ctr_pipe.cxx
+++ b/io/source/connector/ctr_pipe.cxx
@@ -49,16 +49,11 @@ namespace stoc_connector {
{
if( ! m_nStatus )
{
- if( aReadBytes.getLength() < nBytesToRead )
+ if( aReadBytes.getLength() != nBytesToRead )
{
aReadBytes.realloc( nBytesToRead );
}
- sal_Int32 n = m_pipe.read( aReadBytes.getArray() , aReadBytes.getLength() );
- if( n < aReadBytes.getLength() )
- {
- aReadBytes.realloc( n );
- }
- return n;
+ return m_pipe.read( aReadBytes.getArray() , aReadBytes.getLength() );
}
else {
throw IOException();
diff --git a/io/source/connector/ctr_socket.cxx b/io/source/connector/ctr_socket.cxx
index 787a470d14b1..2c0d3f691b2f 100644
--- a/io/source/connector/ctr_socket.cxx
+++ b/io/source/connector/ctr_socket.cxx
@@ -123,7 +123,7 @@ namespace stoc_connector {
{
notifyListeners(this, &_started, callStarted);
- if( aReadBytes.getLength() < nBytesToRead )
+ if( aReadBytes.getLength() != nBytesToRead )
{
aReadBytes.realloc( nBytesToRead );
}
@@ -143,10 +143,7 @@ namespace stoc_connector {
throw ioException;
}
- if( i < aReadBytes.getLength() )
- {
- aReadBytes.realloc( i );
- }
+
return i;
}
else