From ddb00a944561eabd378785e77f8b05ac58d23d36 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 11 Mar 2008 12:33:20 +0000 Subject: [PATCH] 2008-03-11 Tatsuhiro Tsujikawa Allocate memory for peekBuf in initiateSecureConnection() to avoid the unused 4KB memory when ssl is not used. * src/SocketCore.cc --- ChangeLog | 6 ++++++ src/SocketCore.cc | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index dd1e0150..cbdf8cb2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-03-11 Tatsuhiro Tsujikawa + + Allocate memory for peekBuf in initiateSecureConnection() to avoid + the unused 4KB memory when ssl is not used. + * src/SocketCore.cc + 2008-03-11 Tatsuhiro Tsujikawa Added summary log for peer announce storage. diff --git a/src/SocketCore.cc b/src/SocketCore.cc index e0e54104..f792f71a 100644 --- a/src/SocketCore.cc +++ b/src/SocketCore.cc @@ -82,7 +82,7 @@ void SocketCore::init() sslSession = NULL; sslXcred = NULL; peekBufMax = 4096; - peekBuf = new char[peekBufMax]; + peekBuf = 0; peekBufLength = 0; #endif //HAVE_LIBGNUTLS } @@ -581,6 +581,7 @@ void SocketCore::initiateSecureConnection() if(ret < 0) { throw new DlAbortEx(EX_SSL_INIT_FAILURE, gnutls_strerror(ret)); } + peekBuf = new char[peekBufMax]; } #endif // HAVE_LIBGNUTLS