[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] Purpose of use_wrapper in le-proxy.c?
- To: libevent-users@xxxxxxxx
- Subject: [Libevent-users] Purpose of use_wrapper in le-proxy.c?
- From: Jeffrey Walton <noloader@xxxxxxxxx>
- Date: Mon, 24 Feb 2014 13:24:13 -0500
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Mon, 24 Feb 2014 13:24:17 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:date:message-id:subject:from:to:content-type; bh=7hra+yokZQ4KYyXJanNi6ht5/JpYfaDh2yzq868VQNU=; b=IbKe8CMfiinOOtbnN1f+2DBrTB2jJFIolC/Uos3gM/LsDNWzy0YViwcrARl7sUaadR ApIAqPqD495k0lH8TbuZlVeJ3WaFJG2Q5il86xz+dV1eKlxnw1bkQYbt2pOAXGVDyvdC ih7/6YeqgKMJNW6HVHgW3qfwu9PGx2gsMxaNO3KFQQVgg7xNQMoVWuQ2KiUu1v6QmsSs hOfepSuf46G7IV5xyzRlnilIMDsUy0dOj31KD3x357I0s32xECq/kWiLgErz2WG8gbQA VKo0jNP60GmbuwNTDmjIGVV2k6uLhz/8IAMnARlu0+r6xLLHZ+QpuDbVfVvwso3sGf2O DomQ==
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
samples/le-proxy.c has a `use_wrapper` flag. Its used in, for example,
`accept_cb` (parts shown below). I don't quite understand its purpose.
There's also a `use_ssl` and that's tied to `ssl_ctx` (and the source
code mkes some decisions around `ssl_ctx`, which makes sense to me).
What is the purpose of `use_wrapper`?
Thanks in advance.
*****
if (!ssl_ctx || use_wrapper)
b_out = bufferevent_socket_new(base, -1,
BEV_OPT_CLOSE_ON_FREE|BEV_OPT_DEFER_CALLBACKS);
else {
SSL *ssl = SSL_new(ssl_ctx);
b_out = bufferevent_openssl_socket_new(base, -1, ssl,
BUFFEREVENT_SSL_CONNECTING,
BEV_OPT_CLOSE_ON_FREE|BEV_OPT_DEFER_CALLBACKS);
}
...
if (ssl_ctx && use_wrapper) {
struct bufferevent *b_ssl;
SSL *ssl = SSL_new(ssl_ctx);
b_ssl = bufferevent_openssl_filter_new(base,
b_out, ssl, BUFFEREVENT_SSL_CONNECTING,
BEV_OPT_CLOSE_ON_FREE|BEV_OPT_DEFER_CALLBACKS);
if (!b_ssl) {
perror("Bufferevent_openssl_new");
bufferevent_free(b_out);
bufferevent_free(b_in);
}
b_out = b_ssl;
}
...
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.