mirror of
https://github.com/markqvist/Reticulum.git
synced 2024-10-01 03:15:44 -04:00
Added link getter to resource advertisement class
This commit is contained in:
parent
5a0316ae7f
commit
9cb181690e
@ -1023,6 +1023,7 @@ class ResourceAdvertisement:
|
|||||||
|
|
||||||
|
|
||||||
def __init__(self, resource=None, request_id=None, is_response=False):
|
def __init__(self, resource=None, request_id=None, is_response=False):
|
||||||
|
self.link = None
|
||||||
if resource != None:
|
if resource != None:
|
||||||
self.t = resource.size # Transfer size
|
self.t = resource.size # Transfer size
|
||||||
self.d = resource.total_size # Total uncompressed data size
|
self.d = resource.total_size # Total uncompressed data size
|
||||||
@ -1069,6 +1070,9 @@ class ResourceAdvertisement:
|
|||||||
def is_compressed(self):
|
def is_compressed(self):
|
||||||
return self.c
|
return self.c
|
||||||
|
|
||||||
|
def get_link(self):
|
||||||
|
return self.link
|
||||||
|
|
||||||
def pack(self, segment=0):
|
def pack(self, segment=0):
|
||||||
hashmap_start = segment*ResourceAdvertisement.HASHMAP_MAX_LEN
|
hashmap_start = segment*ResourceAdvertisement.HASHMAP_MAX_LEN
|
||||||
hashmap_end = min((segment+1)*(ResourceAdvertisement.HASHMAP_MAX_LEN), self.n)
|
hashmap_end = min((segment+1)*(ResourceAdvertisement.HASHMAP_MAX_LEN), self.n)
|
||||||
|
Loading…
Reference in New Issue
Block a user