diff options
Diffstat (limited to 'pjnath')
-rw-r--r-- | pjnath/include/pjnath/stun_sock.h | 4 | ||||
-rw-r--r-- | pjnath/include/pjnath/turn_sock.h | 7 | ||||
-rw-r--r-- | pjnath/src/pjnath/turn_sock.c | 3 |
3 files changed, 12 insertions, 2 deletions
diff --git a/pjnath/include/pjnath/stun_sock.h b/pjnath/include/pjnath/stun_sock.h index 08b0c711..db7d1d04 100644 --- a/pjnath/include/pjnath/stun_sock.h +++ b/pjnath/include/pjnath/stun_sock.h @@ -218,7 +218,9 @@ typedef struct pj_stun_sock_info typedef struct pj_stun_sock_cfg { /** - * Packet buffer size. Default value is PJ_STUN_SOCK_PKT_LEN. + * Packet buffer size. + * + * Default value is PJ_STUN_SOCK_PKT_LEN. */ unsigned max_pkt_size; diff --git a/pjnath/include/pjnath/turn_sock.h b/pjnath/include/pjnath/turn_sock.h index 6057f39e..c1250856 100644 --- a/pjnath/include/pjnath/turn_sock.h +++ b/pjnath/include/pjnath/turn_sock.h @@ -109,6 +109,13 @@ typedef struct pj_turn_sock_cb typedef struct pj_turn_sock_cfg { /** + * Packet buffer size. + * + * Default value is PJ_TURN_MAX_PKT_LEN. + */ + unsigned max_pkt_size; + + /** * QoS traffic type to be set on this transport. When application wants * to apply QoS tagging to the transport, it's preferable to set this * field rather than \a qos_param fields since this is more portable. diff --git a/pjnath/src/pjnath/turn_sock.c b/pjnath/src/pjnath/turn_sock.c index e841af2c..131c433d 100644 --- a/pjnath/src/pjnath/turn_sock.c +++ b/pjnath/src/pjnath/turn_sock.c @@ -97,6 +97,7 @@ static void timer_cb(pj_timer_heap_t *th, pj_timer_entry *e); PJ_DEF(void) pj_turn_sock_cfg_default(pj_turn_sock_cfg *cfg) { pj_bzero(cfg, sizeof(*cfg)); + cfg->max_pkt_size = PJ_TURN_MAX_PKT_LEN; cfg->qos_type = PJ_QOS_TYPE_BEST_EFFORT; cfg->qos_ignore_error = PJ_TRUE; } @@ -474,7 +475,7 @@ static pj_bool_t on_connect_complete(pj_activesock_t *asock, /* Kick start pending read operation */ status = pj_activesock_start_read(asock, turn_sock->pool, - PJ_TURN_MAX_PKT_LEN, 0); + turn_sock->setting.max_pkt_size, 0); /* Init send_key */ pj_ioqueue_op_key_init(&turn_sock->send_key, sizeof(turn_sock->send_key)); |