Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
ZKAPAuthorizer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Administrator
ZKAPAuthorizer
Commits
eed390db
Unverified
Commit
eed390db
authored
5 years ago
by
Jean-Paul Calderone
Browse files
Options
Downloads
Patches
Plain Diff
Probably need to open the file in binary mode
parent
69c9668b
Branches
Branches containing commit
No related tags found
1 merge request
!100
Windows CI
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/_zkapauthorizer/_storage_server.py
+3
-3
3 additions, 3 deletions
src/_zkapauthorizer/_storage_server.py
with
3 additions
and
3 deletions
src/_zkapauthorizer/_storage_server.py
+
3
−
3
View file @
eed390db
...
...
@@ -512,7 +512,7 @@ def get_storage_index_share_size(sharepath):
# share data is structured. A lot of this seems to be wrong.
# storage/immutable.py appears to have the correct information.
fmt
=
"
>LL
"
with
open
(
sharepath
)
as
share_file
:
with
open
(
sharepath
,
"
rb
"
)
as
share_file
:
header
=
share_file
.
read
(
calcsize
(
fmt
))
if
len
(
header
)
!=
calcsize
(
fmt
):
...
...
@@ -570,7 +570,7 @@ def get_slot_share_size(sharepath):
:return int: The data size of the share in bytes.
"""
with
open
(
sharepath
)
as
share_file
:
with
open
(
sharepath
,
"
rb
"
)
as
share_file
:
share_data_length_bytes
=
share_file
.
read
(
92
)[
-
8
:]
(
share_data_length
,)
=
unpack
(
'
>Q
'
,
share_data_length_bytes
)
return
share_data_length
...
...
@@ -598,7 +598,7 @@ def get_stat(sharepath):
This is necessary to differentiate between buckets and slots.
"""
# Figure out if it is a storage index or a slot.
with
open
(
sharepath
)
as
share_file
:
with
open
(
sharepath
,
"
rb
"
)
as
share_file
:
magic
=
share_file
.
read
(
32
)
if
magic
==
"
Tahoe mutable container v1
\n
"
+
"
\x75\x09\x44\x03\x8e
"
:
return
stat_slot
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment