int tls_connect_cbs(struct tls *ctx, tls_read_cb read_cb, tls_write_cb write_cb, void *cb_arg, const char *servername) { int rv = -1; if (tls_connect_common(ctx, servername) != 0) goto err; if (tls_set_cbs(ctx, read_cb, write_cb, cb_arg) != 0) goto err; rv = 0; err: return (rv); }
int tls_connect_cbs(struct tls *ctx, tls_read_cb read_cb, tls_write_cb write_cb, void *cb_arg, const char *servername) { int rv = -1; if (tls_connect_common(ctx, servername) != 0) goto err; if (tls_set_cbs(ctx, read_cb, write_cb, cb_arg) != 0) { tls_set_errorx(ctx, "callback registration failure"); goto err; } rv = 0; err: return (rv); }