forked from libevent/libevent
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rebased (azat): - tabs instead of whitespaces - make openssl-compat.h safe for complex expressions - do not call sk_SSL_COMP_free() in 1.1 (fixes double free) TODO: - clean methods_bufferevent Closes: libevent#397 (cherry-picked)
- Loading branch information
Showing
5 changed files
with
102 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#ifndef OPENSSL_COMPAT_H | ||
#define OPENSSL_COMPAT_H | ||
|
||
#if OPENSSL_VERSION_NUMBER < 0x10100000L | ||
|
||
static BIO_METHOD *BIO_meth_new(int type, const char *name) | ||
{ | ||
BIO_METHOD *biom = calloc(1, sizeof(BIO_METHOD)); | ||
|
||
if (biom != NULL) { | ||
biom->type = type; | ||
biom->name = name; | ||
} | ||
return biom; | ||
} | ||
|
||
#define BIO_meth_set_write(b, f) (b)->bwrite = (f) | ||
#define BIO_meth_set_read(b, f) (b)->bread = (f) | ||
#define BIO_meth_set_puts(b, f) (b)->bputs = (f) | ||
#define BIO_meth_set_ctrl(b, f) (b)->ctrl = (f) | ||
#define BIO_meth_set_create(b, f) (b)->create = (f) | ||
#define BIO_meth_set_destroy(b, f) (b)->destroy = (f) | ||
|
||
#define BIO_set_init(b, val) (b)->init = (val) | ||
#define BIO_set_data(b, val) (b)->ptr = (val) | ||
#define BIO_set_shutdown(b, val) (b)->shutdown = (val) | ||
#define BIO_get_init(b) (b)->init | ||
#define BIO_get_data(b) (b)->ptr | ||
#define BIO_get_shutdown(b) (b)->shutdown | ||
|
||
#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */ | ||
|
||
#endif /* OPENSSL_COMPAT_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters