Merge pull request #1161 from jzelinskie/torrenthmac

misc torrent changes
This commit is contained in:
Jimmy Zelinskie 2016-01-22 23:02:44 -05:00
commit 85ae1a2a0a
7 changed files with 14 additions and 14 deletions

View file

@ -238,7 +238,7 @@ def _upload_chunk(namespace, repo_name, upload_uuid):
initial_sha1_value = found.piece_sha_state or resumablehashlib.sha1()
initial_sha1_pieces_value = found.piece_hashes or ''
piece_hasher = PieceHasher(app.config['TORRENT_PIECE_SIZE'], start_offset,
piece_hasher = PieceHasher(app.config['BITTORRENT_PIECE_SIZE'], start_offset,
initial_sha1_pieces_value,
initial_sha1_value)
@ -311,7 +311,7 @@ def _finish_upload(namespace, repo_name, upload_obj, expected_digest):
if upload_obj.piece_sha_state is not None and not already_exists:
piece_bytes = upload_obj.piece_hashes + upload_obj.piece_sha_state.digest()
model.storage.save_torrent_info(blob_storage, app.config['TORRENT_PIECE_SIZE'], piece_bytes)
model.storage.save_torrent_info(blob_storage, app.config['BITTORRENT_PIECE_SIZE'], piece_bytes)
# Delete the upload tracking row.
upload_obj.delete_instance()