Commit d960cf89 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Add const to read-only nghttp2_frame* parameter in callbacks

parent a7bd4f33
......@@ -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) {
......
......@@ -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_code,
void *user_data);
(nghttp2_session *session, const nghttp2_frame *frame,
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);
/**
......
......@@ -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);
......
......@@ -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 ");
......
......@@ -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,
......
......@@ -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) {
......
......@@ -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);
......
......@@ -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,7 +972,7 @@ int before_frame_send_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 spdy = reinterpret_cast<SpdySession*>(user_data);
......
......@@ -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)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment