Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
7048c565
Commit
7048c565
authored
Jan 17, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python: Update to latest nghttp2_hd spec
parent
707a0b41
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
14 deletions
+19
-14
python/cnghttp2.pxd
python/cnghttp2.pxd
+2
-2
python/nghttp2.pyx
python/nghttp2.pyx
+17
-12
No files found.
python/cnghttp2.pxd
View file @
7048c565
...
...
@@ -86,10 +86,10 @@ cdef extern from 'nghttp2_hd.h':
nghttp2_nv
*
nva
,
size_t
nvlen
)
ssize_t
nghttp2_hd_inflate_hd
(
nghttp2_hd_context
*
inflater
,
nghttp2_nv
*
*
nva_ptr
,
nghttp2_nv
*
nv_out
,
int
*
final
,
uint8_t
*
input
,
size_t
inlen
)
int
nghttp2_hd_
end_headers
(
nghttp2_hd_context
*
deflater_or_
inflater
)
int
nghttp2_hd_
inflate_end_headers
(
nghttp2_hd_context
*
inflater
)
nghttp2_hd_entry
*
nghttp2_hd_table_get
(
nghttp2_hd_context
*
context
,
size_t
index
)
python/nghttp2.pyx
View file @
7048c565
...
...
@@ -199,19 +199,24 @@ cdef class HDInflater(_HDContextBase):
byte string (not unicode string).
'''
cdef
cnghttp2
.
nghttp2_nv
*
nva
cdef
cnghttp2
.
nghttp2_nv
nv
cdef
int
final
cdef
ssize_t
rv
rv
=
cnghttp2
.
nghttp2_hd_inflate_hd
(
&
self
.
_ctx
,
&
nva
,
data
,
len
(
data
))
if
rv
<
0
:
raise
Exception
(
_strerror
(
rv
))
try
:
res
=
[(
nva
[
i
].
name
[:
nva
[
i
].
namelen
],
nva
[
i
].
value
[:
nva
[
i
].
valuelen
])
for
i
in
range
(
rv
)]
finally
:
cnghttp2
.
nghttp2_nv_array_del
(
nva
)
cnghttp2
.
nghttp2_hd_end_headers
(
&
self
.
_ctx
)
cdef
uint8_t
*
buf
=
data
cdef
size_t
buflen
=
len
(
data
)
res
=
[]
while
True
:
rv
=
cnghttp2
.
nghttp2_hd_inflate_hd
(
&
self
.
_ctx
,
&
nv
,
&
final
,
buf
,
buflen
)
if
rv
<
0
:
raise
Exception
(
_strerror
(
rv
))
if
final
:
break
buf
+=
rv
buflen
-=
rv
# may throw
res
.
append
((
nv
.
name
[:
nv
.
namelen
],
nv
.
value
[:
nv
.
valuelen
]))
cnghttp2
.
nghttp2_hd_inflate_end_headers
(
&
self
.
_ctx
)
return
res
cdef
_strerror
(
int
liberror_code
):
...
...
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