mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
1 changed files with 16 additions and 2 deletions
|
@ -15,10 +15,10 @@
|
|||
|
||||
#define WrapOCSPReq(klass, obj, req) do { \
|
||||
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)
|
||||
#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!"); \
|
||||
} while (0)
|
||||
#define SafeGetOCSPReq(obj, req) do { \
|
||||
|
@ -72,6 +72,20 @@ VALUE cOCSPRes;
|
|||
VALUE cOCSPBasicRes;
|
||||
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
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue