Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2118 06/04/18 12:08:06 msvensson@neptunus.(none) +13 -0
Bug#18815 libmysql using yassl can't be linked with c program
- Apply patch to remove dependency on C++ libs when linking "libmysql" from c
extra/yassl/taocrypt/src/template_instnt.cpp
1.7 06/04/18 12:08:02 msvensson@neptunus.(none) +1 -0
Add instantiation of one new template
extra/yassl/taocrypt/src/integer.cpp
1.18 06/04/18 12:08:02 msvensson@neptunus.(none) +17 -4
Use static pointers for singletons
Add cleanup function
extra/yassl/taocrypt/src/algebra.cpp
1.7 06/04/18 12:08:02 msvensson@neptunus.(none) +3 -1
Use mySTL::vector to avoid array of Element being on the stack
extra/yassl/taocrypt/include/runtime.hpp
1.10 06/04/18 12:08:02 msvensson@neptunus.(none) +21 -5
Add runtime for Solaris
extra/yassl/taocrypt/include/misc.hpp
1.9 06/04/18 12:08:02 msvensson@neptunus.(none) +5 -0
Add clenaup function
extra/yassl/taocrypt/include/integer.hpp
1.8 06/04/18 12:08:02 msvensson@neptunus.(none) +0 -2
Remove statoc singletons from class scope
extra/yassl/src/yassl_int.cpp
1.11 06/04/18 12:08:02 msvensson@neptunus.(none) +17 -5
Use static pointers for singletons
extra/yassl/src/template_instnt.cpp
1.5 06/04/18 12:08:02 msvensson@neptunus.(none) +2 -0
Add instantiation of two new templates
extra/yassl/src/handshake.cpp
1.6 06/04/18 12:08:02 msvensson@neptunus.(none) +10 -7
Use buffered.reset(0) instead of null_buffer
extra/yassl/include/yassl_types.hpp
1.9 06/04/18 12:08:02 msvensson@neptunus.(none) +5 -0
Add CleanUp function for static singletons
extra/yassl/include/yassl_int.hpp
1.7 06/04/18 12:08:02 msvensson@neptunus.(none) +0 -4
Remove static instance
extra/yassl/include/openssl/ssl.h
1.5 06/04/18 12:08:02 msvensson@neptunus.(none) +1 -1
Fix spelling error
extra/yassl/include/openssl/rsa.h
1.2 06/04/18 12:08:02 msvensson@neptunus.(none) +1 -1
Fix spelling error
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: msvensson
# Host: neptunus.(none)
# Root: /home/msvensson/mysql/mysql-5.0-release
--- 1.1/extra/yassl/include/openssl/rsa.h 2005-04-28 15:23:05 +02:00
+++ 1.2/extra/yassl/include/openssl/rsa.h 2006-04-18 12:08:02 +02:00
@@ -1,7 +1,7 @@
/* rsa.h for openSSL */
-#ifndef ysSSL_rsa_h__
+#ifndef yaSSL_rsa_h__
#define yaSSL_rsa_h__
enum { RSA_F4 = 1 };
--- 1.4/extra/yassl/include/openssl/ssl.h 2005-12-02 21:40:38 +01:00
+++ 1.5/extra/yassl/include/openssl/ssl.h 2006-04-18 12:08:02 +02:00
@@ -23,7 +23,7 @@
*
*/
-#ifndef ysSSL_openssl_h__
+#ifndef yaSSL_openssl_h__
#define yaSSL_openssl_h__
#include <stdio.h> /* ERR_print fp */
--- 1.6/extra/yassl/include/yassl_int.hpp 2005-06-14 22:47:56 +02:00
+++ 1.7/extra/yassl/include/yassl_int.hpp 2006-04-18 12:08:02 +02:00
@@ -123,8 +123,6 @@
friend sslFactory& GetSSL_Factory(); // singleton creator
private:
- static sslFactory instance_;
-
sslFactory(const sslFactory&); // hide copy
sslFactory& operator=(const sslFactory&); // and assign
};
@@ -216,8 +214,6 @@
friend Sessions& GetSessions(); // singleton creator
private:
- static Sessions instance_;
-
Sessions(const Sessions&); // hide copy
Sessions& operator=(const Sessions&); // and assign
};
--- 1.8/extra/yassl/include/yassl_types.hpp 2005-07-01 17:00:54 +02:00
+++ 1.9/extra/yassl/include/yassl_types.hpp 2006-04-18 12:08:02 +02:00
@@ -34,6 +34,11 @@
namespace yaSSL {
+
+// Delete static singleton memory holders
+void CleanUp();
+
+
// library allocation
struct new_t {}; // yaSSL New type
extern new_t ys; // pass in parameter
--- 1.5/extra/yassl/src/handshake.cpp 2005-12-20 00:47:44 +01:00
+++ 1.6/extra/yassl/src/handshake.cpp 2006-04-18 12:08:02 +02:00
@@ -648,8 +648,6 @@
}
-mySTL::auto_ptr<input_buffer> null_buffer(ysDelete);
-
// do process input requests
mySTL::auto_ptr<input_buffer>
DoProcessReply(SSL& ssl, mySTL::auto_ptr<input_buffer> buffered)
@@ -659,7 +657,8 @@
if (!ready) {
// Nothing to receive after blocking wait => error
ssl.SetError(receive_error);
- return buffered= null_buffer;
+ buffered.reset(0);
+ return buffered;
}
// add buffered data if its there
@@ -667,10 +666,10 @@
input_buffer buffer(buffSz + ready);
if (buffSz) {
buffer.assign(buffered.get()->get_buffer(), buffSz);
- buffered = null_buffer;
+ buffered.reset(0);
}
- // add new (ys) data
+ // add new data
uint read = ssl.getSocket().receive(buffer.get_buffer() + buffSz, ready);
buffer.add_size(read);
uint offset = 0;
@@ -703,11 +702,15 @@
mySTL::auto_ptr<Message> msg(mf.CreateObject(hdr.type_), ysDelete);
if (!msg.get()) {
ssl.SetError(factory_error);
- return buffered = null_buffer;
+ buffered.reset(0);
+ return buffered;
}
buffer >> *msg;
msg->Process(buffer, ssl);
- if (ssl.GetError()) return buffered = null_buffer;
+ if (ssl.GetError()) {
+ buffered.reset(0);
+ return buffered;
+ }
}
offset += hdr.length_ + RECORD_HEADER;
}
--- 1.4/extra/yassl/src/template_instnt.cpp 2005-07-01 17:00:54 +02:00
+++ 1.5/extra/yassl/src/template_instnt.cpp 2006-04-18 12:08:02 +02:00
@@ -87,6 +87,8 @@
template void ysDelete<Digest>(Digest*);
template void ysDelete<X509>(X509*);
template void ysDelete<Message>(Message*);
+template void ysDelete<sslFactory>(sslFactory*);
+template void ysDelete<Sessions>(Sessions*);
template void ysArrayDelete<unsigned char>(unsigned char*);
template void ysArrayDelete<char>(char*);
}
--- 1.10/extra/yassl/src/yassl_int.cpp 2005-07-01 17:00:54 +02:00
+++ 1.11/extra/yassl/src/yassl_int.cpp 2006-04-18 12:08:02 +02:00
@@ -1361,19 +1361,31 @@
}
-Sessions Sessions::instance_; // simple singleton
+static Sessions* sessionsInstance = 0;
Sessions& GetSessions()
{
- return Sessions::instance_;
+ if (!sessionsInstance)
+ sessionsInstance = new (ys) Sessions;
+ return *sessionsInstance;
}
-sslFactory sslFactory::instance_; // simple singleton
+static sslFactory* sslFactoryInstance = 0;
sslFactory& GetSSL_Factory()
-{
- return sslFactory::instance_;
+{
+ if (!sslFactoryInstance)
+ sslFactoryInstance = new (ys) sslFactory;
+ return *sslFactoryInstance;
+}
+
+
+void CleanUp()
+{
+ TaoCrypt::CleanUp();
+ ysDelete(sslFactoryInstance);
+ ysDelete(sessionsInstance);
}
--- 1.7/extra/yassl/taocrypt/include/integer.hpp 2005-06-10 17:09:35 +02:00
+++ 1.8/extra/yassl/taocrypt/include/integer.hpp 2006-04-18 12:08:02 +02:00
@@ -275,8 +275,6 @@
AlignedWordBlock reg_;
Sign sign_;
- static const Integer zero_;
- static const Integer one_;
};
inline bool operator==(const Integer& a, const Integer& b)
--- 1.8/extra/yassl/taocrypt/include/misc.hpp 2005-09-07 17:04:17 +02:00
+++ 1.9/extra/yassl/taocrypt/include/misc.hpp 2006-04-18 12:08:02 +02:00
@@ -34,6 +34,11 @@
namespace TaoCrypt {
+
+// Delete static singleton holders
+void CleanUp();
+
+
// library allocation
struct new_t {}; // TaoCrypt New type
extern new_t tc; // pass in parameter
--- 1.9/extra/yassl/taocrypt/include/runtime.hpp 2005-09-08 11:36:07 +02:00
+++ 1.10/extra/yassl/taocrypt/include/runtime.hpp 2006-04-18 12:08:02 +02:00
@@ -25,11 +25,27 @@
-#if !defined(yaSSL_NEW_HPP) && defined(__GNUC__)
-#if !(defined(__ICC) || defined(__INTEL_COMPILER))
-
+#ifndef yaSSL_NEW_HPP
#define yaSSL_NEW_HPP
+
+#ifdef __sun
+
+#include <assert.h>
+
+// Handler for pure virtual functions
+namespace __Crun {
+ static void pure_error(void)
+ {
+ assert("Pure virtual method called." == "Aborted");
+ }
+} // namespace __Crun
+
+#endif // __sun
+
+
+#if defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER))
+
#if __GNUC__ > 2
extern "C" {
@@ -47,6 +63,6 @@
} // extern "C"
#endif // __GNUC__ > 2
-#endif // ! _ICC
-#endif // yaSSL_NEW_HPP && __GNUC__
+#endif // compiler check
+#endif // yaSSL_NEW_HPP
--- 1.6/extra/yassl/taocrypt/src/algebra.cpp 2005-07-01 17:00:54 +02:00
+++ 1.7/extra/yassl/taocrypt/src/algebra.cpp 2006-04-18 12:08:02 +02:00
@@ -76,7 +76,9 @@
const Integer& AbstractEuclideanDomain::Gcd(const Element &a,
const Element &b) const
{
- Element g[3]={b, a};
+ mySTL::vector<Element> g(3);
+ g[0]= b;
+ g[1]= a;
unsigned int i0=0, i1=1, i2=2;
while (!Equal(g[i1], this->Identity()))
--- 1.17/extra/yassl/taocrypt/src/integer.cpp 2005-09-14 10:34:32 +02:00
+++ 1.18/extra/yassl/taocrypt/src/integer.cpp 2006-04-18 12:08:02 +02:00
@@ -2709,19 +2709,32 @@
}
-const Integer Integer::zero_;
+static Integer* zero = 0;
const Integer &Integer::Zero()
{
- return zero_;
+ if (!zero)
+ zero = new (tc) Integer;
+ return *zero;
}
-const Integer Integer::one_(1,2);
+static Integer* one = 0;
const Integer &Integer::One()
{
- return one_;
+ if (!one)
+ one = new (tc) Integer(1,2);
+ return *one;
+}
+
+
+// Clean up static singleton holders, not a leak, but helpful to have gone
+// when checking for leaks
+void CleanUp()
+{
+ tcDelete(one);
+ tcDelete(zero);
}
--- 1.6/extra/yassl/taocrypt/src/template_instnt.cpp 2005-07-01 17:00:55 +02:00
+++ 1.7/extra/yassl/taocrypt/src/template_instnt.cpp 2006-04-18 12:08:02 +02:00
@@ -41,6 +41,7 @@
template class RSA_Encryptor<RSA_BlockType1>;
template class RSA_Encryptor<RSA_BlockType2>;
template void tcDelete<HASH>(HASH*);
+template void tcDelete<Integer>(Integer*);
template void tcArrayDelete<byte>(byte*);
template AllocatorWithCleanup<byte>::pointer StdReallocate<byte, AllocatorWithCleanup<byte> >(AllocatorWithCleanup<byte>&, byte*, AllocatorWithCleanup<byte>::size_type, AllocatorWithCleanup<byte>::size_type, bool);
template void tcArrayDelete<word>(word*);
| Thread |
|---|
| • bk commit into 5.0 tree (msvensson:1.2118) BUG#18815 | msvensson | 18 Apr |