From 14017831536e23d4d98c94edeffa720d869e88f8 Mon Sep 17 00:00:00 2001 From: technorama Date: Tue, 26 Feb 2008 07:11:23 +0000 Subject: * ext/openssl/ossl_pkey_{ec,dh,dsa,rsa}.c: Remove useless warnings. * ext/openssl/ossl_asn1.c: Simplify code. * ext/openssl/ossl_ssl_session.c Fix compiler warnings. Undefine #id if SSL_SESSION_get_id is not supported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/openssl/ossl_ssl_session.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ext/openssl/ossl_ssl_session.c') diff --git a/ext/openssl/ossl_ssl_session.c b/ext/openssl/ossl_ssl_session.c index b347f2c1b2..82de3efbe3 100644 --- a/ext/openssl/ossl_ssl_session.c +++ b/ext/openssl/ossl_ssl_session.c @@ -174,7 +174,7 @@ static VALUE ossl_ssl_session_get_id(VALUE self) p = SSL_SESSION_get_id(ctx, &i); - return rb_str_new(p, i); + return rb_str_new((const char *) p, i); } #endif @@ -200,7 +200,7 @@ static VALUE ossl_ssl_session_to_der(VALUE self) else if (len >= sizeof(buf)) ossl_raise(eSSLSession, "i2d_SSL_SESSION too large"); - return rb_str_new(p, len); + return rb_str_new((const char *) p, len); } /* @@ -289,6 +289,8 @@ void Init_ossl_ssl_session(void) #ifdef HAVE_SSL_SESSION_GET_ID rb_define_method(cSSLSession, "id", ossl_ssl_session_get_id, 0); +#else + rb_undef_method(cSSLSession, "id"); #endif rb_define_method(cSSLSession, "to_der", ossl_ssl_session_to_der, 0); rb_define_method(cSSLSession, "to_pem", ossl_ssl_session_to_pem, 0); -- cgit v1.2.3