diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 9fe437b9..7ff7ad6a 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -642,7 +642,11 @@ class HttpCli(object): href = "/" + vpath + "/" + fn fspath = fsroot + "/" + fn - inf = os.stat(fsenc(fspath)) + try: + inf = os.stat(fsenc(fspath)) + except FileNotFoundError as ex: + self.log("broken symlink: {}".format(fspath)) + continue is_dir = stat.S_ISDIR(inf.st_mode) if is_dir: diff --git a/copyparty/util.py b/copyparty/util.py index 6367d780..e6b82de2 100644 --- a/copyparty/util.py +++ b/copyparty/util.py @@ -183,7 +183,7 @@ class MultipartParser(object): buf = self.sr.recv(bufsz) if not buf: # abort: client disconnected - raise Pebkac(400, "client disconnected during post") + raise Pebkac(400, "client disconnected during multipart post") while True: ofs = buf.find(self.boundary) @@ -217,7 +217,7 @@ class MultipartParser(object): buf2 = self.sr.recv(bufsz) if not buf2: # abort: client disconnected - raise Pebkac(400, "client disconnected during post") + raise Pebkac(400, "client disconnected during multipart post") buf += buf2 @@ -397,6 +397,9 @@ def read_socket(sr, total_size): bufsz = remains buf = sr.recv(bufsz) + if not buf: + raise Pebkac(400, "client disconnected during binary post") + remains -= len(buf) yield buf diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index 215d2826..efd75007 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -1,3 +1,6 @@ +* { + line-height: 1.2em; +} html,body,tr,th,td,#files,a { color: inherit; background: none; @@ -11,7 +14,6 @@ html { background: #333; font-family: sans-serif; text-shadow: 1px 1px 0px #000; - line-height: 1.3em; } html, body { margin: 0; @@ -23,7 +25,6 @@ body { #path, #path * { font-size: 1em; - line-height: 1em; } #path { color: #aca; @@ -168,7 +169,6 @@ a.play.act { text-align: center; background: #444; border-radius: 2em; - line-height: 1em; } #widget { position: fixed; @@ -246,7 +246,6 @@ a.play.act { font-size: 1.25em; width: 1.3em; height: 1.2em; - line-height: 1em; text-align: center; margin-right: .5em; border-radius: .3em;