|
From: CVS C. to T. <the...@li...> - 2015-04-26 16:42:28
|
Revision: 722
http://sourceforge.net/p/themis/code/722
Author: mark_hellegers
Date: 2015-04-26 16:42:26 +0000 (Sun, 26 Apr 2015)
Log Message:
-----------
Lock the object before creating the connection to prevent a race condition with the layer_manager of the HTTPv4 module.
Modified Paths:
--------------
trunk/themis/framework/tcpmanager.cpp
Modified: trunk/themis/framework/tcpmanager.cpp
===================================================================
--- trunk/themis/framework/tcpmanager.cpp 2015-04-26 15:07:05 UTC (rev 721)
+++ trunk/themis/framework/tcpmanager.cpp 2015-04-26 16:42:26 UTC (rev 722)
@@ -226,8 +226,8 @@
Connection *TCPManager::CreateConnection(NetworkableObject *net_obj,const char *host,uint16 port,bool secure,bool asynch) {
//printf("CreateConnection begun\n");
Connection *connection=NULL;
-// BAutolock alock(lock);
-// if (alock.IsLocked()) {
+ BAutolock alock(lock);
+ if (alock.IsLocked()) {
int32 connections=0;
Connection *target_connection=NULL;
connections=Connection::CountConnections();
@@ -257,7 +257,7 @@
sessions_created++;
}
-// }
+ }
//printf("CreateConnection is done: %p\n",connection);
return connection;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|