Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
11cdf9fc
Commit
11cdf9fc
authored
Dec 29, 2003
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scan(): If the status byte has an unexpected value, show it in hex
rather than as a (probably) unprintable character.
parent
f61317ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
src/ZEO/cache.py
src/ZEO/cache.py
+6
-6
No files found.
src/ZEO/cache.py
View file @
11cdf9fc
...
@@ -572,7 +572,7 @@ OBJECT_HEADER_SIZE = 1 + 4 + 16
...
@@ -572,7 +572,7 @@ OBJECT_HEADER_SIZE = 1 + 4 + 16
# disk.
# disk.
class
FileCache
(
object
):
class
FileCache
(
object
):
def
__init__
(
self
,
maxsize
,
fpath
,
parent
,
reuse
=
True
):
def
__init__
(
self
,
maxsize
,
fpath
,
parent
,
reuse
=
True
):
# Maximum total of object sizes we keep in cache.
# Maximum total of object sizes we keep in cache.
self
.
maxsize
=
maxsize
self
.
maxsize
=
maxsize
...
@@ -624,7 +624,7 @@ class FileCache(object):
...
@@ -624,7 +624,7 @@ class FileCache(object):
else
:
else
:
self
.
new
=
False
self
.
new
=
False
self
.
f
=
None
self
.
f
=
None
# Statistics: _n_adds, _n_added_bytes,
# Statistics: _n_adds, _n_added_bytes,
# _n_evicts, _n_evicted_bytes
# _n_evicts, _n_evicted_bytes
self
.
clearStats
()
self
.
clearStats
()
...
@@ -661,7 +661,7 @@ class FileCache(object):
...
@@ -661,7 +661,7 @@ class FileCache(object):
elif
status
in
'1234'
:
elif
status
in
'1234'
:
size
=
int
(
status
)
size
=
int
(
status
)
else
:
else
:
assert
0
,
status
assert
0
,
hex
(
ord
(
status
))
self
.
filemap
[
ofs
]
=
size
,
ent
self
.
filemap
[
ofs
]
=
size
,
ent
if
ent
is
None
and
size
>
max_free_size
:
if
ent
is
None
and
size
>
max_free_size
:
...
@@ -839,7 +839,7 @@ class FileCache(object):
...
@@ -839,7 +839,7 @@ class FileCache(object):
# disk where the object was stored. We need to load the
# disk where the object was stored. We need to load the
# header to update the in-memory data structures held by
# header to update the in-memory data structures held by
# ClientCache.
# ClientCache.
# XXX Or we could just keep the header in memory at all times.
# XXX Or we could just keep the header in memory at all times.
e
=
self
.
key2entry
.
get
(
key
)
e
=
self
.
key2entry
.
get
(
key
)
...
@@ -861,11 +861,11 @@ class FileCache(object):
...
@@ -861,11 +861,11 @@ class FileCache(object):
# This method should be called when the object header is modified.
# This method should be called when the object header is modified.
def
update
(
self
,
obj
):
def
update
(
self
,
obj
):
e
=
self
.
key2entry
[
obj
.
key
]
e
=
self
.
key2entry
[
obj
.
key
]
self
.
f
.
seek
(
e
.
offset
+
OBJECT_HEADER_SIZE
)
self
.
f
.
seek
(
e
.
offset
+
OBJECT_HEADER_SIZE
)
obj
.
serialize_header
(
self
.
f
)
obj
.
serialize_header
(
self
.
f
)
def
settid
(
self
,
tid
):
def
settid
(
self
,
tid
):
if
self
.
tid
is
not
None
:
if
self
.
tid
is
not
None
:
if
tid
<
self
.
tid
:
if
tid
<
self
.
tid
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment