Subject: | get_my_thread_id call method 'tid' if no threads used |
When bootstrapping Net::SSleay ( with DynaLoader ) if you override the SIG{DIE} signal, using
Net::SSLeay will result in an error.
We do not check if threads are used before calling this method.
It will be nice to check it before, but here is an easy patch that will do it in the function.
(internal error) Fri Mar 2 14:14:11 2012 [4605] error: Can't locate object method "tid" via
package "threads" (perhaps you forgot to load "threads"?) at /usr/local/lib/perl5/5.8.8/x86_64-
linux/DynaLoader.pm line 248.
at /usr/local/lib/perl5/5.8.8/x86_64-linux/DynaLoader.pm line 248
eval {...} called at /usr/local/lib/perl5/5.8.8/x86_64-linux/DynaLoader.pm line 248
DynaLoader::bootstrap('Net::SSLeay', 1.45) called at /usr/local/lib/perl5/5.8.8/x86_64-
linux/DynaLoader.pm line 119
DynaLoader::bootstrap_inherit('Net::SSLeay', 1.45) called at lib/Net/SSLeay.pm line 630
Subject: | 0001-patch.patch |
From 0260895704c9103c534c2880acf6ce537923fe9a Mon Sep 17 00:00:00 2001
From: Nicolas R, <me@eboxr.com>
Date: Fri, 2 Mar 2012 14:55:37 -0600
Subject: [PATCH] patch
---
SSLeay.xs | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/SSLeay.xs b/SSLeay.xs
index ad89735..f4cabd2 100644
--- a/SSLeay.xs
+++ b/SSLeay.xs
@@ -106,8 +106,9 @@ UV get_my_thread_id(void) /* returns threads->tid() value */
{
dSP;
UV tid;
- int count;
+ int count = 0;
+#ifdef USE_ITHREADS
ENTER;
SAVETMPS;
PUSHMARK(SP);
@@ -123,6 +124,7 @@ UV get_my_thread_id(void) /* returns threads->tid() value */
PUTBACK;
FREETMPS;
LEAVE;
+#endif
return tid;
}
--
1.7.7.4