mirror of
https://github.com/coturn/coturn.git
synced 2025-10-30 14:31:29 +01:00
bandwidth fix
This commit is contained in:
parent
40cd178b1f
commit
c0442c38c7
@ -107,7 +107,6 @@ static band_limit_t allocate_bps(band_limit_t bps, int positive)
|
||||
|
||||
if(turn_params.bps_capacity_allocated >= bps) {
|
||||
turn_params.bps_capacity_allocated -= bps;
|
||||
ret = turn_params.bps_capacity_allocated;
|
||||
} else {
|
||||
turn_params.bps_capacity_allocated = 0;
|
||||
}
|
||||
@ -115,6 +114,7 @@ static band_limit_t allocate_bps(band_limit_t bps, int positive)
|
||||
|
||||
pthread_mutex_unlock(&mutex_bps);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -1179,7 +1179,7 @@ static int handle_turn_allocate(turn_turnserver *server,
|
||||
if(max_bps && (!bps || (bps && (bps>max_bps)))) {
|
||||
bps = max_bps;
|
||||
}
|
||||
if(bps) {
|
||||
if(bps && (ss->bps == 0)) {
|
||||
ss->bps = server->allocate_bps_func(bps,1);
|
||||
if(!(ss->bps)) {
|
||||
*err_code = 486;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user