Ejemplo n.º 1
0
int32_t nghttp2_submit_request(nghttp2_session *session,
                               const nghttp2_priority_spec *pri_spec,
                               const nghttp2_nv *nva, size_t nvlen,
                               const nghttp2_data_provider *data_prd,
                               void *stream_user_data) {
  uint8_t flags;
  int rv;

  if (session->server) {
    return NGHTTP2_ERR_PROTO;
  }

  if (pri_spec && !nghttp2_priority_spec_check_default(pri_spec)) {
    rv = detect_self_dependency(session, -1, pri_spec);
    if (rv != 0) {
      return rv;
    }
  } else {
    pri_spec = NULL;
  }

  flags = set_request_flags(pri_spec, data_prd);

  return submit_headers_shared_nva(session, flags, -1, pri_spec, nva, nvlen,
                                   data_prd, stream_user_data);
}
Ejemplo n.º 2
0
int32_t nghttp2_submit_request(nghttp2_session *session,
                               const nghttp2_priority_spec *pri_spec,
                               const nghttp2_nv *nva, size_t nvlen,
                               const nghttp2_data_provider *data_prd,
                               void *stream_user_data) {
  uint8_t flags;

  if (pri_spec && nghttp2_priority_spec_check_default(pri_spec)) {
    pri_spec = NULL;
  }

  flags = set_request_flags(pri_spec, data_prd);

  return submit_headers_shared_nva(session, flags, -1, pri_spec, nva, nvlen,
                                   data_prd, stream_user_data);
}