| 193 | } |
| 194 | |
| 195 | static http2_stream_data * |
| 196 | create_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 | |
| 220 | static void delete_http2_stream_data(http2_stream_data *stream_data) { |
| 221 | if (stream_data->fd != -1) |
no test coverage detected