Browse Source

MT#55283 switch callback argument

We already use the `dtls_connection` object as "app data" so let's use
it for the BIO callback arg as well.

Change-Id: I715b6756ea36c7a3cb2bed68fce17108eb480e23
(cherry picked from commit 8297449aa1)
mr13.4
Richard Fuchs 4 months ago
parent
commit
5bc16aeea5
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      daemon/dtls.c

+ 5
- 5
daemon/dtls.c View File

@ -617,15 +617,15 @@ static long dtls_bio_callback(BIO *bio, int oper, const char *argp, size_t len,
if (!argp || len <= 0)
return ret;
struct packet_stream *ps = (struct packet_stream *) BIO_get_callback_arg(bio);
struct dtls_connection *d = (struct dtls_connection *) BIO_get_callback_arg(bio);
if (!d)
return ret;
struct packet_stream *ps = d->ps;
if (!ps)
return ret;
struct stream_fd *sfd = ps->selected_sfd;
if (!sfd)
return ret;
struct dtls_connection *d = dtls_ptr(sfd);
if (!d)
return ret;
__DBG("dtls packet output: len %zu %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
len,
@ -711,7 +711,7 @@ int dtls_connection_init(struct dtls_connection *d, struct packet_stream *ps, in
#else
BIO_set_callback(d->w_bio, dtls_bio_callback_wrap);
#endif
BIO_set_callback_arg(d->w_bio, (char *) ps);
BIO_set_callback_arg(d->w_bio, (char *) d);
#if defined(BIO_CTRL_DGRAM_SET_MTU)
BIO_ctrl(d->w_bio, BIO_CTRL_DGRAM_SET_MTU, rtpe_config.dtls_mtu, NULL);


Loading…
Cancel
Save