diff --git a/docs/manual/examples.html b/docs/manual/examples.html index 6ebac6f..c50995c 100644 --- a/docs/manual/examples.html +++ b/docs/manual/examples.html @@ -1390,7 +1390,8 @@ the link has been established.
# A reference to the latest client link that connected latest_client_link = None -def random_text_generator(path, data, 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", "I’ll stay away from it", "The pet shop stocks everything"] return texts[random.randint(0, len(texts)-1)] @@ -2160,7 +2161,6 @@ interface to efficiently pass files of any size over a Reticulum saved_filename = current_filename - if resource.status == RNS.Resource.COMPLETE: counter = 0 while os.path.isfile(saved_filename): diff --git a/docs/manual/reference.html b/docs/manual/reference.html index f6f98ab..45d837c 100644 --- a/docs/manual/reference.html +++ b/docs/manual/reference.html @@ -516,7 +516,7 @@ proofs should be returned for received packets.path – The path for the request handler to be registered.
response_generator – A function or method with the signature response_generator(path, data, remote_identity_hash, requested_at) to be called. Whatever this funcion returns will be sent as a response to the requester. If the function returns None
, no response will be sent.
response_generator – A function or method with the signature response_generator(path, data, request_id, remote_identity, requested_at) to be called. Whatever this funcion returns will be sent as a response to the requester. If the function returns None
, no response will be sent.
allow – One of RNS.Destination.ALLOW_NONE
, RNS.Destination.ALLOW_ALL
or RNS.Destination.ALLOW_LIST
. If RNS.Destination.ALLOW_LIST
is set, the request handler will only respond to requests for identified peers in the supplied list.
allowed_list – A list of bytes-like RNS.Identity hashes.
The Resource class allows transferring arbitrary amounts of data over a link. It will automatically handle sequencing, compression, coordination and checksumming.
@@ -990,6 +990,8 @@ compression, coordination and checksumming.progress_callback – A callable with the signature callback(resource). Will be called whenever the resource transfer progress is updated.
segment_index – Internal use, ignore.
original_hash – Internal use, ignore.
is_request – Internal use, ignore.
is_response – Internal use, ignore.