Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opendht
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
opendht
Commits
a1d67b88
Commit
a1d67b88
authored
7 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
python: fix invalid pointer access
parent
c40750f6
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/opendht.pyx
+12
-5
12 additions, 5 deletions
python/opendht.pyx
with
12 additions
and
5 deletions
python/opendht.pyx
+
12
−
5
View file @
a1d67b88
...
@@ -179,8 +179,11 @@ cdef class Query(object):
...
@@ -179,8 +179,11 @@ cdef class Query(object):
cdef
class
Select
(
object
):
cdef
class
Select
(
object
):
cdef
cpp
.
Select
_select
cdef
cpp
.
Select
_select
def
__cinit__
(
self
,
str
q_str
=
''
):
def
__cinit__
(
self
,
str
q_str
=
None
):
if
q_str
:
self
.
_select
=
cpp
.
Select
(
q_str
.
encode
())
self
.
_select
=
cpp
.
Select
(
q_str
.
encode
())
else
:
self
.
_select
=
cpp
.
Select
()
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
_select
.
toString
().
decode
()
return
self
.
_select
.
toString
().
decode
()
def
isSatisfiedBy
(
self
,
Select
os
):
def
isSatisfiedBy
(
self
,
Select
os
):
...
@@ -191,8 +194,11 @@ cdef class Select(object):
...
@@ -191,8 +194,11 @@ cdef class Select(object):
cdef
class
Where
(
object
):
cdef
class
Where
(
object
):
cdef
cpp
.
Where
_where
cdef
cpp
.
Where
_where
def
__cinit__
(
self
,
str
q_str
=
''
):
def
__cinit__
(
self
,
str
q_str
=
None
):
if
q_str
:
self
.
_where
=
cpp
.
Where
(
q_str
.
encode
())
self
.
_where
=
cpp
.
Where
(
q_str
.
encode
())
else
:
self
.
_where
=
cpp
.
Where
()
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
_where
.
toString
().
decode
()
return
self
.
_where
.
toString
().
decode
()
def
isSatisfiedBy
(
self
,
Where
where
):
def
isSatisfiedBy
(
self
,
Where
where
):
...
@@ -527,6 +533,8 @@ cdef class DhtRunner(_WithID):
...
@@ -527,6 +533,8 @@ cdef class DhtRunner(_WithID):
if
get_cb
:
if
get_cb
:
cb_obj
=
{
'
get
'
:
get_cb
,
'
done
'
:
done_cb
,
'
filter
'
:
filter
}
cb_obj
=
{
'
get
'
:
get_cb
,
'
done
'
:
done_cb
,
'
filter
'
:
filter
}
ref
.
Py_INCREF
(
cb_obj
)
ref
.
Py_INCREF
(
cb_obj
)
if
where
is
None
:
where
=
Where
()
self
.
thisptr
.
get
().
get
(
key
.
_infohash
,
cpp
.
bindGetCb
(
get_callback
,
<
void
*>
cb_obj
),
self
.
thisptr
.
get
().
get
(
key
.
_infohash
,
cpp
.
bindGetCb
(
get_callback
,
<
void
*>
cb_obj
),
cpp
.
bindDoneCb
(
done_callback
,
<
void
*>
cb_obj
),
cpp
.
bindDoneCb
(
done_callback
,
<
void
*>
cb_obj
),
cpp
.
nullptr
,
#filter implemented in the get_callback
cpp
.
nullptr
,
#filter implemented in the get_callback
...
@@ -654,4 +662,3 @@ cdef class Pht(object):
...
@@ -654,4 +662,3 @@ cdef class Pht(object):
val
,
val
,
cpp
.
bindDoneCbSimple
(
done_callback_simple
,
<
void
*>
cb_obj
)
cpp
.
bindDoneCbSimple
(
done_callback_simple
,
<
void
*>
cb_obj
)
)
)
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