master
Bob Mottram 2019-07-22 16:14:39 +01:00
parent 4d7341fb82
commit e94d55a768
1 changed files with 5 additions and 3 deletions

View File

@ -379,6 +379,10 @@ class PubServer(BaseHTTPRequestHandler):
avBinary = avFile.read() avBinary = avFile.read()
self.wfile.write(avBinary) self.wfile.write(avBinary)
return return
# This busy state helps to avoid flooding
# Resources which are expected to be called from a web page
# should be above this
if self.server.GETbusy: if self.server.GETbusy:
currTimeGET=int(time.time()) currTimeGET=int(time.time())
if currTimeGET-self.server.lastGET<10: if currTimeGET-self.server.lastGET<10:
@ -390,8 +394,6 @@ class PubServer(BaseHTTPRequestHandler):
self.server.lastGET=currTimeGET self.server.lastGET=currTimeGET
self.server.GETbusy=True self.server.GETbusy=True
#print('Accept: '+self.headers['Accept'])
if not self._permittedDir(self.path): if not self._permittedDir(self.path):
if self.server.debug: if self.server.debug:
print('DEBUG: GET Not permitted') print('DEBUG: GET Not permitted')