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
42ac80d3
Commit
42ac80d3
authored
Aug 26, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python: Fix build error
parent
4c11cd06
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
25 deletions
+72
-25
python/cnghttp2.pxd
python/cnghttp2.pxd
+46
-14
python/nghttp2.pyx
python/nghttp2.pyx
+26
-11
No files found.
python/cnghttp2.pxd
View file @
42ac80d3
...
...
@@ -102,7 +102,7 @@ cdef extern from 'nghttp2/nghttp2.h':
ctypedef
struct
nghttp2_rst_stream
:
nghttp2_frame_hd
hd
nghttp2_error_code
error_code
uint32_t
error_code
ctypedef
struct
nghttp2_push_promise
:
...
...
@@ -114,7 +114,7 @@ cdef extern from 'nghttp2/nghttp2.h':
ctypedef
struct
nghttp2_goaway
:
nghttp2_frame_hd
hd
int32_t
last_stream_id
nghttp2_error_code
error_code
uint32_t
error_code
uint8_t
*
opaque_data
size_t
opaque_data_len
...
...
@@ -142,7 +142,7 @@ cdef extern from 'nghttp2/nghttp2.h':
ctypedef
int
(
*
nghttp2_on_stream_close_callback
)
\
(
nghttp2_session
*
session
,
int32_t
stream_id
,
nghttp2_error_code
error_code
,
void
*
user_data
)
uint32_t
error_code
,
void
*
user_data
)
ctypedef
int
(
*
nghttp2_on_begin_headers_callback
)
\
(
nghttp2_session
*
session
,
const
nghttp2_frame
*
frame
,
void
*
user_data
)
...
...
@@ -163,15 +163,47 @@ cdef extern from 'nghttp2/nghttp2.h':
int
lib_error_code
,
void
*
user_data
)
ctypedef
struct
nghttp2_session_callbacks
:
nghttp2_send_callback
send_callback
nghttp2_on_frame_recv_callback
on_frame_recv_callback
nghttp2_on_data_chunk_recv_callback
on_data_chunk_recv_callback
nghttp2_before_frame_send_callback
before_frame_send_callback
nghttp2_on_frame_send_callback
on_frame_send_callback
nghttp2_on_frame_not_send_callback
on_frame_not_send_callback
nghttp2_on_stream_close_callback
on_stream_close_callback
nghttp2_on_begin_headers_callback
on_begin_headers_callback
nghttp2_on_header_callback
on_header_callback
pass
int
nghttp2_session_callbacks_new
(
nghttp2_session_callbacks
**
callbacks_ptr
)
void
nghttp2_session_callbacks_del
(
nghttp2_session_callbacks
*
callbacks
)
void
nghttp2_session_callbacks_set_send_callback
(
nghttp2_session_callbacks
*
cbs
,
nghttp2_send_callback
send_callback
)
void
nghttp2_session_callbacks_set_on_frame_recv_callback
(
nghttp2_session_callbacks
*
cbs
,
nghttp2_on_frame_recv_callback
on_frame_recv_callback
)
void
nghttp2_session_callbacks_set_on_data_chunk_recv_callback
(
nghttp2_session_callbacks
*
cbs
,
nghttp2_on_data_chunk_recv_callback
on_data_chunk_recv_callback
)
void
nghttp2_session_callbacks_set_before_frame_send_callback
(
nghttp2_session_callbacks
*
cbs
,
nghttp2_before_frame_send_callback
before_frame_send_callback
)
void
nghttp2_session_callbacks_set_on_frame_send_callback
(
nghttp2_session_callbacks
*
cbs
,
nghttp2_on_frame_send_callback
on_frame_send_callback
)
void
nghttp2_session_callbacks_set_on_frame_not_send_callback
(
nghttp2_session_callbacks
*
cbs
,
nghttp2_on_frame_not_send_callback
on_frame_not_send_callback
)
void
nghttp2_session_callbacks_set_on_stream_close_callback
(
nghttp2_session_callbacks
*
cbs
,
nghttp2_on_stream_close_callback
on_stream_close_callback
)
void
nghttp2_session_callbacks_set_on_begin_headers_callback
(
nghttp2_session_callbacks
*
cbs
,
nghttp2_on_begin_headers_callback
on_begin_headers_callback
)
void
nghttp2_session_callbacks_set_on_header_callback
(
nghttp2_session_callbacks
*
cbs
,
nghttp2_on_header_callback
on_header_callback
)
int
nghttp2_session_client_new
(
nghttp2_session
**
session_ptr
,
const
nghttp2_session_callbacks
*
callbacks
,
...
...
@@ -233,7 +265,7 @@ cdef extern from 'nghttp2/nghttp2.h':
int
nghttp2_submit_rst_stream
(
nghttp2_session
*
session
,
uint8_t
flags
,
int32_t
stream_id
,
nghttp2_error_code
error_code
)
uint32_t
error_code
)
void
*
nghttp2_session_get_stream_user_data
(
nghttp2_session
*
session
,
uint32_t
stream_id
)
...
...
@@ -243,7 +275,7 @@ cdef extern from 'nghttp2/nghttp2.h':
void
*
stream_user_data
)
int
nghttp2_session_terminate_session
(
nghttp2_session
*
session
,
nghttp2_error_code
error_code
)
uint32_t
error_code
)
const
char
*
nghttp2_strerror
(
int
lib_error_code
)
...
...
python/nghttp2.pyx
View file @
42ac80d3
...
...
@@ -430,7 +430,7 @@ cdef int server_on_frame_not_send(cnghttp2.nghttp2_session *session,
cdef
int
server_on_stream_close
(
cnghttp2
.
nghttp2_session
*
session
,
int32_t
stream_id
,
cnghttp2
.
nghttp2_error_code
error_code
,
uint32_t
error_code
,
void
*
user_data
):
cdef
http2
=
<
_HTTP2SessionCore
>
user_data
...
...
@@ -479,7 +479,7 @@ cdef class _HTTP2SessionCore:
cdef
settings_timer
def
__cinit__
(
self
,
transport
,
handler_class
):
cdef
cnghttp2
.
nghttp2_session_callbacks
callbacks
cdef
cnghttp2
.
nghttp2_session_callbacks
*
callbacks
cdef
cnghttp2
.
nghttp2_settings_entry
iv
[
2
]
cdef
int
rv
...
...
@@ -490,17 +490,32 @@ cdef class _HTTP2SessionCore:
self
.
handlers
=
set
()
self
.
settings_timer
=
None
memset
(
&
callbacks
,
0
,
sizeof
(
callbacks
))
callbacks
.
on_header_callback
=
server_on_header
callbacks
.
on_begin_headers_callback
=
server_on_begin_headers
callbacks
.
on_frame_recv_callback
=
server_on_frame_recv
callbacks
.
on_stream_close_callback
=
server_on_stream_close
callbacks
.
on_frame_send_callback
=
server_on_frame_send
callbacks
.
on_frame_not_send_callback
=
server_on_frame_not_send
callbacks
.
on_data_chunk_recv_callback
=
server_on_data_chunk_recv
rv
=
cnghttp2
.
nghttp2_session_callbacks_new
(
&
callbacks
)
rv
=
cnghttp2
.
nghttp2_session_server_new
(
&
self
.
session
,
&
callbacks
,
if
rv
!=
0
:
raise
Exception
(
'nghttp2_session_callbacks_new failed: {}'
.
format
\
(
_strerror
(
rv
)))
cnghttp2
.
nghttp2_session_callbacks_set_on_header_callback
(
callbacks
,
server_on_header
)
cnghttp2
.
nghttp2_session_callbacks_set_on_begin_headers_callback
(
callbacks
,
server_on_begin_headers
)
cnghttp2
.
nghttp2_session_callbacks_set_on_frame_recv_callback
(
callbacks
,
server_on_frame_recv
)
cnghttp2
.
nghttp2_session_callbacks_set_on_stream_close_callback
(
callbacks
,
server_on_stream_close
)
cnghttp2
.
nghttp2_session_callbacks_set_on_frame_send_callback
(
callbacks
,
server_on_frame_send
)
cnghttp2
.
nghttp2_session_callbacks_set_on_frame_not_send_callback
(
callbacks
,
server_on_frame_not_send
)
cnghttp2
.
nghttp2_session_callbacks_set_on_data_chunk_recv_callback
(
callbacks
,
server_on_data_chunk_recv
)
rv
=
cnghttp2
.
nghttp2_session_server_new
(
&
self
.
session
,
callbacks
,
<
void
*>
self
)
cnghttp2
.
nghttp2_session_callbacks_del
(
callbacks
)
if
rv
!=
0
:
raise
Exception
(
'nghttp2_session_server_new failed: {}'
.
format
\
(
_strerror
(
rv
)))
...
...
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