39 static int HTTP2RegisterPatternsForProtocolDetection(
void)
46 16, 0, STREAM_TOSERVER) < 0)
58 const char *proto_name =
"http2";
62 if (HTTP2RegisterPatternsForProtocolDetection() < 0)
66 rs_http2_register_parser();
77 if (h2s == NULL || h1tx == NULL) {
80 if (htp_tx_request_method(h1tx) == NULL) {
85 rs_http2_tx_set_method(h2s, bstr_ptr(htp_tx_request_method(h1tx)),
86 (uint32_t)bstr_len(htp_tx_request_method(h1tx)));
87 if (htp_tx_request_uri(h1tx) != NULL) {
90 rs_http2_tx_set_uri(h2s, bstr_ptr(htp_tx_request_uri(h1tx)),
91 (uint32_t)bstr_len(htp_tx_request_uri(h1tx)));
93 size_t nbheaders = htp_tx_request_headers_size(h1tx);
94 for (
size_t i = 0; i < nbheaders; i++) {
95 const htp_header_t *h = htp_tx_request_header_index(h1tx, i);
96 rs_http2_tx_add_header(h2s, htp_header_name_ptr(h), (uint32_t)htp_header_name_len(h),
97 htp_header_value_ptr(h), (uint32_t)htp_header_value_len(h));