1
0
mirror of https://github.com/coturn/coturn.git synced 2025-10-30 14:31:29 +01:00

bandwidth fix

This commit is contained in:
mom040267 2014-10-11 09:15:02 +00:00
parent 40cd178b1f
commit c0442c38c7
2 changed files with 2 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;