summaryrefslogtreecommitdiff
path: root/io/source/acceptor/acc_socket.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-04-07 12:24:28 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-04-07 12:24:28 +0200
commitdee0a619bff88776d2b6c5b824fc8e8950418f70 (patch)
tree9b9cb6801f9d6703b6e5068c84e3cfc86dd42814 /io/source/acceptor/acc_socket.cxx
parentc076babe3ce636d60a699f66e4912c4d043b0412 (diff)
Revert "reduce unnecessary realloc'ing"
This reverts commit 9f6e6fabcd5718e0b65437c5ce398e520f47aae1, which is wrong, as it would cause the functions to now try to read aReadBytes.getLength() bytes if that is initially larger than nBytesToRead.
Diffstat (limited to 'io/source/acceptor/acc_socket.cxx')
-rw-r--r--io/source/acceptor/acc_socket.cxx10
1 files changed, 4 insertions, 6 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