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

Function create_http2_stream_data

modules/http2d/server.c:195–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193}
194
195static http2_stream_data *
196create_http2_stream_data(http2_session_data *session_data, int32_t stream_id) {
197 http2_stream_data *stream_data;
198
199 stream_data = pkg_malloc(sizeof *stream_data);
200 if (!stream_data) {
201 LM_ERR("oom\n");
202 return NULL;
203 }
204
205 memset(stream_data, 0, sizeof *stream_data);
206 stream_data->stream_id = stream_id;
207 stream_data->hdrs = cJSON_CreateObject();
208 if (!stream_data->hdrs) {
209 pkg_free(stream_data);
210 LM_ERR("oom\n");
211 return NULL;
212 }
213
214 stream_data->fd = -1;
215
216 add_stream(session_data, stream_data);
217 return stream_data;
218}
219
220static void delete_http2_stream_data(http2_stream_data *stream_data) {
221 if (stream_data->fd != -1)

Callers 1

Calls 2

add_streamFunction · 0.85
cJSON_CreateObjectFunction · 0.50

Tested by

no test coverage detected