* ext/openssl/ossl_ssl.c: Remove set, but unused variables.

ext/openssl/ossl_pkey.c: ditto

* ext/openssl/ossl_pkey_dh.c: Make functions passed to
  rb_thread_blocking_region return VALUE instead of void. 
  ext/openssl/ossl_pkey_dsa.c: ditto
  ext/openssl/ossl_pkey_rsa.c: ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
emboss 2011-10-19 01:15:35 +00:00
Родитель 12c497dcf6
Коммит c35204f7bd
6 изменённых файлов: 24 добавлений и 11 удалений

Просмотреть файл

@ -1,3 +1,13 @@
Wed Oct 19 12:11:26 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>
* ext/openssl/ossl_ssl.c: Remove set, but unused variables.
ext/openssl/ossl_pkey.c: ditto
* ext/openssl/ossl_pkey_dh.c: Make functions passed to
rb_thread_blocking_region return VALUE instead of void.
ext/openssl/ossl_pkey_dsa.c: ditto
ext/openssl/ossl_pkey_rsa.c: ditto
Tue Oct 18 23:28:53 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* hash.c (identhash): share with type_numhash.

Просмотреть файл

@ -38,7 +38,7 @@ ossl_generate_cb(int p, int n, void *arg)
int
ossl_generate_cb_2(int p, int n, BN_GENCB *cb)
{
VALUE ary, ret;
VALUE ary;
struct ossl_generate_cb_arg *arg;
int state;
@ -51,7 +51,7 @@ ossl_generate_cb_2(int p, int n, BN_GENCB *cb)
/*
* can be break by raising exception or 'break'
*/
ret = rb_protect(rb_yield, ary, &state);
rb_protect(rb_yield, ary, &state);
if (state) {
arg->stop = 1;
arg->state = state;

Просмотреть файл

@ -90,11 +90,12 @@ struct dh_blocking_gen_arg {
int result;
};
static void
static VALUE
dh_blocking_gen(void *arg)
{
struct dh_blocking_gen_arg *gen = (struct dh_blocking_gen_arg *)arg;
gen->result = DH_generate_parameters_ex(gen->dh, gen->size, gen->gen, gen->cb);
return Qnil;
}
#endif

Просмотреть файл

@ -87,11 +87,12 @@ struct dsa_blocking_gen_arg {
int result;
};
static void
static VALUE
dsa_blocking_gen(void *arg)
{
struct dsa_blocking_gen_arg *gen = (struct dsa_blocking_gen_arg *)arg;
gen->result = DSA_generate_parameters_ex(gen->dsa, gen->size, gen->seed, gen->seed_len, gen->counter, gen->h, gen->cb);
return Qnil;
}
#endif

Просмотреть файл

@ -85,11 +85,12 @@ struct rsa_blocking_gen_arg {
int result;
};
static void
static VALUE
rsa_blocking_gen(void *arg)
{
struct rsa_blocking_gen_arg *gen = (struct rsa_blocking_gen_arg *)arg;
gen->result = RSA_generate_key_ex(gen->rsa, gen->size, gen->e, gen->cb);
return Qnil;
}
#endif

Просмотреть файл

@ -380,7 +380,7 @@ ossl_call_session_new_cb(VALUE ary)
static int
ossl_sslctx_session_new_cb(SSL *ssl, SSL_SESSION *sess)
{
VALUE ary, ssl_obj, sess_obj, ret_obj;
VALUE ary, ssl_obj, sess_obj;
void *ptr;
int state = 0;
@ -397,7 +397,7 @@ ossl_sslctx_session_new_cb(SSL *ssl, SSL_SESSION *sess)
rb_ary_push(ary, ssl_obj);
rb_ary_push(ary, sess_obj);
ret_obj = rb_protect((VALUE(*)_((VALUE)))ossl_call_session_new_cb, ary, &state);
rb_protect((VALUE(*)_((VALUE)))ossl_call_session_new_cb, ary, &state);
if (state) {
rb_ivar_set(ssl_obj, ID_callback_state, INT2NUM(state));
}
@ -429,7 +429,7 @@ ossl_call_session_remove_cb(VALUE ary)
static void
ossl_sslctx_session_remove_cb(SSL_CTX *ctx, SSL_SESSION *sess)
{
VALUE ary, sslctx_obj, sess_obj, ret_obj;
VALUE ary, sslctx_obj, sess_obj;
void *ptr;
int state = 0;
@ -446,7 +446,7 @@ ossl_sslctx_session_remove_cb(SSL_CTX *ctx, SSL_SESSION *sess)
rb_ary_push(ary, sslctx_obj);
rb_ary_push(ary, sess_obj);
ret_obj = rb_protect((VALUE(*)_((VALUE)))ossl_call_session_remove_cb, ary, &state);
rb_protect((VALUE(*)_((VALUE)))ossl_call_session_remove_cb, ary, &state);
if (state) {
/*
the SSL_CTX is frozen, nowhere to save state.
@ -506,7 +506,7 @@ ossl_call_servername_cb(VALUE ary)
static int
ssl_servername_cb(SSL *ssl, int *ad, void *arg)
{
VALUE ary, ssl_obj, ret_obj;
VALUE ary, ssl_obj;
void *ptr;
int state = 0;
const char *servername = SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name);
@ -521,7 +521,7 @@ ssl_servername_cb(SSL *ssl, int *ad, void *arg)
rb_ary_push(ary, ssl_obj);
rb_ary_push(ary, rb_str_new2(servername));
ret_obj = rb_protect((VALUE(*)_((VALUE)))ossl_call_servername_cb, ary, &state);
rb_protect((VALUE(*)_((VALUE)))ossl_call_servername_cb, ary, &state);
if (state) {
rb_ivar_set(ssl_obj, ID_callback_state, INT2NUM(state));
return SSL_TLSEXT_ERR_ALERT_FATAL;