Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
35d89551
Commit
35d89551
authored
8 years ago
by
Craig Tiller
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #46 from soltanmm-google/heatbeat's-aerys-is-an-awesome-dance-tune-y'all
Fix Python errors
parents
7bb90fa5
a4724511
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/python/grpcio/grpc/_cython/_cygrpc/records.pxd.pxi
+2
-2
2 additions, 2 deletions
src/python/grpcio/grpc/_cython/_cygrpc/records.pxd.pxi
src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi
+11
-5
11 additions, 5 deletions
src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi
with
13 additions
and
7 deletions
src/python/grpcio/grpc/_cython/_cygrpc/records.pxd.pxi
+
2
−
2
View file @
35d89551
...
@@ -117,8 +117,8 @@ cdef class Metadata:
...
@@ -117,8 +117,8 @@ cdef class Metadata:
cdef
grpc_metadata_array
c_metadata_array
cdef
grpc_metadata_array
c_metadata_array
cdef
bint
owns_metadata_slices
cdef
bint
owns_metadata_slices
cdef
object
metadata
cdef
object
metadata
cdef
void
_claim_slice_ownership
(
self
)
nogil
cdef
void
_claim_slice_ownership
(
self
)
cdef
void
_drop_slice_ownership
(
self
)
nogil
cdef
void
_drop_slice_ownership
(
self
)
cdef
class
Operation
:
cdef
class
Operation
:
...
...
This diff is collapsed.
Click to expand it.
src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi
+
11
−
5
View file @
35d89551
...
@@ -466,6 +466,10 @@ cdef class _MetadataIterator:
...
@@ -466,6 +466,10 @@ cdef class _MetadataIterator:
else
:
else
:
raise
StopIteration
raise
StopIteration
cdef
grpc_slice
_copy_slice
(
grpc_slice
slice
)
nogil
:
cdef
void
*
start
=
grpc_slice_start_ptr
(
slice
)
cdef
size_t
length
=
grpc_slice_length
(
slice
)
return
grpc_slice_from_copied_buffer
(
<
const
char
*>
start
,
length
)
cdef
class
Metadata
:
cdef
class
Metadata
:
...
@@ -489,8 +493,8 @@ cdef class Metadata:
...
@@ -489,8 +493,8 @@ cdef class Metadata:
(
<
Metadatum
>
self
.
metadata
[
i
]).
c_metadata
)
(
<
Metadatum
>
self
.
metadata
[
i
]).
c_metadata
)
def
__dealloc__
(
self
):
def
__dealloc__
(
self
):
self
.
_drop_slice_ownership
()
with
nogil
:
with
nogil
:
self
.
_drop_slice_ownership
()
# this frees the allocated memory for the grpc_metadata_array (although
# this frees the allocated memory for the grpc_metadata_array (although
# it'd be nice if that were documented somewhere...)
# it'd be nice if that were documented somewhere...)
# TODO(atash): document this in the C core
# TODO(atash): document this in the C core
...
@@ -510,15 +514,17 @@ cdef class Metadata:
...
@@ -510,15 +514,17 @@ cdef class Metadata:
def
__iter__
(
self
):
def
__iter__
(
self
):
return
_MetadataIterator
(
self
)
return
_MetadataIterator
(
self
)
cdef
void
_claim_slice_ownership
(
self
)
nogil
:
cdef
void
_claim_slice_ownership
(
self
):
if
self
.
owns_metadata_slices
:
if
self
.
owns_metadata_slices
:
return
return
for
i
in
range
(
self
.
c_metadata_array
.
count
):
for
i
in
range
(
self
.
c_metadata_array
.
count
):
grpc_slice_ref
(
self
.
c_metadata_array
.
metadata
[
i
].
key
)
self
.
c_metadata_array
.
metadata
[
i
].
key
=
_copy_slice
(
grpc_slice_ref
(
self
.
c_metadata_array
.
metadata
[
i
].
value
)
self
.
c_metadata_array
.
metadata
[
i
].
key
)
self
.
c_metadata_array
.
metadata
[
i
].
value
=
_copy_slice
(
self
.
c_metadata_array
.
metadata
[
i
].
value
)
self
.
owns_metadata_slices
=
True
self
.
owns_metadata_slices
=
True
cdef
void
_drop_slice_ownership
(
self
)
nogil
:
cdef
void
_drop_slice_ownership
(
self
):
if
not
self
.
owns_metadata_slices
:
if
not
self
.
owns_metadata_slices
:
return
return
for
i
in
range
(
self
.
c_metadata_array
.
count
):
for
i
in
range
(
self
.
c_metadata_array
.
count
):
...
...
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