[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Libevent-users] Purpose of use_wrapper in le-proxy.c?



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.