mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-12 21:26:10 +00:00
Fix Kodi hangup on exit
This commit is contained in:
parent
0e30a28dcb
commit
c9d51690df
1 changed files with 11 additions and 4 deletions
|
@ -21,8 +21,6 @@ class WebService(threading.Thread):
|
||||||
|
|
||||||
''' Run a webservice to trigger playback.
|
''' Run a webservice to trigger playback.
|
||||||
'''
|
'''
|
||||||
stop_thread = False
|
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
threading.Thread.__init__(self)
|
threading.Thread.__init__(self)
|
||||||
|
|
||||||
|
@ -34,7 +32,6 @@ class WebService(threading.Thread):
|
||||||
conn = httplib.HTTPConnection("127.0.0.1:%d" % PORT)
|
conn = httplib.HTTPConnection("127.0.0.1:%d" % PORT)
|
||||||
conn.request("QUIT", "/")
|
conn.request("QUIT", "/")
|
||||||
conn.getresponse()
|
conn.getresponse()
|
||||||
self.stop_thread = True
|
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -71,7 +68,9 @@ class HttpServer(BaseHTTPServer.HTTPServer):
|
||||||
|
|
||||||
class requestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
|
class requestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
|
||||||
|
|
||||||
#Handler for the GET requests
|
''' Http request handler. Do not use LOG here,
|
||||||
|
it will hang requests in Kodi > show information dialog.
|
||||||
|
'''
|
||||||
|
|
||||||
def log_message(self, format, *args):
|
def log_message(self, format, *args):
|
||||||
|
|
||||||
|
@ -79,6 +78,14 @@ class requestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
|
||||||
'''
|
'''
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def do_QUIT(self):
|
||||||
|
|
||||||
|
''' send 200 OK response, and set server.stop to True
|
||||||
|
'''
|
||||||
|
self.send_response(200)
|
||||||
|
self.end_headers()
|
||||||
|
self.server.stop = True
|
||||||
|
|
||||||
def get_params(self):
|
def get_params(self):
|
||||||
|
|
||||||
''' Get the params
|
''' Get the params
|
||||||
|
|
Loading…
Reference in a new issue