Переглянути джерело

2008-03-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

	Allocate memory for peekBuf in initiateSecureConnection() to 
avoid
	the unused 4KB memory when ssl is not used.
	* src/SocketCore.cc
Tatsuhiro Tsujikawa 17 роки тому
батько
коміт
ddb00a9445
2 змінених файлів з 8 додано та 1 видалено
  1. 6 0
      ChangeLog
  2. 2 1
      src/SocketCore.cc

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2008-03-11  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>
+
+	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  <tujikawa at rednoah dot com>
 
 	Added summary log for peer announce storage.

+ 2 - 1
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