[前][次][番号順一覧][スレッド一覧]

ruby-changes:14979

From: nahi <ko1@a...>
Date: Mon, 8 Mar 2010 15:11:23 +0900 (JST)
Subject: [ruby-changes:14979] Ruby:r26850 (ruby_1_8): * ext/openssl/ossl_ssl_session.c

nahi	2010-03-08 15:09:26 +0900 (Mon, 08 Mar 2010)

  New Revision: 26850

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26850

  Log:
    * ext/openssl/ossl_ssl_session.c
              (ossl_ssl_session_{get,set}_time{,out}): fixed a bug introduced by
              backporting. (see [ruby-dev:40573])  use long in according to
              OpenSSL API. (SSL_SESSION_{get,set}_time{,out})

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/ext/openssl/ossl_ssl_session.c

Index: ruby_1_8/ext/openssl/ossl_ssl_session.c
===================================================================
--- ruby_1_8/ext/openssl/ossl_ssl_session.c	(revision 26849)
+++ ruby_1_8/ext/openssl/ossl_ssl_session.c	(revision 26850)
@@ -98,7 +98,7 @@
 static VALUE ossl_ssl_session_get_time(VALUE self)
 {
 	SSL_SESSION *ctx;
-	time_t t;
+	long t;
 
 	GetSSLSession(self, ctx);
 
@@ -107,7 +107,7 @@
 	if (t == 0)
 		return Qnil;
 
-	return rb_funcall(rb_cTime, rb_intern("at"), 1, TIMET2NUM(t));
+	return rb_funcall(rb_cTime, rb_intern("at"), 1, LONG2NUM(t));
 }
 
 /*
@@ -120,20 +120,20 @@
 static VALUE ossl_ssl_session_get_timeout(VALUE self)
 {
 	SSL_SESSION *ctx;
-	time_t t;
+	long t;
 
 	GetSSLSession(self, ctx);
 
 	t = SSL_SESSION_get_timeout(ctx);
 
-	return TIMET2NUM(t);
+	return LONG2NUM(t);
 }
 
 #define SSLSESSION_SET_TIME(func)						\
 	static VALUE ossl_ssl_session_set_##func(VALUE self, VALUE time_v)	\
 	{									\
 		SSL_SESSION *ctx;						\
-		unsigned long t;						\
+		long t;								\
 										\
 		GetSSLSession(self, ctx);					\
 										\
@@ -145,7 +145,7 @@
 			rb_raise(rb_eArgError, "unknown type");			\
 		}								\
 										\
-		t = NUM2ULONG(time_v);						\
+		t = NUM2LONG(time_v);						\
 										\
 		SSL_SESSION_set_##func(ctx, t);					\
 										\
Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 26849)
+++ ruby_1_8/ChangeLog	(revision 26850)
@@ -1,3 +1,10 @@
+Mon Mar  8 14:58:42 2010  NAKAMURA, Hiroshi  <nahi@r...>
+
+	* ext/openssl/ossl_ssl_session.c
+	  (ossl_ssl_session_{get,set}_time{,out}): fixed a bug introduced by
+	  backporting. (see [ruby-dev:40573])  use long in according to
+	  OpenSSL API. (SSL_SESSION_{get,set}_time{,out})
+
 Sun Mar  7 06:47:05 2010  NAKAMURA, Hiroshi  <nahi@r...>
 
 	* ext/openssl/ossl_x509name.c: added X509::Name#hash_old as a wrapper

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]