Remove nghttp2_on_frame_recv_parse_error_callback

This commit is contained in:
Tatsuhiro Tsujikawa 2014-01-26 23:16:13 +09:00
parent 6e6127037b
commit 545f24bc1b
7 changed files with 1 additions and 114 deletions

View File

@ -1072,33 +1072,6 @@ typedef int (*nghttp2_on_stream_close_callback)
typedef int (*nghttp2_on_request_recv_callback) typedef int (*nghttp2_on_request_recv_callback)
(nghttp2_session *session, int32_t stream_id, void *user_data); (nghttp2_session *session, int32_t stream_id, void *user_data);
/**
* @functypedef
*
* Callback function invoked when the received control frame octets
* could not be parsed correctly. The |type| indicates the type of
* received non-DATA frame. The |head| is the pointer to the header of
* the received frame. The |headlen| is the length of the
* |head|. According to the spec, the |headlen| is always 8. In other
* words, the |head| is the first 8 bytes of the received frame. The
* |payload| is the pointer to the data portion of the received frame.
* The |payloadlen| is the length of the |payload|. This is the data
* after the length field. The |lib_error_code| is one of the error
* code defined in :enum:`nghttp2_error` and indicates the error. The
* |user_data| pointer is the third argument passed in to the call to
* `nghttp2_session_client_new()` or `nghttp2_session_server_new()`.
*
* The implementation of this function must return 0 if it
* succeeds. If nonzero is returned, it is treated as fatal error and
* `nghttp2_session_recv()` and `nghttp2_session_send()` functions
* immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`.
*/
typedef int (*nghttp2_on_frame_recv_parse_error_callback)
(nghttp2_session *session, nghttp2_frame_type type,
const uint8_t *head, size_t headlen,
const uint8_t *payload, size_t payloadlen,
int lib_error_code, void *user_data);
/** /**
* @functypedef * @functypedef
* *
@ -1247,12 +1220,6 @@ typedef struct {
* received. * received.
*/ */
nghttp2_on_request_recv_callback on_request_recv_callback; nghttp2_on_request_recv_callback on_request_recv_callback;
/**
* Callback function invoked when the received non-DATA frame octets
* could not be parsed correctly.
*/
nghttp2_on_frame_recv_parse_error_callback
on_frame_recv_parse_error_callback;
/** /**
* Callback function invoked when the received frame type is * Callback function invoked when the received frame type is
* unknown. * unknown.
@ -1536,10 +1503,7 @@ int nghttp2_session_send(nghttp2_session *session);
* invalid, * invalid,
* :member:`nghttp2_session_callbacks.on_invalid_frame_recv_callback` * :member:`nghttp2_session_callbacks.on_invalid_frame_recv_callback`
* is invoked. * is invoked.
* 4. If the received frame could not be unpacked correctly, * 4. If the received frame type is unknown,
* :member:`nghttp2_session_callbacks.on_frame_recv_parse_error_callback`
* is invoked.
* 5. If the received frame type is unknown,
* :member:`nghttp2_session_callbacks.on_unknown_frame_recv_callback` * :member:`nghttp2_session_callbacks.on_unknown_frame_recv_callback`
* is invoked. * is invoked.
* *

View File

@ -1002,8 +1002,6 @@ void fill_callback(nghttp2_session_callbacks& callbacks, const Config *config)
if(config->verbose) { if(config->verbose) {
callbacks.on_invalid_frame_recv_callback = callbacks.on_invalid_frame_recv_callback =
verbose_on_invalid_frame_recv_callback; verbose_on_invalid_frame_recv_callback;
callbacks.on_frame_recv_parse_error_callback =
verbose_on_frame_recv_parse_error_callback;
callbacks.on_unknown_frame_recv_callback = callbacks.on_unknown_frame_recv_callback =
verbose_on_unknown_frame_recv_callback; verbose_on_unknown_frame_recv_callback;
} }

View File

@ -387,27 +387,6 @@ void dump_header(const uint8_t *head, size_t headlen)
} }
} // namespace } // namespace
int verbose_on_frame_recv_parse_error_callback(nghttp2_session *session,
nghttp2_frame_type type,
const uint8_t *head,
size_t headlen,
const uint8_t *payload,
size_t payloadlen,
int error_code,
void *user_data)
{
print_timer();
printf(" [PARSE_ERROR] recv %s%s%s frame\n",
frame_name_ansi_esc(PRINT_RECV),
strframetype(type),
ansi_escend());
print_frame_attr_indent();
printf("Error: %s\n", nghttp2_strerror(error_code));
dump_header(head, headlen);
fflush(stdout);
return 0;
}
int verbose_on_unknown_frame_recv_callback(nghttp2_session *session, int verbose_on_unknown_frame_recv_callback(nghttp2_session *session,
const uint8_t *head, const uint8_t *head,
size_t headlen, size_t headlen,

View File

@ -52,15 +52,6 @@ int verbose_on_invalid_frame_recv_callback
(nghttp2_session *session, const nghttp2_frame *frame, (nghttp2_session *session, const nghttp2_frame *frame,
nghttp2_error_code error_code, void *user_data); nghttp2_error_code error_code, void *user_data);
int verbose_on_frame_recv_parse_error_callback(nghttp2_session *session,
nghttp2_frame_type type,
const uint8_t *head,
size_t headlen,
const uint8_t *payload,
size_t payloadlen,
int error_code,
void *user_data);
int verbose_on_unknown_frame_recv_callback(nghttp2_session *session, int verbose_on_unknown_frame_recv_callback(nghttp2_session *session,
const uint8_t *head, const uint8_t *head,
size_t headlen, size_t headlen,

View File

@ -1589,8 +1589,6 @@ int run(char **uris, int n)
callbacks.on_data_send_callback = verbose_on_data_send_callback; callbacks.on_data_send_callback = verbose_on_data_send_callback;
callbacks.on_invalid_frame_recv_callback = callbacks.on_invalid_frame_recv_callback =
verbose_on_invalid_frame_recv_callback; verbose_on_invalid_frame_recv_callback;
callbacks.on_frame_recv_parse_error_callback =
verbose_on_frame_recv_parse_error_callback;
callbacks.on_unknown_frame_recv_callback = callbacks.on_unknown_frame_recv_callback =
verbose_on_unknown_frame_recv_callback; verbose_on_unknown_frame_recv_callback;
} }

View File

@ -1130,26 +1130,6 @@ int on_frame_not_send_callback(nghttp2_session *session,
} }
} // namespace } // namespace
namespace {
int on_frame_recv_parse_error_callback(nghttp2_session *session,
nghttp2_frame_type type,
const uint8_t *head, size_t headlen,
const uint8_t *payload,
size_t payloadlen, int lib_error_code,
void *user_data)
{
auto http2session = static_cast<Http2Session*>(user_data);
if(LOG_ENABLED(INFO)) {
SSLOG(INFO, http2session)
<< "Failed to parse received control frame. type="
<< type
<< ", lib_error_code=" << lib_error_code << ":"
<< nghttp2_strerror(lib_error_code);
}
return 0;
}
} // namespace
namespace { namespace {
int on_unknown_frame_recv_callback(nghttp2_session *session, int on_unknown_frame_recv_callback(nghttp2_session *session,
const uint8_t *head, size_t headlen, const uint8_t *head, size_t headlen,
@ -1203,8 +1183,6 @@ int Http2Session::on_connect()
callbacks.before_frame_send_callback = before_frame_send_callback; callbacks.before_frame_send_callback = before_frame_send_callback;
callbacks.on_frame_send_callback = on_frame_send_callback; callbacks.on_frame_send_callback = on_frame_send_callback;
callbacks.on_frame_not_send_callback = on_frame_not_send_callback; callbacks.on_frame_not_send_callback = on_frame_not_send_callback;
callbacks.on_frame_recv_parse_error_callback =
on_frame_recv_parse_error_callback;
callbacks.on_unknown_frame_recv_callback = on_unknown_frame_recv_callback; callbacks.on_unknown_frame_recv_callback = on_unknown_frame_recv_callback;
callbacks.on_header_callback = on_header_callback; callbacks.on_header_callback = on_header_callback;
callbacks.on_end_headers_callback = on_end_headers_callback; callbacks.on_end_headers_callback = on_end_headers_callback;

View File

@ -456,25 +456,6 @@ int on_frame_not_send_callback(nghttp2_session *session,
} }
} // namespace } // namespace
namespace {
int on_frame_recv_parse_error_callback(nghttp2_session *session,
nghttp2_frame_type type,
const uint8_t *head, size_t headlen,
const uint8_t *payload,
size_t payloadlen, int lib_error_code,
void *user_data)
{
auto upstream = static_cast<Http2Upstream*>(user_data);
if(LOG_ENABLED(INFO)) {
ULOG(INFO, upstream) << "Failed to parse received control frame. type="
<< type
<< ", error_code=" << lib_error_code << ":"
<< nghttp2_strerror(lib_error_code);
}
return 0;
}
} // namespace
namespace { namespace {
int on_unknown_frame_recv_callback(nghttp2_session *session, int on_unknown_frame_recv_callback(nghttp2_session *session,
const uint8_t *head, size_t headlen, const uint8_t *head, size_t headlen,
@ -520,8 +501,6 @@ Http2Upstream::Http2Upstream(ClientHandler *handler)
callbacks.on_data_recv_callback = on_data_recv_callback; callbacks.on_data_recv_callback = on_data_recv_callback;
callbacks.on_frame_send_callback = on_frame_send_callback; callbacks.on_frame_send_callback = on_frame_send_callback;
callbacks.on_frame_not_send_callback = on_frame_not_send_callback; callbacks.on_frame_not_send_callback = on_frame_not_send_callback;
callbacks.on_frame_recv_parse_error_callback =
on_frame_recv_parse_error_callback;
callbacks.on_unknown_frame_recv_callback = on_unknown_frame_recv_callback; callbacks.on_unknown_frame_recv_callback = on_unknown_frame_recv_callback;
callbacks.on_header_callback = on_header_callback; callbacks.on_header_callback = on_header_callback;
callbacks.on_end_headers_callback = on_end_headers_callback; callbacks.on_end_headers_callback = on_end_headers_callback;