Author: mturk
Date: Mon Sep 12 15:22:55 2011
New Revision: 1169795
URL: http://svn.apache.org/viewvc?rev=1169795&view=rev
Log:
Fix pre 1.0.0 ABI
Modified:
commons/sandbox/runtime/trunk/src/main/native/modules/openssl/api.c
commons/sandbox/runtime/trunk/src/main/native/os/linux/epoll.c
Modified: commons/sandbox/runtime/trunk/src/main/native/modules/openssl/api.c
URL:
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/modules/openssl/api.c?rev=1169795&r1=1169794&r2=1169795&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/modules/openssl/api.c
(original)
+++ commons/sandbox/runtime/trunk/src/main/native/modules/openssl/api.c Mon Sep
12 15:22:55 2011
@@ -135,12 +135,12 @@ struct SSLAPIst {
/*** RSA ***/
RSA* (*fpRSA_generate_key)(int, unsigned long , void
(*)(int,int,void *), void *);
-
+
/*** SSL_CTX ***/
long (*fpSSL_CTX_ctrl)(SSL_CTX *, int, long, void *);
SSL_CTX* (*fpSSL_CTX_new)(CONST_SSL_METHOD *);
void (*fpSSL_CTX_free)(SSL_CTX *);
-
+
/*** SSL ***/
void* (*fpSSL_get_ex_data)(const SSL *, int);
int (*fpSSL_get_ex_new_index)(long, void *, CRYPTO_EX_new
*, CRYPTO_EX_dup *, CRYPTO_EX_free *);
@@ -166,7 +166,7 @@ struct SSLAPIst {
void (*fpSSL_CTX_set_default_passwd_cb)(SSL_CTX *,
pem_password_cb *);
void (*fpSSL_CTX_set_default_passwd_cb_userdata)(SSL_CTX
*ctx, void *u);
-
+
/*** X509 ***/
void (*fpX509_free)(X509 *);
void (*fpNULL)(void);
@@ -175,7 +175,7 @@ struct SSLAPIst {
#if (OPENSSL_VERSION_NUMBER >= 0x10000000)
void (*fpsk_pop_free)(_STACK *, void (*)(void *));
#endif
-
+
};
struct SSLOPTst {
@@ -207,7 +207,7 @@ struct SSLOPTst {
CONST_SSL_METHOD* (*fpSSLv2_server_method)(void); /* SSLv2 */
CONST_SSL_METHOD* (*fpSSLv2_client_method)(void); /* SSLv2 */
#endif
-
+
void (*fpNULL)(void);
};
@@ -230,7 +230,7 @@ ACR_JNI_EXPORT(jboolean, Native, ldopens
if ((libssldso = AcrDsoLoad(SSL_DSO_NAME)) == 0) {
ACR_THROW_SYS_ERRNO();
return JNI_FALSE;
- }
+ }
LIBSSL_FPLOAD(SSLeay);
LIBSSL_FPLOAD(SSLeay_version);
if (SSLeay() < 0x00908000L) {
@@ -258,7 +258,7 @@ ACR_JNI_EXPORT(jboolean, Native, ldopens
LIBSSL_FPLOAD(DTLSv1_method);
LIBSSL_FPLOAD(DTLSv1_server_method);
LIBSSL_FPLOAD(DTLSv1_client_method);
-
+
/*** SSL_CTX ***/
LIBSSL_FPLOAD(SSL_CTX_ctrl);
LIBSSL_FPLOAD(SSL_CTX_new);
@@ -266,7 +266,7 @@ ACR_JNI_EXPORT(jboolean, Native, ldopens
LIBSSL_FPLOAD(SSL_CTX_set_default_passwd_cb);
LIBSSL_FPLOAD(SSL_CTX_set_default_passwd_cb_userdata);
-
+
/*** BIO ***/
CRYPTO_FPLOAD(BIO_ctrl);
CRYPTO_FPLOAD(BIO_free);
@@ -319,13 +319,14 @@ ACR_JNI_EXPORT(jboolean, Native, ldopens
/*** RSA ***/
CRYPTO_FPLOAD(RSA_generate_key);
-
+
/*** X509 ***/
CRYPTO_FPLOAD(X509_free);
/*** _STACK ***/
+#if (OPENSSL_VERSION_NUMBER >= 0x10000000)
CRYPTO_FPLOAD(sk_pop_free);
-
+#endif
/* Optional functions
* We could compile with the HAVE_FIPS, but target OpenSSL might not
* have FIPS support for example.
@@ -346,7 +347,7 @@ ACR_JNI_EXPORT(jboolean, Native, ldopens
CRYPTO_LDDOPT(ENGINE_register_all_complete);
CRYPTO_LDDOPT(ENGINE_set_default);
CRYPTO_LDDOPT(RAND_set_rand_engine);
-#endif
+#endif
#ifndef OPENSSL_NO_SSL2
LIBSSL_LDDOPT(SSLv2_method);
LIBSSL_LDDOPT(SSLv2_server_method);
@@ -366,7 +367,7 @@ failed:
* Wrappers are currently manually maintained, so if any
* additional OpenSSL function is used it has to be added
* to the SSLapi struct and locally declared.
- *
+ *
*/
unsigned long SSLeay()
{
@@ -713,10 +714,12 @@ void X509_free(X509 *x)
SSLAPI_CALL(X509_free)(x);
}
+#if (OPENSSL_VERSION_NUMBER >= 0x10000000)
void sk_pop_free(_STACK *st, void (*func)(void *))
{
SSLAPI_CALL(sk_pop_free)(st, func);
}
+#endif
#if HAVE_FIPS
int FIPS_mode(void)
Modified: commons/sandbox/runtime/trunk/src/main/native/os/linux/epoll.c
URL:
http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/linux/epoll.c?rev=1169795&r1=1169794&r2=1169795&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/linux/epoll.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/linux/epoll.c Mon Sep 12
15:22:55 2011
@@ -168,7 +168,7 @@ ACR_NET_EXPORT(jlong, UnixSelector, crea
ACR_THROW_NET_ERRNO();
goto cleanup;
}
- if ((rc = AcrCloseOnExec(ps->epfd)) != 0) {
+ if ((rc = AcrCloseOnExec(ps->epfd, 1)) != 0) {
ACR_THROW_NET_ERROR(rc);
goto cleanup;
}
@@ -195,7 +195,7 @@ ACR_NET_EXPORT(jlong, UnixSelector, crea
/* Failed adding pipe to the pollset
*/
ACR_THROW_NET_ERRNO();
- goto cleanup;
+ goto cleanup;
}
if (pthread_cond_init(&ps->wakeup, 0) != 0) {
ACR_THROW_NET_ERRNO();
@@ -252,7 +252,7 @@ ACR_NET_EXPORT(void, UnixSelector, clr0)
return;
}
/* Make sure we have enough storage */
- AcrArrayListEnsureCapacity(env, sset, ps->used - 1);
+ AcrArrayListEnsureCapacity(env, sset, ps->used - 1);
ACR_RING_FOREACH_SAFE(pe, np, &ps->eset_ring, pfd_elem_t, link) {
if (ps->wpipe[0] != pe->fd) {
epoll_ctl(ps->epfd, EPOLL_CTL_DEL, pe->fd, &ev);
@@ -263,7 +263,7 @@ ACR_NET_EXPORT(void, UnixSelector, clr0)
ACR_RING_INSERT_TAIL(&ps->free_ring, pe, pfd_elem_t, link);
}
}
-
+
ps->used = 1;
pthread_mutex_unlock(&ps->mutex);
}
@@ -314,7 +314,7 @@ ACR_NET_EXPORT(jint, UnixSelector, add0)
goto cleanup;
}
}
-
+
if (!ACR_RING_EMPTY(&ps->free_ring, pfd_elem_t, link)) {
pe = ACR_RING_FIRST(&ps->free_ring);
ACR_RING_REMOVE(pe, link);
@@ -327,7 +327,7 @@ ACR_NET_EXPORT(jint, UnixSelector, add0)
}
ACR_RING_ELEM_INIT(pe, link);
}
-
+
pe->fd = fd->s;
pe->ievents = ieventt(events);
pe->revents = 0;
@@ -602,7 +602,7 @@ cleanup:
}
}
}
- }
+ }
/* Shift all PFDs in the Dead Ring to the Free Ring */
ACR_RING_CONCAT(&ps->free_ring, &ps->dead_ring, pfd_elem_t, link);
AcrAtomic32Set(&ps->state, 0);