ossl_ocsp.c: typed data
* ext/openssl/ossl_ocsp.c (ossl_ocsp_request_type): use typed data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a6d16bdc0f
commit
4bb6cb76f2
@ -15,10 +15,10 @@
|
|||||||
|
|
||||||
#define WrapOCSPReq(klass, obj, req) do { \
|
#define WrapOCSPReq(klass, obj, req) do { \
|
||||||
if(!(req)) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \
|
if(!(req)) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \
|
||||||
(obj) = Data_Wrap_Struct((klass), 0, OCSP_REQUEST_free, (req)); \
|
(obj) = TypedData_Wrap_Struct((klass), &ossl_ocsp_request_type, (req)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define GetOCSPReq(obj, req) do { \
|
#define GetOCSPReq(obj, req) do { \
|
||||||
Data_Get_Struct((obj), OCSP_REQUEST, (req)); \
|
TypedData_Get_Struct((obj), OCSP_REQUEST, &ossl_ocsp_request_type, (req)); \
|
||||||
if(!(req)) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \
|
if(!(req)) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define SafeGetOCSPReq(obj, req) do { \
|
#define SafeGetOCSPReq(obj, req) do { \
|
||||||
@ -72,6 +72,20 @@ VALUE cOCSPRes;
|
|||||||
VALUE cOCSPBasicRes;
|
VALUE cOCSPBasicRes;
|
||||||
VALUE cOCSPCertId;
|
VALUE cOCSPCertId;
|
||||||
|
|
||||||
|
static void
|
||||||
|
ossl_ocsp_request_free(void *ptr)
|
||||||
|
{
|
||||||
|
OCSP_REQUEST_free(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const rb_data_type_t ossl_ocsp_request_type = {
|
||||||
|
"OpenSSL/OCSP/REQUEST",
|
||||||
|
{
|
||||||
|
0, ossl_ocsp_request_free,
|
||||||
|
},
|
||||||
|
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Public
|
* Public
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user