mirror of
https://github.com/markqvist/NomadNet.git
synced 2025-05-10 10:04:56 -04:00
Implemented basic node hosting and page serving.
This commit is contained in:
parent
55e8479979
commit
862f4835c7
7 changed files with 243 additions and 24 deletions
|
@ -5,7 +5,7 @@ import time
|
|||
import RNS.vendor.umsgpack as msgpack
|
||||
|
||||
class Directory:
|
||||
ANNOUNCE_STREAM_MAXLENGTH = 256
|
||||
ANNOUNCE_STREAM_MAXLENGTH = 64
|
||||
|
||||
def __init__(self, app):
|
||||
self.directory_entries = {}
|
||||
|
@ -54,7 +54,13 @@ class Directory:
|
|||
except Exception as e:
|
||||
RNS.log("Could not load directory from disk. The contained exception was: "+str(e), RNS.LOG_ERROR)
|
||||
|
||||
def announce_received(self, source_hash, app_data):
|
||||
def lxmf_announce_received(self, source_hash, app_data):
|
||||
timestamp = time.time()
|
||||
self.announce_stream.insert(0, (timestamp, source_hash, app_data))
|
||||
while len(self.announce_stream) > Directory.ANNOUNCE_STREAM_MAXLENGTH:
|
||||
self.announce_stream.pop()
|
||||
|
||||
def node_announce_received(self, source_hash, app_data):
|
||||
timestamp = time.time()
|
||||
self.announce_stream.insert(0, (timestamp, source_hash, app_data))
|
||||
while len(self.announce_stream) > Directory.ANNOUNCE_STREAM_MAXLENGTH:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue