| 283 | } |
| 284 | |
| 285 | static int on_begin_headers_cb(nghttp2_session *ngh2, |
| 286 | const nghttp2_frame *frame, void *userp) |
| 287 | { |
| 288 | h2_session *session = (h2_session *)userp; |
| 289 | h2_stream *s = NULL; |
| 290 | |
| 291 | /* We may see HEADERs at the start of a stream or after all DATA |
| 292 | * streams to carry trailers. */ |
| 293 | (void)ngh2; |
| 294 | s = get_stream(session, frame->hd.stream_id); |
| 295 | if (s) { |
| 296 | /* nop */ |
| 297 | } |
| 298 | else if (session->local.accepting) { |
| 299 | s = h2_session_open_stream(userp, frame->hd.stream_id, 0); |
| 300 | } |
| 301 | return s? 0 : NGHTTP2_ERR_START_STREAM_NOT_ALLOWED; |
| 302 | } |
| 303 | |
| 304 | static int on_header_cb(nghttp2_session *ngh2, const nghttp2_frame *frame, |
| 305 | const uint8_t *name, size_t namelen, |
nothing calls this directly
no test coverage detected