Add int return value to nghttp2_on_unknown_frame_recv_callback
This commit is contained in:
parent
db4f519500
commit
59286adc5e
|
@ -972,8 +972,13 @@ typedef int (*nghttp2_on_frame_recv_parse_error_callback)
|
||||||
* first 8 bytes of the received frame. The |payload| is the pointer
|
* first 8 bytes of the received frame. The |payload| is the pointer
|
||||||
* to the data portion of the received frame. The |payloadlen| is the
|
* to the data portion of the received frame. The |payloadlen| is the
|
||||||
* length of the |payload|. This is the data after the length field.
|
* length of the |payload|. This is the data after the length field.
|
||||||
|
*
|
||||||
|
* 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 void (*nghttp2_on_unknown_frame_recv_callback)
|
typedef int (*nghttp2_on_unknown_frame_recv_callback)
|
||||||
(nghttp2_session *session,
|
(nghttp2_session *session,
|
||||||
const uint8_t *head, size_t headlen,
|
const uint8_t *head, size_t headlen,
|
||||||
const uint8_t *payload, size_t payloadlen,
|
const uint8_t *payload, size_t payloadlen,
|
||||||
|
|
|
@ -2669,13 +2669,15 @@ static int nghttp2_session_process_ctrl_frame(nghttp2_session *session)
|
||||||
default:
|
default:
|
||||||
/* Unknown frame */
|
/* Unknown frame */
|
||||||
if(session->callbacks.on_unknown_frame_recv_callback) {
|
if(session->callbacks.on_unknown_frame_recv_callback) {
|
||||||
session->callbacks.on_unknown_frame_recv_callback
|
if(session->callbacks.on_unknown_frame_recv_callback
|
||||||
(session,
|
(session,
|
||||||
session->iframe.headbuf,
|
session->iframe.headbuf,
|
||||||
sizeof(session->iframe.headbuf),
|
sizeof(session->iframe.headbuf),
|
||||||
session->iframe.buf,
|
session->iframe.buf,
|
||||||
session->iframe.buflen,
|
session->iframe.buflen,
|
||||||
session->user_data);
|
session->user_data) != 0) {
|
||||||
|
r = NGHTTP2_ERR_CALLBACK_FAILURE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(nghttp2_is_fatal(r)) {
|
if(nghttp2_is_fatal(r)) {
|
||||||
|
|
|
@ -377,7 +377,7 @@ int on_frame_recv_parse_error_callback(nghttp2_session *session,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_unknown_frame_recv_callback(nghttp2_session *session,
|
int on_unknown_frame_recv_callback(nghttp2_session *session,
|
||||||
const uint8_t *head,
|
const uint8_t *head,
|
||||||
size_t headlen,
|
size_t headlen,
|
||||||
const uint8_t *payload,
|
const uint8_t *payload,
|
||||||
|
@ -388,6 +388,7 @@ void on_unknown_frame_recv_callback(nghttp2_session *session,
|
||||||
printf(" recv unknown frame\n");
|
printf(" recv unknown frame\n");
|
||||||
dump_header(head, headlen);
|
dump_header(head, headlen);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int on_frame_send_callback
|
int on_frame_send_callback
|
||||||
|
|
|
@ -54,7 +54,7 @@ int on_frame_recv_parse_error_callback(nghttp2_session *session,
|
||||||
size_t payloadlen,
|
size_t payloadlen,
|
||||||
int error_code, void *user_data);
|
int error_code, void *user_data);
|
||||||
|
|
||||||
void on_unknown_frame_recv_callback(nghttp2_session *session,
|
int on_unknown_frame_recv_callback(nghttp2_session *session,
|
||||||
const uint8_t *head,
|
const uint8_t *head,
|
||||||
size_t headlen,
|
size_t headlen,
|
||||||
const uint8_t *payload,
|
const uint8_t *payload,
|
||||||
|
|
|
@ -373,7 +373,7 @@ int on_frame_recv_parse_error_callback(nghttp2_session *session,
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
void 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,
|
||||||
const uint8_t *payload, size_t payloadlen,
|
const uint8_t *payload, size_t payloadlen,
|
||||||
void *user_data)
|
void *user_data)
|
||||||
|
@ -382,6 +382,7 @@ void on_unknown_frame_recv_callback(nghttp2_session *session,
|
||||||
if(LOG_ENABLED(INFO)) {
|
if(LOG_ENABLED(INFO)) {
|
||||||
ULOG(INFO, upstream) << "Received unknown control frame.";
|
ULOG(INFO, upstream) << "Received unknown control frame.";
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
|
@ -1024,7 +1024,7 @@ int on_frame_recv_parse_error_callback(nghttp2_session *session,
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
void 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,
|
||||||
const uint8_t *payload, size_t payloadlen,
|
const uint8_t *payload, size_t payloadlen,
|
||||||
void *user_data)
|
void *user_data)
|
||||||
|
@ -1033,6 +1033,7 @@ void on_unknown_frame_recv_callback(nghttp2_session *session,
|
||||||
if(LOG_ENABLED(INFO)) {
|
if(LOG_ENABLED(INFO)) {
|
||||||
SSLOG(INFO, spdy) << "Received unknown control frame";
|
SSLOG(INFO, spdy) << "Received unknown control frame";
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue