diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 9abd8a33..9594ed15 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -267,6 +267,7 @@ class HttpCli(object): self.log(response) self.reply(response.encode("utf-8"), headers=["Content-Type: application/json"]) + return True def handle_post_binary(self): try: @@ -306,7 +307,7 @@ class HttpCli(object): ), ) - if len(cstart) > 1: + if len(cstart) > 1 and path != os.devnull: self.log( "clone {} to {}".format( cstart[0], " & ".join(str(x) for x in cstart[1:]) diff --git a/copyparty/httpsrv.py b/copyparty/httpsrv.py index 1cab3ede..caf548f6 100644 --- a/copyparty/httpsrv.py +++ b/copyparty/httpsrv.py @@ -3,6 +3,7 @@ from __future__ import print_function, unicode_literals import os import time +import socket import threading from .__init__ import E @@ -68,6 +69,7 @@ class HttpSrv(object): finally: self.log(str(addr), "-" * 7 + "C-done") + sck.shutdown(socket.SHUT_RDWR) sck.close() with self.mutex: del self.clients[cli] diff --git a/copyparty/web/splash.html b/copyparty/web/splash.html index b03929b6..1c3d60f1 100644 --- a/copyparty/web/splash.html +++ b/copyparty/web/splash.html @@ -16,14 +16,14 @@

you can browse these:

you can upload to:

diff --git a/docs/notes.sh b/docs/notes.sh index ce7e94be..627dfaa7 100644 --- a/docs/notes.sh +++ b/docs/notes.sh @@ -57,4 +57,7 @@ htop -d 2 -p $(ps ax | awk '/electron[ ]/ {printf "%s%s", v, $1;v=","}') renice 20 -p $$ # cleanup after a busted shutdown -ps ax | awk '/python[23]? -m copyparty/ {print $1}' | tee /dev/stderr | xargs kill +ps ax | awk '/python[23]? -m copyparty|python[ ]-c from multiproc/ {print $1}' | tee /dev/stderr | xargs kill + +# last line of each function in a file +cat copyparty/httpcli.py | awk '/^[^a-zA-Z0-9]+def / {printf "%s\n%s\n\n", f, pl; f=$2} /[a-zA-Z0-9]/ {pl=$0}'