Implemented requests and responses of arbitrary sizes using resources.

This commit is contained in:
Mark Qvist 2021-08-21 14:52:31 +02:00
parent 1dc6655017
commit 212518a345
6 changed files with 206 additions and 89 deletions

View file

@ -502,7 +502,6 @@ def download_concluded(resource):
saved_filename = current_filename
if resource.status == RNS.Resource.COMPLETE:
counter = 0
while os.path.isfile(saved_filename):

View file

@ -23,7 +23,7 @@ APP_NAME = "example_utilities"
# A reference to the latest client link that connected
latest_client_link = None
def random_text_generator(path, data, request_id, remote_identity_hash, requested_at):
def random_text_generator(path, data, request_id, remote_identity, requested_at):
RNS.log("Generating response to request "+RNS.prettyhexrep(request_id))
texts = ["They looked up", "On each full moon", "Becky was upset", "Ill stay away from it", "The pet shop stocks everything"]
return texts[random.randint(0, len(texts)-1)]