diff options
author | Badlop <badlop@process-one.net> | 2011-12-21 12:15:21 +0100 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2011-12-21 12:15:21 +0100 |
commit | 2029e39299aebe3c4882a26294f4caadc8881265 (patch) | |
tree | 1e4b7391dbd3dcc42b21f64ffdae7a721e047dd7 /src/tls/tls_drv.c | |
parent | Replace regexp with ejabberd_regexp (diff) |
Support Erlang/OTP R15B driver (EJAB-1521)
Diffstat (limited to '')
-rw-r--r-- | src/tls/tls_drv.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/src/tls/tls_drv.c b/src/tls/tls_drv.c index bdb5446f..c4210055 100644 --- a/src/tls/tls_drv.c +++ b/src/tls/tls_drv.c @@ -45,6 +45,16 @@ typedef unsigned __int32 uint32_t; #endif /* + * R15B changed several driver callbacks to use ErlDrvSizeT and + * ErlDrvSSizeT typedefs instead of int. + * This provides missing typedefs on older OTP versions. + */ +#if ERL_DRV_EXTENDED_MAJOR_VERSION < 2 +typedef int ErlDrvSizeT; +typedef int ErlDrvSSizeT; +#endif + +/* * str_hash is based on the public domain code from * http://www.burtleburtle.net/bob/hash/doobs.html */ @@ -305,10 +315,10 @@ static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) } -static int tls_drv_control(ErlDrvData handle, +static ErlDrvSSizeT tls_drv_control(ErlDrvData handle, unsigned int command, - char *buf, int len, - char **rbuf, int rlen) + char *buf, ErlDrvSizeT len, + char **rbuf, ErlDrvSizeT rlen) { tls_data *d = (tls_data *)handle; int res; @@ -503,7 +513,19 @@ ErlDrvEntry tls_driver_entry = { NULL, /* handle */ tls_drv_control, /* F_PTR control, port_command callback */ NULL, /* F_PTR timeout, reserved */ - NULL /* F_PTR outputv, reserved */ + NULL, /* F_PTR outputv, reserved */ + /* Added in Erlang/OTP R15B: */ + NULL, /* ready_async */ + NULL, /* flush */ + NULL, /* call */ + NULL, /* event */ + ERL_DRV_EXTENDED_MARKER, /* extended_marker */ + ERL_DRV_EXTENDED_MAJOR_VERSION, /* major_version */ + ERL_DRV_EXTENDED_MINOR_VERSION, /* minor_version */ + 0, /* driver_flags */ + NULL, /* handle2 */ + NULL, /* process_exit */ + NULL /* stop_select */ }; DRIVER_INIT(tls_drv) /* must match name in driver_entry */ |