| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,7 +31,7 @@ | |||
| 31 | 31 | * | |
| 32 | 32 | * Version number of the nghttp3 library release. | |
| 33 | 33 | */ | |
| 34 | - #define NGHTTP3_VERSION "1.14.0" | ||
| 34 | + #define NGHTTP3_VERSION "1.15.0" | ||
| 35 | 35 | ||
| 36 | 36 | /** | |
| 37 | 37 | * @macro | |
@@ -41,6 +41,6 @@ | |||
| 41 | 41 | * number, 8 bits for minor and 8 bits for patch. Version 1.2.3 | |
| 42 | 42 | * becomes 0x010203. | |
| 43 | 43 | */ | |
| 44 | - #define NGHTTP3_VERSION_NUM 0x010e00 | ||
| 44 | + #define NGHTTP3_VERSION_NUM 0x010f00 | ||
| 45 | 45 | ||
| 46 | 46 | #endif /* !defined(NGHTTP3_VERSION_H) */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2142,7 +2142,7 @@ nghttp3_stream *nghttp3_conn_find_stream(nghttp3_conn *conn, | |||
| 2142 | 2142 | ||
| 2143 | 2143 | int nghttp3_conn_bind_control_stream(nghttp3_conn *conn, int64_t stream_id) { | |
| 2144 | 2144 | nghttp3_stream *stream; | |
| 2145 | - nghttp3_frame_entry frent; | ||
| 2145 | + nghttp3_frame fr; | ||
| 2146 | 2146 | int rv; | |
| 2147 | 2147 | ||
| 2148 | 2148 | assert(stream_id >= 0); | |
@@ -2168,23 +2168,25 @@ int nghttp3_conn_bind_control_stream(nghttp3_conn *conn, int64_t stream_id) { | |||
| 2168 | 2168 | return rv; | |
| 2169 | 2169 | } | |
| 2170 | 2170 | ||
| 2171 | - frent.fr.settings.type = NGHTTP3_FRAME_SETTINGS; | ||
| 2172 | - frent.aux.settings.local_settings = &conn->local.settings; | ||
| 2171 | + fr.settings = (nghttp3_frame_settings){ | ||
| 2172 | + .type = NGHTTP3_FRAME_SETTINGS, | ||
| 2173 | + .local_settings = &conn->local.settings, | ||
| 2174 | + }; | ||
| 2173 | 2175 | ||
| 2174 | - rv = nghttp3_stream_frq_add(stream, &frent); | ||
| 2176 | + rv = nghttp3_stream_frq_add(stream, &fr); | ||
| 2175 | 2177 | if (rv != 0) { | |
| 2176 | 2178 | return rv; | |
| 2177 | 2179 | } | |
| 2178 | 2180 | ||
| 2179 | 2181 | if (conn->local.settings.origin_list) { | |
| 2180 | 2182 | assert(conn->server); | |
| 2181 | 2183 | ||
| 2182 | - frent.fr.origin = (nghttp3_frame_origin){ | ||
| 2184 | + fr.origin = (nghttp3_frame_origin){ | ||
| 2183 | 2185 | .type = NGHTTP3_FRAME_ORIGIN, | |
| 2184 | 2186 | .origin_list = *conn->local.settings.origin_list, | |
| 2185 | 2187 | }; | |
| 2186 | 2188 | ||
| 2187 | - rv = nghttp3_stream_frq_add(stream, &frent); | ||
| 2189 | + rv = nghttp3_stream_frq_add(stream, &fr); | ||
| 2188 | 2190 | if (rv != 0) { | |
| 2189 | 2191 | return rv; | |
| 2190 | 2192 | } | |
@@ -2414,32 +2416,32 @@ static int conn_submit_headers_data(nghttp3_conn *conn, nghttp3_stream *stream, | |||
| 2414 | 2416 | const nghttp3_data_reader *dr) { | |
| 2415 | 2417 | int rv; | |
| 2416 | 2418 | nghttp3_nv *nnva; | |
| 2417 | - nghttp3_frame_entry frent; | ||
| 2419 | + nghttp3_frame fr; | ||
| 2418 | 2420 | ||
| 2419 | 2421 | rv = nghttp3_nva_copy(&nnva, nva, nvlen, conn->mem); | |
| 2420 | 2422 | if (rv != 0) { | |
| 2421 | 2423 | return rv; | |
| 2422 | 2424 | } | |
| 2423 | 2425 | ||
| 2424 | - frent.fr.headers = (nghttp3_frame_headers){ | ||
| 2426 | + fr.headers = (nghttp3_frame_headers){ | ||
| 2425 | 2427 | .type = NGHTTP3_FRAME_HEADERS, | |
| 2426 | 2428 | .nva = nnva, | |
| 2427 | 2429 | .nvlen = nvlen, | |
| 2428 | 2430 | }; | |
| 2429 | 2431 | ||
| 2430 | - rv = nghttp3_stream_frq_add(stream, &frent); | ||
| 2432 | + rv = nghttp3_stream_frq_add(stream, &fr); | ||
| 2431 | 2433 | if (rv != 0) { | |
| 2432 | 2434 | nghttp3_nva_del(nnva, conn->mem); | |
| 2433 | 2435 | return rv; | |
| 2434 | 2436 | } | |
| 2435 | 2437 | ||
| 2436 | 2438 | if (dr) { | |
| 2437 | - frent.fr.data = (nghttp3_frame_data){ | ||
| 2439 | + fr.data = (nghttp3_frame_data){ | ||
| 2438 | 2440 | .type = NGHTTP3_FRAME_DATA, | |
| 2441 | + .dr = *dr, | ||
| 2439 | 2442 | }; | |
| 2440 | - frent.aux.data.dr = *dr; | ||
| 2441 | 2443 | ||
| 2442 | - rv = nghttp3_stream_frq_add(stream, &frent); | ||
| 2444 | + rv = nghttp3_stream_frq_add(stream, &fr); | ||
| 2443 | 2445 | if (rv != 0) { | |
| 2444 | 2446 | return rv; | |
| 2445 | 2447 | } | |
@@ -2493,7 +2495,6 @@ int nghttp3_conn_submit_request(nghttp3_conn *conn, int64_t stream_id, | |||
| 2493 | 2495 | ||
| 2494 | 2496 | assert(!conn->server); | |
| 2495 | 2497 | assert(conn->tx.qenc); | |
| 2496 | - | ||
| 2497 | 2498 | assert(stream_id >= 0); | |
| 2498 | 2499 | assert(stream_id <= (int64_t)NGHTTP3_MAX_VARINT); | |
| 2499 | 2500 | assert(nghttp3_client_stream_bidi(stream_id)); | |
@@ -2515,6 +2516,7 @@ int nghttp3_conn_submit_request(nghttp3_conn *conn, int64_t stream_id, | |||
| 2515 | 2516 | } | |
| 2516 | 2517 | stream->rx.hstate = NGHTTP3_HTTP_STATE_RESP_INITIAL; | |
| 2517 | 2518 | stream->user_data = stream_user_data; | |
| 2519 | + stream->node.pri.inc = 1; | ||
| 2518 | 2520 | ||
| 2519 | 2521 | nghttp3_http_record_request_method(stream, nva, nvlen); | |
| 2520 | 2522 | ||
@@ -2585,51 +2587,51 @@ int nghttp3_conn_submit_trailers(nghttp3_conn *conn, int64_t stream_id, | |||
| 2585 | 2587 | } | |
| 2586 | 2588 | ||
| 2587 | 2589 | int nghttp3_conn_submit_shutdown_notice(nghttp3_conn *conn) { | |
| 2588 | - nghttp3_frame_entry frent; | ||
| 2590 | + nghttp3_frame fr; | ||
| 2589 | 2591 | int rv; | |
| 2590 | 2592 | ||
| 2591 | 2593 | assert(conn->tx.ctrl); | |
| 2592 | 2594 | ||
| 2593 | - frent.fr.goaway = (nghttp3_frame_goaway){ | ||
| 2595 | + fr.goaway = (nghttp3_frame_goaway){ | ||
| 2594 | 2596 | .type = NGHTTP3_FRAME_GOAWAY, | |
| 2595 | 2597 | .id = conn->server ? NGHTTP3_SHUTDOWN_NOTICE_STREAM_ID | |
| 2596 | 2598 | : NGHTTP3_SHUTDOWN_NOTICE_PUSH_ID, | |
| 2597 | 2599 | }; | |
| 2598 | 2600 | ||
| 2599 | - assert(frent.fr.goaway.id <= conn->tx.goaway_id); | ||
| 2601 | + assert(fr.goaway.id <= conn->tx.goaway_id); | ||
| 2600 | 2602 | ||
| 2601 | - rv = nghttp3_stream_frq_add(conn->tx.ctrl, &frent); | ||
| 2603 | + rv = nghttp3_stream_frq_add(conn->tx.ctrl, &fr); | ||
| 2602 | 2604 | if (rv != 0) { | |
| 2603 | 2605 | return rv; | |
| 2604 | 2606 | } | |
| 2605 | 2607 | ||
| 2606 | - conn->tx.goaway_id = frent.fr.goaway.id; | ||
| 2608 | + conn->tx.goaway_id = fr.goaway.id; | ||
| 2607 | 2609 | conn->flags |= NGHTTP3_CONN_FLAG_GOAWAY_QUEUED; | |
| 2608 | 2610 | ||
| 2609 | 2611 | return 0; | |
| 2610 | 2612 | } | |
| 2611 | 2613 | ||
| 2612 | 2614 | int nghttp3_conn_shutdown(nghttp3_conn *conn) { | |
| 2613 | - nghttp3_frame_entry frent; | ||
| 2615 | + nghttp3_frame fr; | ||
| 2614 | 2616 | int rv; | |
| 2615 | 2617 | ||
| 2616 | 2618 | assert(conn->tx.ctrl); | |
| 2617 | 2619 | ||
| 2618 | - frent.fr.goaway = (nghttp3_frame_goaway){ | ||
| 2620 | + fr.goaway = (nghttp3_frame_goaway){ | ||
| 2619 | 2621 | .type = NGHTTP3_FRAME_GOAWAY, | |
| 2620 | 2622 | .id = conn->server ? nghttp3_min_int64((1ll << 62) - 4, | |
| 2621 | 2623 | conn->rx.max_stream_id_bidi + 4) | |
| 2622 | 2624 | : 0, | |
| 2623 | 2625 | }; | |
| 2624 | 2626 | ||
| 2625 | - assert(frent.fr.goaway.id <= conn->tx.goaway_id); | ||
| 2627 | + assert(fr.goaway.id <= conn->tx.goaway_id); | ||
| 2626 | 2628 | ||
| 2627 | - rv = nghttp3_stream_frq_add(conn->tx.ctrl, &frent); | ||
| 2629 | + rv = nghttp3_stream_frq_add(conn->tx.ctrl, &fr); | ||
| 2628 | 2630 | if (rv != 0) { | |
| 2629 | 2631 | return rv; | |
| 2630 | 2632 | } | |
| 2631 | 2633 | ||
| 2632 | - conn->tx.goaway_id = frent.fr.goaway.id; | ||
| 2634 | + conn->tx.goaway_id = fr.goaway.id; | ||
| 2633 | 2635 | conn->flags |= | |
| 2634 | 2636 | NGHTTP3_CONN_FLAG_GOAWAY_QUEUED | NGHTTP3_CONN_FLAG_SHUTDOWN_COMMENCED; | |
| 2635 | 2637 | ||
@@ -2870,7 +2872,7 @@ int nghttp3_conn_set_client_stream_priority(nghttp3_conn *conn, | |||
| 2870 | 2872 | const uint8_t *data, | |
| 2871 | 2873 | size_t datalen) { | |
| 2872 | 2874 | nghttp3_stream *stream; | |
| 2873 | - nghttp3_frame_entry frent; | ||
| 2875 | + nghttp3_frame fr; | ||
| 2874 | 2876 | uint8_t *buf = NULL; | |
| 2875 | 2877 | ||
| 2876 | 2878 | assert(!conn->server); | |
@@ -2895,14 +2897,14 @@ int nghttp3_conn_set_client_stream_priority(nghttp3_conn *conn, | |||
| 2895 | 2897 | memcpy(buf, data, datalen); | |
| 2896 | 2898 | } | |
| 2897 | 2899 | ||
| 2898 | - frent.fr.priority_update = (nghttp3_frame_priority_update){ | ||
| 2900 | + fr.priority_update = (nghttp3_frame_priority_update){ | ||
| 2899 | 2901 | .type = NGHTTP3_FRAME_PRIORITY_UPDATE, | |
| 2900 | 2902 | .pri_elem_id = stream_id, | |
| 2901 | 2903 | .data = buf, | |
| 2902 | 2904 | .datalen = datalen, | |
| 2903 | 2905 | }; | |
| 2904 | 2906 | ||
| 2905 | - return nghttp3_stream_frq_add(conn->tx.ctrl, &frent); | ||
| 2907 | + return nghttp3_stream_frq_add(conn->tx.ctrl, &fr); | ||
| 2906 | 2908 | } | |
| 2907 | 2909 | ||
| 2908 | 2910 | int nghttp3_conn_set_server_stream_priority_versioned(nghttp3_conn *conn, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -60,6 +60,9 @@ typedef struct nghttp3_frame_hd { | |||
| 60 | 60 | ||
| 61 | 61 | typedef struct nghttp3_frame_data { | |
| 62 | 62 | int64_t type; | |
| 63 | + /* dr is set when sending DATA frame. It is not used on | ||
| 64 | + reception. */ | ||
| 65 | + nghttp3_data_reader dr; | ||
| 63 | 66 | } nghttp3_frame_data; | |
| 64 | 67 | ||
| 65 | 68 | typedef struct nghttp3_frame_headers { | |
@@ -88,6 +91,9 @@ typedef struct nghttp3_frame_settings { | |||
| 88 | 91 | int64_t type; | |
| 89 | 92 | size_t niv; | |
| 90 | 93 | nghttp3_settings_entry *iv; | |
| 94 | + /* local_settings is set when sending SETTINGS frame. It is not | ||
| 95 | + used on reception. */ | ||
| 96 | + const nghttp3_settings *local_settings; | ||
| 91 | 97 | } nghttp3_frame_settings; | |
| 92 | 98 | ||
| 93 | 99 | typedef struct nghttp3_frame_goaway { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -59,7 +59,8 @@ static int memieq(const void *a, const void *b, size_t n) { | |||
| 59 | 59 | return 1; | |
| 60 | 60 | } | |
| 61 | 61 | ||
| 62 | - #define lstrieq(A, B, N) ((sizeof((A)) - 1) == (N) && memieq((A), (B), (N))) | ||
| 62 | + #define lstrieq(A, B, N) \ | ||
| 63 | + (nghttp3_strlen_lit((A)) == (N) && memieq((A), (B), (N))) | ||
| 63 | 64 | ||
| 64 | 65 | static int64_t parse_uint(const uint8_t *s, size_t len) { | |
| 65 | 66 | int64_t n = 0; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments