summaryrefslogtreecommitdiff
path: root/Bus
diff options
context:
space:
mode:
authorfcolin2007-02-01 12:53:56 +0000
committerfcolin2007-02-01 12:53:56 +0000
commit8ebf7e3d5a9161894cf99a5a38e59df2d7118a29 (patch)
treedd62b647101e90eea0cd9219fa498444e799b9e1 /Bus
parent826ff2aa8949e5f337eebf6f414567994d253a61 (diff)
downloadivy-cplusplus-8ebf7e3d5a9161894cf99a5a38e59df2d7118a29.zip
ivy-cplusplus-8ebf7e3d5a9161894cf99a5a38e59df2d7118a29.tar.gz
ivy-cplusplus-8ebf7e3d5a9161894cf99a5a38e59df2d7118a29.tar.bz2
ivy-cplusplus-8ebf7e3d5a9161894cf99a5a38e59df2d7118a29.tar.xz
Utilisateur : Fcolin Date : 19/04/06 Heure : 15:07 Archivé dans $/Bus/Ivy Commentaire: (vss 19)
Diffstat (limited to 'Bus')
-rw-r--r--Bus/Ivy/BufferedSocket.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/Bus/Ivy/BufferedSocket.cxx b/Bus/Ivy/BufferedSocket.cxx
index 3335e09..1a11c56 100644
--- a/Bus/Ivy/BufferedSocket.cxx
+++ b/Bus/Ivy/BufferedSocket.cxx
@@ -36,6 +36,7 @@ void CBufferedSocket::OnReceive(int nErrorCode)
char *ptr;
size_t nb_to_read = 0;
size_t nb;
+ char *tmp_buf;
SOCKADDR addr;
size_t len = sizeof( addr );
@@ -45,12 +46,13 @@ void CBufferedSocket::OnReceive(int nErrorCode)
if( nb_to_read == 0 )
{
buffer_size *= 2; /* twice old size */
- buffer = (char*)realloc( buffer, buffer_size );
- if (!buffer )
+ tmp_buf = (char*)realloc( buffer, buffer_size );
+ if (!tmp_buf )
{
TRACE("HandleSocket Buffer Memory Alloc Error\n");
exit(0);
}
+ buffer = tmp_buf;
TRACE( "Buffer Limit reached realloc new size %ld\n", buffer_size );
nb_to_read = buffer_size - (current_ptr - buffer );
}