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
d960cf89
Commit
d960cf89
authored
Sep 03, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add const to read-only nghttp2_frame* parameter in callbacks
parent
a7bd4f33
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
35 additions
and
35 deletions
+35
-35
examples/client.c
examples/client.c
+5
-5
lib/includes/nghttp2/nghttp2.h
lib/includes/nghttp2/nghttp2.h
+6
-6
src/HttpServer.cc
src/HttpServer.cc
+2
-2
src/app_helper.cc
src/app_helper.cc
+4
-4
src/app_helper.h
src/app_helper.h
+3
-3
src/nghttp.cc
src/nghttp.cc
+3
-3
src/shrpx_http2_upstream.cc
src/shrpx_http2_upstream.cc
+2
-2
src/shrpx_spdy_session.cc
src/shrpx_spdy_session.cc
+4
-4
tests/nghttp2_session_test.c
tests/nghttp2_session_test.c
+6
-6
No files found.
examples/client.c
View file @
d960cf89
...
...
@@ -228,7 +228,7 @@ static ssize_t recv_callback(nghttp2_session *session,
* (nghttp2_submit_request).
*/
static
int
before_frame_send_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
const
nghttp2_frame
*
frame
,
void
*
user_data
)
{
if
(
frame
->
hd
.
type
==
NGHTTP2_HEADERS
&&
...
...
@@ -245,7 +245,7 @@ static int before_frame_send_callback(nghttp2_session *session,
}
static
int
on_frame_send_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
void
*
user_data
)
const
nghttp2_frame
*
frame
,
void
*
user_data
)
{
size_t
i
;
switch
(
frame
->
hd
.
type
)
{
...
...
@@ -272,7 +272,7 @@ static int on_frame_send_callback(nghttp2_session *session,
}
static
int
on_frame_recv_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
void
*
user_data
)
const
nghttp2_frame
*
frame
,
void
*
user_data
)
{
size_t
i
;
switch
(
frame
->
hd
.
type
)
{
...
...
@@ -311,8 +311,8 @@ static int on_frame_recv_callback(nghttp2_session *session,
*/
static
int
on_stream_close_callback
(
nghttp2_session
*
session
,
int32_t
stream_id
,
nghttp2_error_code
error_code
,
void
*
user_data
)
nghttp2_error_code
error_code
,
void
*
user_data
)
{
struct
Request
*
req
;
req
=
nghttp2_session_get_stream_user_data
(
session
,
stream_id
);
...
...
lib/includes/nghttp2/nghttp2.h
View file @
d960cf89
...
...
@@ -786,7 +786,7 @@ typedef ssize_t (*nghttp2_recv_callback)
* immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`.
*/
typedef
int
(
*
nghttp2_on_frame_recv_callback
)
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
void
*
user_data
);
(
nghttp2_session
*
session
,
const
nghttp2_frame
*
frame
,
void
*
user_data
);
/**
* @functypedef
...
...
@@ -803,8 +803,8 @@ typedef int (*nghttp2_on_frame_recv_callback)
* immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`.
*/
typedef
int
(
*
nghttp2_on_invalid_frame_recv_callback
)
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
nghttp2_error_code
error_cod
e
,
void
*
user_data
);
(
nghttp2_session
*
session
,
const
nghttp2_frame
*
fram
e
,
nghttp2_error_code
error_code
,
void
*
user_data
);
/**
* @functypedef
...
...
@@ -857,7 +857,7 @@ typedef int (*nghttp2_on_data_recv_callback)
* immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`.
*/
typedef
int
(
*
nghttp2_before_frame_send_callback
)
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
void
*
user_data
);
(
nghttp2_session
*
session
,
const
nghttp2_frame
*
frame
,
void
*
user_data
);
/**
* @functypedef
...
...
@@ -870,7 +870,7 @@ typedef int (*nghttp2_before_frame_send_callback)
* immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`.
*/
typedef
int
(
*
nghttp2_on_frame_send_callback
)
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
void
*
user_data
);
(
nghttp2_session
*
session
,
const
nghttp2_frame
*
frame
,
void
*
user_data
);
/**
* @functypedef
...
...
@@ -886,7 +886,7 @@ typedef int (*nghttp2_on_frame_send_callback)
* immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`.
*/
typedef
int
(
*
nghttp2_on_frame_not_send_callback
)
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
int
lib_error_code
,
(
nghttp2_session
*
session
,
const
nghttp2_frame
*
frame
,
int
lib_error_code
,
void
*
user_data
);
/**
...
...
src/HttpServer.cc
View file @
d960cf89
...
...
@@ -686,7 +686,7 @@ const char *REQUIRED_HEADERS[] = {
namespace
{
int
hd_on_frame_recv_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
void
*
user_data
)
(
nghttp2_session
*
session
,
const
nghttp2_frame
*
frame
,
void
*
user_data
)
{
auto
hd
=
reinterpret_cast
<
Http2Handler
*>
(
user_data
);
if
(
hd
->
get_config
()
->
verbose
)
{
...
...
@@ -741,7 +741,7 @@ int htdocs_on_request_recv_callback
namespace
{
int
hd_on_frame_send_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
(
nghttp2_session
*
session
,
const
nghttp2_frame
*
frame
,
void
*
user_data
)
{
auto
hd
=
reinterpret_cast
<
Http2Handler
*>
(
user_data
);
...
...
src/app_helper.cc
View file @
d960cf89
...
...
@@ -235,7 +235,7 @@ const char* frame_name_ansi_esc(print_type ptype)
}
// namespace
namespace
{
void
print_frame
(
print_type
ptype
,
nghttp2_frame
*
frame
)
void
print_frame
(
print_type
ptype
,
const
nghttp2_frame
*
frame
)
{
printf
(
"%s%s%s frame "
,
frame_name_ansi_esc
(
ptype
),
...
...
@@ -324,7 +324,7 @@ void print_frame(print_type ptype, nghttp2_frame *frame)
}
// namespace
int
on_frame_recv_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
void
*
user_data
)
(
nghttp2_session
*
session
,
const
nghttp2_frame
*
frame
,
void
*
user_data
)
{
print_timer
();
printf
(
" recv "
);
...
...
@@ -334,7 +334,7 @@ int on_frame_recv_callback
}
int
on_invalid_frame_recv_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
(
nghttp2_session
*
session
,
const
nghttp2_frame
*
frame
,
nghttp2_error_code
error_code
,
void
*
user_data
)
{
print_timer
();
...
...
@@ -392,7 +392,7 @@ int on_unknown_frame_recv_callback(nghttp2_session *session,
}
int
on_frame_send_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
void
*
user_data
)
(
nghttp2_session
*
session
,
const
nghttp2_frame
*
frame
,
void
*
user_data
)
{
print_timer
();
printf
(
" send "
);
...
...
src/app_helper.h
View file @
d960cf89
...
...
@@ -40,10 +40,10 @@ namespace nghttp2 {
void
print_nv
(
char
**
nv
);
int
on_frame_recv_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
void
*
user_data
);
(
nghttp2_session
*
session
,
const
nghttp2_frame
*
frame
,
void
*
user_data
);
int
on_invalid_frame_recv_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
(
nghttp2_session
*
session
,
const
nghttp2_frame
*
frame
,
nghttp2_error_code
error_code
,
void
*
user_data
);
int
on_frame_recv_parse_error_callback
(
nghttp2_session
*
session
,
...
...
@@ -62,7 +62,7 @@ int on_unknown_frame_recv_callback(nghttp2_session *session,
void
*
user_data
);
int
on_frame_send_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
void
*
user_data
);
(
nghttp2_session
*
session
,
const
nghttp2_frame
*
frame
,
void
*
user_data
);
int
on_data_recv_callback
(
nghttp2_session
*
session
,
uint16_t
length
,
uint8_t
flags
,
int32_t
stream_id
,
...
...
src/nghttp.cc
View file @
d960cf89
...
...
@@ -979,7 +979,7 @@ void check_stream_id(nghttp2_session *session, int32_t stream_id,
}
// namespace
int
on_frame_send_callback2
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
void
*
user_data
)
(
nghttp2_session
*
session
,
const
nghttp2_frame
*
frame
,
void
*
user_data
)
{
if
(
frame
->
hd
.
type
==
NGHTTP2_HEADERS
&&
frame
->
headers
.
cat
==
NGHTTP2_HCAT_REQUEST
)
{
...
...
@@ -992,7 +992,7 @@ int on_frame_send_callback2
}
void
check_response_header
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
void
*
user_data
)
(
nghttp2_session
*
session
,
const
nghttp2_frame
*
frame
,
void
*
user_data
)
{
if
(
frame
->
hd
.
type
!=
NGHTTP2_HEADERS
||
frame
->
headers
.
cat
!=
NGHTTP2_HCAT_RESPONSE
)
{
...
...
@@ -1027,7 +1027,7 @@ void check_response_header
}
int
on_frame_recv_callback2
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
void
*
user_data
)
(
nghttp2_session
*
session
,
const
nghttp2_frame
*
frame
,
void
*
user_data
)
{
if
(
frame
->
hd
.
type
==
NGHTTP2_HEADERS
&&
frame
->
headers
.
cat
==
NGHTTP2_HCAT_RESPONSE
)
{
...
...
src/shrpx_http2_upstream.cc
View file @
d960cf89
...
...
@@ -174,7 +174,7 @@ int Http2Upstream::upgrade_upstream(HttpsUpstream *http)
namespace
{
int
on_frame_recv_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
void
*
user_data
)
(
nghttp2_session
*
session
,
const
nghttp2_frame
*
frame
,
void
*
user_data
)
{
auto
upstream
=
reinterpret_cast
<
Http2Upstream
*>
(
user_data
);
switch
(
frame
->
hd
.
type
)
{
...
...
@@ -332,7 +332,7 @@ int on_data_chunk_recv_callback(nghttp2_session *session,
namespace
{
int
on_frame_not_send_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
const
nghttp2_frame
*
frame
,
int
lib_error_code
,
void
*
user_data
)
{
auto
upstream
=
reinterpret_cast
<
Http2Upstream
*>
(
user_data
);
...
...
src/shrpx_spdy_session.cc
View file @
d960cf89
...
...
@@ -724,7 +724,7 @@ int on_stream_close_callback
namespace
{
int
on_frame_recv_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
void
*
user_data
)
(
nghttp2_session
*
session
,
const
nghttp2_frame
*
frame
,
void
*
user_data
)
{
int
rv
;
auto
spdy
=
reinterpret_cast
<
SpdySession
*>
(
user_data
);
...
...
@@ -947,7 +947,7 @@ int on_data_chunk_recv_callback(nghttp2_session *session,
namespace
{
int
before_frame_send_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
const
nghttp2_frame
*
frame
,
void
*
user_data
)
{
if
(
frame
->
hd
.
type
==
NGHTTP2_HEADERS
&&
...
...
@@ -972,8 +972,8 @@ int before_frame_send_callback(nghttp2_session *session,
namespace
{
int
on_frame_not_send_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
int
lib_error_code
,
void
*
user_data
)
const
nghttp2_frame
*
frame
,
int
lib_error_code
,
void
*
user_data
)
{
auto
spdy
=
reinterpret_cast
<
SpdySession
*>
(
user_data
);
SSLOG
(
WARNING
,
spdy
)
<<
"Failed to send control frame type="
...
...
tests/nghttp2_session_test.c
View file @
d960cf89
...
...
@@ -109,8 +109,8 @@ static ssize_t scripted_recv_callback(nghttp2_session *session,
}
static
ssize_t
eof_recv_callback
(
nghttp2_session
*
session
,
uint8_t
*
data
,
size_t
len
,
int
flags
,
void
*
user_data
)
uint8_t
*
data
,
size_t
len
,
int
flags
,
void
*
user_data
)
{
return
NGHTTP2_ERR_EOF
;
}
...
...
@@ -127,7 +127,7 @@ static ssize_t accumulator_send_callback(nghttp2_session *session,
}
static
int
on_frame_recv_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
const
nghttp2_frame
*
frame
,
void
*
user_data
)
{
my_user_data
*
ud
=
(
my_user_data
*
)
user_data
;
...
...
@@ -136,7 +136,7 @@ static int on_frame_recv_callback(nghttp2_session *session,
}
static
int
on_invalid_frame_recv_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
const
nghttp2_frame
*
frame
,
nghttp2_error_code
error_code
,
void
*
user_data
)
{
...
...
@@ -146,7 +146,7 @@ static int on_invalid_frame_recv_callback(nghttp2_session *session,
}
static
int
on_frame_send_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
const
nghttp2_frame
*
frame
,
void
*
user_data
)
{
my_user_data
*
ud
=
(
my_user_data
*
)
user_data
;
...
...
@@ -156,7 +156,7 @@ static int on_frame_send_callback(nghttp2_session *session,
}
static
int
on_frame_not_send_callback
(
nghttp2_session
*
session
,
nghttp2_frame
*
frame
,
const
nghttp2_frame
*
frame
,
int
lib_error
,
void
*
user_data
)
{
...
...
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