whitespace
This commit is contained in:
parent
9d539aaa16
commit
e9b9118c2a
5 changed files with 17 additions and 15 deletions
lbrynet
blob
core
cryptstream
lbry_file/client
|
@ -12,6 +12,7 @@ log = logging.getLogger(__name__)
|
||||||
|
|
||||||
MAX_BLOB_SIZE = 2 * 2 ** 20
|
MAX_BLOB_SIZE = 2 * 2 ** 20
|
||||||
|
|
||||||
|
|
||||||
class BlobFile(object):
|
class BlobFile(object):
|
||||||
"""
|
"""
|
||||||
A chunk of data available on the network which is specified by a hashsum
|
A chunk of data available on the network which is specified by a hashsum
|
||||||
|
|
|
@ -16,3 +16,4 @@ class BlobInfo(object):
|
||||||
self.blob_hash = blob_hash
|
self.blob_hash = blob_hash
|
||||||
self.blob_num = blob_num
|
self.blob_num = blob_num
|
||||||
self.length = length
|
self.length = length
|
||||||
|
|
||||||
|
|
|
@ -233,11 +233,13 @@ class Session(object):
|
||||||
# best not to rely on this external ip, the router can be behind layers of NATs
|
# best not to rely on this external ip, the router can be behind layers of NATs
|
||||||
self.external_ip = external_ip
|
self.external_ip = external_ip
|
||||||
if self.peer_port:
|
if self.peer_port:
|
||||||
self.upnp_redirects.append(get_port_mapping(u, self.peer_port, 'TCP',
|
self.upnp_redirects.append(
|
||||||
'LBRY peer port'))
|
get_port_mapping(u, self.peer_port, 'TCP', 'LBRY peer port')
|
||||||
|
)
|
||||||
if self.dht_node_port:
|
if self.dht_node_port:
|
||||||
self.upnp_redirects.append(get_port_mapping(u, self.dht_node_port, 'UDP',
|
self.upnp_redirects.append(
|
||||||
'LBRY DHT port'))
|
get_port_mapping(u, self.dht_node_port, 'UDP', 'LBRY DHT port')
|
||||||
|
)
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -320,14 +322,13 @@ class Session(object):
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.blob_tracker is None:
|
if self.blob_tracker is None:
|
||||||
self.blob_tracker = self.blob_tracker_class(self.blob_manager,
|
self.blob_tracker = self.blob_tracker_class(
|
||||||
self.peer_finder,
|
self.blob_manager, self.peer_finder, self.dht_node
|
||||||
self.dht_node)
|
)
|
||||||
if self.payment_rate_manager is None:
|
if self.payment_rate_manager is None:
|
||||||
self.payment_rate_manager = self.payment_rate_manager_class(
|
self.payment_rate_manager = self.payment_rate_manager_class(
|
||||||
self.base_payment_rate_manager,
|
self.base_payment_rate_manager, self.blob_tracker, self.is_generous
|
||||||
self.blob_tracker,
|
)
|
||||||
self.is_generous)
|
|
||||||
|
|
||||||
self.rate_limiter.start()
|
self.rate_limiter.start()
|
||||||
d = self.storage.setup()
|
d = self.storage.setup()
|
||||||
|
|
|
@ -128,7 +128,6 @@ class CryptStreamCreator(object):
|
||||||
d.addCallback(self._blob_finished)
|
d.addCallback(self._blob_finished)
|
||||||
self.finished_deferreds.append(d)
|
self.finished_deferreds.append(d)
|
||||||
|
|
||||||
|
|
||||||
def _write(self, data):
|
def _write(self, data):
|
||||||
while len(data) > 0:
|
while len(data) > 0:
|
||||||
if self.current_blob is None:
|
if self.current_blob is None:
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
from lbrynet.lbry_file.StreamDescriptor import EncryptedFileStreamType
|
from lbrynet.core.StreamDescriptor import EncryptedFileStreamType
|
||||||
from lbrynet.lbry_file.StreamDescriptor import EncryptedFileStreamDescriptorValidator
|
from lbrynet.core.StreamDescriptor import EncryptedFileStreamDescriptorValidator
|
||||||
from lbrynet.core.DownloadOption import DownloadOption, DownloadOptionChoice
|
from lbrynet.core.DownloadOption import DownloadOption, DownloadOptionChoice
|
||||||
|
|
||||||
|
|
||||||
def add_lbry_file_to_sd_identifier(sd_identifier):
|
def add_lbry_file_to_sd_identifier(sd_identifier):
|
||||||
sd_identifier.add_stream_type(
|
sd_identifier.add_stream_type(EncryptedFileStreamType, EncryptedFileStreamDescriptorValidator,
|
||||||
EncryptedFileStreamType, EncryptedFileStreamDescriptorValidator, EncryptedFileOptions())
|
EncryptedFileOptions())
|
||||||
|
|
||||||
|
|
||||||
class EncryptedFileOptions(object):
|
class EncryptedFileOptions(object):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue