Skip to content

Commit

Permalink
CDNDepotFile: fix incorrect chunk location code
Browse files Browse the repository at this point in the history
  • Loading branch information
rossengeorgiev committed Apr 26, 2020
1 parent 3a118a3 commit 6e0871c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions steam/client/cdn.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,12 @@ def read(self, length=-1):
for chunk in self.chunks:
if chunk.offset >= end_offset:
break
elif (self.offset <= chunk.offset < end_offset
or self.offset < (chunk.offset + chunk.cb_original) <= end_offset):

chunk_start = chunk.offset
chunk_end = chunk_start + chunk.cb_original

if ( chunk_start <= self.offset < chunk_end
or chunk_start < end_offset <= chunk_end):
if start_offset is None:
start_offset = chunk.offset
data.write(self._get_chunk(chunk))
Expand Down Expand Up @@ -677,7 +681,7 @@ def get_manifests(self, app_id, branch='public', password=None, filter_func=None

is_enc_branch = False

if branch not in depots['branches']:
if branch not in depots.get('branches', {}):
raise SteamError("No branch named %s for app_id %s" % (repr(branch), app_id))
elif int(depots['branches'][branch].get('pwdrequired', 0)) > 0:
is_enc_branch = True
Expand Down

0 comments on commit 6e0871c

Please sign in to comment.