Skip to content

Commit

Permalink
Added starting DTLS MTU to info returned by Janus API
Browse files Browse the repository at this point in the history
  • Loading branch information
lminiero committed Jan 26, 2021
1 parent 4d97028 commit 7fb08c2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dtls-bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ void janus_dtls_bio_agent_set_mtu(int start_mtu) {
mtu = start_mtu;
JANUS_LOG(LOG_VERB, "Setting starting MTU in the DTLS BIO writer: %d\n", mtu);
}
int janus_dtls_bio_agent_get_mtu(void) {
return mtu;
}

/* BIO implementation */
static int janus_dtls_bio_agent_write(BIO *h, const char *buf, int num);
Expand Down
5 changes: 4 additions & 1 deletion dtls-bio.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ BIO *BIO_janus_dtls_agent_new(void *dtls);
* you know for sure the MTU in the network Janus is deployed in is
* smaller than that, it makes sense to configure an according value to
* start from
* @param start_mtu The MTU to start from (1472 by default)
* @param start_mtu The MTU to start from (1200 by default)
*/
void janus_dtls_bio_agent_set_mtu(int start_mtu);
/*! \brief Return which MTU was configured for the BIO agent writer
* @returns The MTU the stack will start from for each session */
int janus_dtls_bio_agent_get_mtu(void);

#if defined(LIBRESSL_VERSION_NUMBER)
#define JANUS_USE_OPENSSL_PRE_1_1_API (1)
Expand Down
1 change: 1 addition & 0 deletions janus.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ static json_t *janus_info(const char *transaction) {
json_object_set_new(info, "twcc-period", json_integer(janus_get_twcc_period()));
if(janus_get_dscp() > 0)
json_object_set_new(info, "dscp", json_integer(janus_get_dscp()));
json_object_set_new(info, "dtls-mtu", json_integer(janus_dtls_bio_agent_get_mtu()));
if(janus_ice_get_stun_server() != NULL) {
char server[255];
g_snprintf(server, 255, "%s:%"SCNu16, janus_ice_get_stun_server(), janus_ice_get_stun_port());
Expand Down

0 comments on commit 7fb08c2

Please sign in to comment.