Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow storing void* data into the strp_t session. #65

Closed
ibc opened this issue Aug 17, 2014 · 1 comment · Fixed by #66
Closed

Allow storing void* data into the strp_t session. #65

ibc opened this issue Aug 17, 2014 · 1 comment · Fixed by #66

Comments

@ibc
Copy link
Contributor

ibc commented Aug 17, 2014

When libsrtp fires a provisioned callback it calls it with a srtp_event_data_t struct as argument. The struct contains some fields, including the srtp_t session the event belongs to.

The problem is that I cannot associate my "application SRTP handler" with such a srtp_t session so when the callback is fired I do not know which of my SRTP handlers the session belongs to.

I suggest adding a void* user_data into the srtp_t struct, and two new functions:

void srtp_set_user_data(srtp_t session, void* data);
void* srtp_get_user_data(srtp_t session);

NOTE: This is similar to what other C libraries do. For example OpenSSL provides some functions for this same purpose:

int SSL_set_ex_data(SSL *ssl, int idx, void *arg);
void *SSL_get_ex_data(const SSL *ssl, int idx);
@ibc
Copy link
Contributor Author

ibc commented Aug 20, 2014

My pull request in #66 implements this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant