MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / on_begin_headers_callback

Function on_begin_headers_callback

modules/http2d/server.c:760–785  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

758}
759
760static int on_begin_headers_callback(nghttp2_session *session,
761 const nghttp2_frame *frame,
762 void *user_data) {
763 http2_session_data *session_data = (http2_session_data *)user_data;
764 http2_stream_data *stream_data;
765
766 if (frame->hd.type != NGHTTP2_HEADERS ||
767 frame->headers.cat != NGHTTP2_HCAT_REQUEST) {
768 return 0;
769 }
770
771 stream_data = create_http2_stream_data(session_data, frame->hd.stream_id);
772 if (!stream_data) {
773 LM_ERR("failed to allocate stream data\n");
774 return -1;
775 }
776
777 LM_DBG("------------ BEGIN HEADERS (data: %p, stream_id: %d) ----------\n", stream_data, frame->hd.stream_id);
778 if (nghttp2_session_set_stream_user_data(session, frame->hd.stream_id,
779 stream_data) < 0) {
780 LM_ERR("failed to set user data\n");
781 return -1;
782 }
783
784 return 0;
785}
786
787static int on_stream_close_callback(nghttp2_session *session, int32_t stream_id,
788 uint32_t error_code, void *user_data) {

Callers

nothing calls this directly

Calls 1

create_http2_stream_dataFunction · 0.85

Tested by

no test coverage detected