diff --git a/copyparty/fsutil.py b/copyparty/fsutil.py index 3cb91dc4..88b33ef8 100644 --- a/copyparty/fsutil.py +++ b/copyparty/fsutil.py @@ -6,11 +6,13 @@ import time import re from .__init__ import ANYWIN, MACOS -from .util import RootLogger, min_ex, chkcmd +from .util import min_ex, chkcmd from .authsrv import VFS, AXS try: from typing import Optional, Union + + from .util import RootLogger except: pass diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index b6df6773..079974fc 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -235,7 +235,9 @@ class HttpCli(object): self.is_ancient = self.ua.startswith("Mozilla/4.") zs = self.headers.get("connection", "").lower() - self.keepalive = not zs.startswith("close") and self.http_ver != "HTTP/1.0" + self.keepalive = not zs.startswith("close") and ( + self.http_ver != "HTTP/1.0" or zs == "keep-alive" + ) self.is_https = ( self.headers.get("x-forwarded-proto", "").lower() == "https" or self.tls ) diff --git a/copyparty/httpconn.py b/copyparty/httpconn.py index 067e2d31..06bbb539 100644 --- a/copyparty/httpconn.py +++ b/copyparty/httpconn.py @@ -97,6 +97,8 @@ class HttpConn(object): self.log_func(self.log_src, msg, c) def get_u2idx(self) -> U2idx: + # one u2idx per tcp connection; + # sqlite3 fully parallelizes under python threads if not self.u2idx: self.u2idx = U2idx(self) diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index 2af59a52..2b520bf5 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -1545,7 +1545,7 @@ html.y #tree.nowrap .ntree a+a:hover { padding: 0 1.2em 0 0; font-size: 4em; opacity: 0; - animation: 1s linear .05s infinite forwards spin, .2s ease .05s 1 forwards fadein; + animation: 1s linear .15s infinite forwards spin, .2s ease .15s 1 forwards fadein; position: absolute; z-index: 9; } diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index eb79f33a..55a9ec93 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -3827,6 +3827,7 @@ function tree_neigh(n) { treectl.dir_cb = tree_scrollto; links[act].click(); + links[act].focus(); } @@ -4638,7 +4639,7 @@ var treectl = (function () { } function reload_tree() { - var cdir = get_vpath(), + var cdir = r.nextdir || get_vpath(), links = QSA('#treeul a+a'), nowrap = QS('#tree.nowrap') && QS('#hovertree.on'), act = null; @@ -4744,6 +4745,7 @@ var treectl = (function () { if (hpush && !no_tree) get_tree('.', xhr.top); + r.nextdir = xhr.top; enspin(thegrid.en ? '#gfiles' : '#files'); } @@ -4766,6 +4768,7 @@ var treectl = (function () { if (!xhrchk(this, L.fl_xe1, L.fl_xe2)) return; + r.nextdir = null; var cur = ebi('files').getAttribute('ts'); if (cur && parseInt(cur) > this.ts) { console.log("reject ls"); diff --git a/scripts/sfx.ls b/scripts/sfx.ls index df68a664..d08d1843 100644 --- a/scripts/sfx.ls +++ b/scripts/sfx.ls @@ -11,6 +11,7 @@ copyparty/broker_mp.py, copyparty/broker_mpw.py, copyparty/broker_thr.py, copyparty/broker_util.py, +copyparty/fsutil.py, copyparty/ftpd.py, copyparty/httpcli.py, copyparty/httpconn.py,