Skip to content
This repository has been archived by the owner on Jan 13, 2020. It is now read-only.

Commit

Permalink
backported max_clients
Browse files Browse the repository at this point in the history
  • Loading branch information
ha7ilm committed May 21, 2015
1 parent 7ecab27 commit 06054b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions config_webrx.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#Server settings
web_port=8073
server_hostname="localhost" # If this contains an incorrect value, the web UI may freeze on load (it can't open websocket)
max_clients=20

#Web GUI configuration
receiver_name="[Callsign]"
Expand Down
10 changes: 9 additions & 1 deletion openwebrx.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def cleanup_clients():
for i in range(0,len(clients)):
i-=correction
#print "cleanup_clients:: len(clients)=", len(clients), "i=", i
if (not clients[i].ws_started) and (time.time()-clients[i].gen_time)>180:
if (not clients[i].ws_started) and (time.time()-clients[i].gen_time)>45:
print "[openwebrx] cleanup_clients :: client timeout to open WebSocket"
close_client(i, False)
correction+=1
Expand Down Expand Up @@ -385,6 +385,14 @@ def do_GET(self):
self.end_headers()
self.wfile.write("<html><body><h1>Object moved</h1>Please <a href=\"/upgrade.html\">click here</a> to continue.</body></html>")
return
if extension == "wrx": cleanup_clients()
if extension == "wrx" and cfg.max_clients<=len(clients):
self.send_response(302) #backported max_clients fix
self.send_header('Content-type','text/html')
self.send_header("Location", "http://{0}:{1}/retry.html".format(cfg.server_hostname,cfg.web_port))
self.end_headers()
self.wfile.write("<html><body><h1>Object moved</h1>Please <a href=\"/retry.html\">click here</a> to continue.</body></html>")
return
self.send_response(200)
if(("wrx","html","htm").count(extension)):
self.send_header('Content-type','text/html')
Expand Down

0 comments on commit 06054b1

Please sign in to comment.