@ -506,9 +506,12 @@ class testHTTPServer_RequestHandler(BaseHTTPRequestHandler):
self . send_response ( 403 )
# Send headers
self . end_headers ( )
except BrokenPipeError as e :
lL = gSettingsDict [ " Logger " ]
if lL : lL . warning ( f " Сервер (do_GET): Возникла ошибка сети - BrokenPipeError: [Errno 32] Broken pipe. Сервер продолжает работу " )
except Exception as e :
lL = gSettingsDict [ " Logger " ]
if lL : lL . exception ( f " Server.do_GET: Global error handler - look traceback below. " )
if lL : lL . exception ( f " Сервер (do_GET): Неопознанная ошибка сети - см. текст ошибки. Сервер продолжает работу " )
# POST
def do_POST ( self ) :
try :
@ -608,20 +611,34 @@ class testHTTPServer_RequestHandler(BaseHTTPRequestHandler):
# Send headers
self . end_headers ( )
return
except BrokenPipeError as e :
lL = gSettingsDict [ " Logger " ]
if lL : lL . warning ( f " Сервер (do_POST): Возникла ошибка сети - BrokenPipeError: [Errno 32] Broken pipe. Сервер продолжает работу " )
except Exception as e :
lL = gSettingsDict [ " Logger " ]
if lL : lL . exception ( f " Server.do_POST: Global error handler - look traceback below. " )
if lL : lL . exception ( f " Сервер (do_POST): Неопознанная ошибка сети - см. текст ошибки. Сервер продолжает работу " )
#Logging
#!Turn it on to stop print in console
#def log_message(self, format, *args):
# return
class ThreadedHTTPServer ( ThreadingMixIn , HTTPServer ) :
daemon_threads = True
""" Handle requests in a separate thread. """
def finish_request ( self , request , client_address ) :
request . settimeout ( gSettingsDict [ " ServerDict " ] [ " RequestTimeoutSecFloat " ] )
# "super" can not be used because BaseServer is not created from object
HTTPServer . finish_request ( self , request , client_address )
try :
request . settimeout ( gSettingsDict [ " ServerDict " ] [ " RequestTimeoutSecFloat " ] )
# "super" can not be used because BaseServer is not created from object
HTTPServer . finish_request ( self , request , client_address )
except ConnectionResetError as e :
lL = gSettingsDict [ " Logger " ]
if lL : lL . warning ( f " Сервер (finish_request): Возникла ошибка сети - ConnectionResetError: [Errno 104] Connection reset by peer. Сервер продолжает работу " )
except Exception as e :
lL = gSettingsDict [ " Logger " ]
if lL : lL . exception ( f " Сервер (finish_request): Неопознанная ошибка сети - см. текст ошибки. Сервер продолжает работу " )
#inGlobalDict
# "JSONConfigurationDict":<JSON>
import ssl