mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 17:12:13 -06:00
up2k: limit runahead in client
This commit is contained in:
parent
3b1839c2ce
commit
69b83dfdc4
|
@ -293,7 +293,8 @@ class Up2k(object):
|
||||||
job = job or reg[wark]
|
job = job or reg[wark]
|
||||||
if job["prel"] == cj["prel"] and job["name"] == cj["name"]:
|
if job["prel"] == cj["prel"] and job["name"] == cj["name"]:
|
||||||
# ensure the files haven't been deleted manually
|
# ensure the files haven't been deleted manually
|
||||||
for fn in job["name"], job["tnam"]:
|
names = [job[x] for x in ["name", "tnam"] if x in job]
|
||||||
|
for fn in names:
|
||||||
path = os.path.join(job["ptop"], job["prel"], fn)
|
path = os.path.join(job["ptop"], job["prel"], fn)
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
job = None
|
job = None
|
||||||
|
|
|
@ -349,16 +349,17 @@ function up2k_init(have_crypto) {
|
||||||
//
|
//
|
||||||
|
|
||||||
function handshakes_permitted() {
|
function handshakes_permitted() {
|
||||||
return multitask || (
|
var lim = multitask ? 1 : 0;
|
||||||
st.todo.upload.length == 0 &&
|
return lim >=
|
||||||
st.busy.upload.length == 0);
|
st.todo.upload.length +
|
||||||
|
st.busy.upload.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
function hashing_permitted() {
|
function hashing_permitted() {
|
||||||
return multitask || (
|
var lim = multitask ? 1 : 0;
|
||||||
handshakes_permitted() &&
|
return handshakes_permitted() && lim >=
|
||||||
st.todo.handshake.length == 0 &&
|
st.todo.handshake.length +
|
||||||
st.busy.handshake.length == 0);
|
st.busy.handshake.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
var tasker = (function () {
|
var tasker = (function () {
|
||||||
|
|
Loading…
Reference in a new issue