[chunkqueue] skip setting limit if it is the current one

personal/stbuehler/wip
Stefan Bühler 11 years ago
parent eaf460e3d0
commit 89a32e1504
  1. 8
      src/main/chunk.c

@ -464,13 +464,15 @@ void li_chunkqueue_use_limit(liChunkQueue *cq, liVRequest *vr) {
}
void li_chunkqueue_set_limit(liChunkQueue *cq, liCQLimit* cql) {
gboolean upd_limit = (cql != cq->limit);
goffset memusage = cq->mem_usage;
if (cql == cq->limit) return;
if (cql) li_cqlimit_acquire(cql);
if (upd_limit) cqlimit_update(cq, -memusage);
cqlimit_update(cq, -memusage);
li_cqlimit_release(cq->limit);
cq->limit = cql;
if (upd_limit) cqlimit_update(cq, memusage);
cqlimit_update(cq, memusage);
}
/* return -1 for unlimited, 0 for full and n > 0 for n bytes free */

Loading…
Cancel
Save