/src/h2o/deps/quicly/include/quicly/sendstate.h
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2017 Fastly, Kazuho Oku |
3 | | * |
4 | | * Permission is hereby granted, free of charge, to any person obtaining a copy |
5 | | * of this software and associated documentation files (the "Software"), to |
6 | | * deal in the Software without restriction, including without limitation the |
7 | | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
8 | | * sell copies of the Software, and to permit persons to whom the Software is |
9 | | * furnished to do so, subject to the following conditions: |
10 | | * |
11 | | * The above copyright notice and this permission notice shall be included in |
12 | | * all copies or substantial portions of the Software. |
13 | | * |
14 | | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
15 | | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
16 | | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
17 | | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
18 | | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
19 | | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
20 | | * IN THE SOFTWARE. |
21 | | */ |
22 | | #ifndef quicly_sendstate_h |
23 | | #define quicly_sendstate_h |
24 | | |
25 | | #ifdef __cplusplus |
26 | | extern "C" { |
27 | | #endif |
28 | | |
29 | | #include "quicly/ranges.h" |
30 | | |
31 | | typedef struct st_quicly_sendstate_t { |
32 | | /** |
33 | | * ranges that have been acked (guaranteed to be non-empty; i.e., acked.ranges[0].end == contiguous_acked_offset). Offset may |
34 | | * include the EOS position. |
35 | | */ |
36 | | quicly_ranges_t acked; |
37 | | /** |
38 | | * ranges that needs to be sent. Offset may include the EOS position. |
39 | | */ |
40 | | quicly_ranges_t pending; |
41 | | /** |
42 | | * number of bytes that have been inflight (regardless of acked or not). Used for capping max_data, therefore does not include |
43 | | * eos. |
44 | | */ |
45 | | uint64_t size_inflight; |
46 | | /** |
47 | | * UINT64_MAX until closed. Does not include the EOS position. |
48 | | */ |
49 | | uint64_t final_size; |
50 | | } quicly_sendstate_t; |
51 | | |
52 | | typedef struct st_quicly_sendstate_sent_t { |
53 | | uint64_t start; |
54 | | uint64_t end; |
55 | | } quicly_sendstate_sent_t; |
56 | | |
57 | | void quicly_sendstate_init(quicly_sendstate_t *state); |
58 | | void quicly_sendstate_init_closed(quicly_sendstate_t *state); |
59 | | void quicly_sendstate_dispose(quicly_sendstate_t *state); |
60 | | static int quicly_sendstate_transfer_complete(quicly_sendstate_t *state); |
61 | | static int quicly_sendstate_is_open(quicly_sendstate_t *state); |
62 | | int quicly_sendstate_activate(quicly_sendstate_t *state); |
63 | | int quicly_sendstate_shutdown(quicly_sendstate_t *state, uint64_t final_size); |
64 | | void quicly_sendstate_reset(quicly_sendstate_t *state); |
65 | | int quicly_sendstate_acked(quicly_sendstate_t *state, quicly_sendstate_sent_t *args, size_t *bytes_to_shift); |
66 | | int quicly_sendstate_lost(quicly_sendstate_t *state, quicly_sendstate_sent_t *args); |
67 | | |
68 | | /* inline definitions */ |
69 | | |
70 | | inline int quicly_sendstate_transfer_complete(quicly_sendstate_t *state) |
71 | 963 | { |
72 | 963 | return state->final_size != UINT64_MAX && state->acked.ranges[0].end == state->final_size + 1; |
73 | 963 | } Unexecuted instantiation: driver.cc:quicly_sendstate_transfer_complete(st_quicly_sendstate_t*) Unexecuted instantiation: driver_common.cc:quicly_sendstate_transfer_complete(st_quicly_sendstate_t*) Unexecuted instantiation: socket.c:quicly_sendstate_transfer_complete Unexecuted instantiation: config.c:quicly_sendstate_transfer_complete Unexecuted instantiation: configurator.c:quicly_sendstate_transfer_complete Unexecuted instantiation: context.c:quicly_sendstate_transfer_complete Unexecuted instantiation: headers.c:quicly_sendstate_transfer_complete Unexecuted instantiation: request.c:quicly_sendstate_transfer_complete Unexecuted instantiation: util.c:quicly_sendstate_transfer_complete Unexecuted instantiation: access_log.c:quicly_sendstate_transfer_complete Unexecuted instantiation: file.c:quicly_sendstate_transfer_complete Unexecuted instantiation: mimemap.c:quicly_sendstate_transfer_complete Unexecuted instantiation: proxy.c:quicly_sendstate_transfer_complete Unexecuted instantiation: http1.c:quicly_sendstate_transfer_complete Unexecuted instantiation: connection.c:quicly_sendstate_transfer_complete Unexecuted instantiation: scheduler.c:quicly_sendstate_transfer_complete Unexecuted instantiation: stream.c:quicly_sendstate_transfer_complete Unexecuted instantiation: http2_debug_state.c:quicly_sendstate_transfer_complete Unexecuted instantiation: common.c:quicly_sendstate_transfer_complete server.c:quicly_sendstate_transfer_complete Line | Count | Source | 71 | 963 | { | 72 | 963 | return state->final_size != UINT64_MAX && state->acked.ranges[0].end == state->final_size + 1; | 73 | 963 | } |
Unexecuted instantiation: defaults.c:quicly_sendstate_transfer_complete Unexecuted instantiation: quicly.c:quicly_sendstate_transfer_complete Unexecuted instantiation: sendstate.c:quicly_sendstate_transfer_complete Unexecuted instantiation: sentmap.c:quicly_sendstate_transfer_complete Unexecuted instantiation: streambuf.c:quicly_sendstate_transfer_complete Unexecuted instantiation: http3client.c:quicly_sendstate_transfer_complete Unexecuted instantiation: httpclient.c:quicly_sendstate_transfer_complete Unexecuted instantiation: absprio.c:quicly_sendstate_transfer_complete Unexecuted instantiation: logconf.c:quicly_sendstate_transfer_complete Unexecuted instantiation: compress.c:quicly_sendstate_transfer_complete Unexecuted instantiation: gzip.c:quicly_sendstate_transfer_complete Unexecuted instantiation: headers_util.c:quicly_sendstate_transfer_complete Unexecuted instantiation: frame.c:quicly_sendstate_transfer_complete Unexecuted instantiation: qpack.c:quicly_sendstate_transfer_complete Unexecuted instantiation: cc-reno.c:quicly_sendstate_transfer_complete Unexecuted instantiation: loss.c:quicly_sendstate_transfer_complete Unexecuted instantiation: http1client.c:quicly_sendstate_transfer_complete Unexecuted instantiation: http2client.c:quicly_sendstate_transfer_complete Unexecuted instantiation: cc-cubic.c:quicly_sendstate_transfer_complete Unexecuted instantiation: cc-pico.c:quicly_sendstate_transfer_complete Unexecuted instantiation: driver_url.cc:quicly_sendstate_transfer_complete(st_quicly_sendstate_t*) Unexecuted instantiation: driver_h3.cc:quicly_sendstate_transfer_complete(st_quicly_sendstate_t*) Unexecuted instantiation: quicly_mock.c:quicly_sendstate_transfer_complete Unexecuted instantiation: errordoc.c:quicly_sendstate_transfer_complete Unexecuted instantiation: expires.c:quicly_sendstate_transfer_complete Unexecuted instantiation: fastcgi.c:quicly_sendstate_transfer_complete Unexecuted instantiation: connect.c:quicly_sendstate_transfer_complete Unexecuted instantiation: redirect.c:quicly_sendstate_transfer_complete Unexecuted instantiation: reproxy.c:quicly_sendstate_transfer_complete Unexecuted instantiation: throttle_resp.c:quicly_sendstate_transfer_complete Unexecuted instantiation: self_trace.c:quicly_sendstate_transfer_complete Unexecuted instantiation: server_timing.c:quicly_sendstate_transfer_complete Unexecuted instantiation: status.c:quicly_sendstate_transfer_complete Unexecuted instantiation: events.c:quicly_sendstate_transfer_complete Unexecuted instantiation: memory.c:quicly_sendstate_transfer_complete Unexecuted instantiation: requests.c:quicly_sendstate_transfer_complete Unexecuted instantiation: ssl.c:quicly_sendstate_transfer_complete Unexecuted instantiation: durations.c:quicly_sendstate_transfer_complete Unexecuted instantiation: brotli.c:quicly_sendstate_transfer_complete |
74 | | |
75 | | inline int quicly_sendstate_is_open(quicly_sendstate_t *state) |
76 | 68.2k | { |
77 | 68.2k | return state->final_size == UINT64_MAX; |
78 | 68.2k | } Unexecuted instantiation: driver.cc:quicly_sendstate_is_open(st_quicly_sendstate_t*) Unexecuted instantiation: driver_common.cc:quicly_sendstate_is_open(st_quicly_sendstate_t*) Unexecuted instantiation: socket.c:quicly_sendstate_is_open Unexecuted instantiation: config.c:quicly_sendstate_is_open Unexecuted instantiation: configurator.c:quicly_sendstate_is_open Unexecuted instantiation: context.c:quicly_sendstate_is_open Unexecuted instantiation: headers.c:quicly_sendstate_is_open Unexecuted instantiation: request.c:quicly_sendstate_is_open Unexecuted instantiation: util.c:quicly_sendstate_is_open Unexecuted instantiation: access_log.c:quicly_sendstate_is_open Unexecuted instantiation: file.c:quicly_sendstate_is_open Unexecuted instantiation: mimemap.c:quicly_sendstate_is_open Unexecuted instantiation: proxy.c:quicly_sendstate_is_open Unexecuted instantiation: http1.c:quicly_sendstate_is_open Unexecuted instantiation: connection.c:quicly_sendstate_is_open Unexecuted instantiation: scheduler.c:quicly_sendstate_is_open Unexecuted instantiation: stream.c:quicly_sendstate_is_open Unexecuted instantiation: http2_debug_state.c:quicly_sendstate_is_open Unexecuted instantiation: common.c:quicly_sendstate_is_open server.c:quicly_sendstate_is_open Line | Count | Source | 76 | 2.87k | { | 77 | 2.87k | return state->final_size == UINT64_MAX; | 78 | 2.87k | } |
Unexecuted instantiation: defaults.c:quicly_sendstate_is_open Unexecuted instantiation: quicly.c:quicly_sendstate_is_open sendstate.c:quicly_sendstate_is_open Line | Count | Source | 76 | 1.86k | { | 77 | 1.86k | return state->final_size == UINT64_MAX; | 78 | 1.86k | } |
Unexecuted instantiation: sentmap.c:quicly_sendstate_is_open Unexecuted instantiation: streambuf.c:quicly_sendstate_is_open Unexecuted instantiation: http3client.c:quicly_sendstate_is_open Unexecuted instantiation: httpclient.c:quicly_sendstate_is_open Unexecuted instantiation: absprio.c:quicly_sendstate_is_open Unexecuted instantiation: logconf.c:quicly_sendstate_is_open Unexecuted instantiation: compress.c:quicly_sendstate_is_open Unexecuted instantiation: gzip.c:quicly_sendstate_is_open Unexecuted instantiation: headers_util.c:quicly_sendstate_is_open Unexecuted instantiation: frame.c:quicly_sendstate_is_open Unexecuted instantiation: qpack.c:quicly_sendstate_is_open Unexecuted instantiation: cc-reno.c:quicly_sendstate_is_open Unexecuted instantiation: loss.c:quicly_sendstate_is_open Unexecuted instantiation: http1client.c:quicly_sendstate_is_open Unexecuted instantiation: http2client.c:quicly_sendstate_is_open Unexecuted instantiation: cc-cubic.c:quicly_sendstate_is_open Unexecuted instantiation: cc-pico.c:quicly_sendstate_is_open Unexecuted instantiation: driver_url.cc:quicly_sendstate_is_open(st_quicly_sendstate_t*) Unexecuted instantiation: driver_h3.cc:quicly_sendstate_is_open(st_quicly_sendstate_t*) quicly_mock.c:quicly_sendstate_is_open Line | Count | Source | 76 | 63.5k | { | 77 | 63.5k | return state->final_size == UINT64_MAX; | 78 | 63.5k | } |
Unexecuted instantiation: errordoc.c:quicly_sendstate_is_open Unexecuted instantiation: expires.c:quicly_sendstate_is_open Unexecuted instantiation: fastcgi.c:quicly_sendstate_is_open Unexecuted instantiation: connect.c:quicly_sendstate_is_open Unexecuted instantiation: redirect.c:quicly_sendstate_is_open Unexecuted instantiation: reproxy.c:quicly_sendstate_is_open Unexecuted instantiation: throttle_resp.c:quicly_sendstate_is_open Unexecuted instantiation: self_trace.c:quicly_sendstate_is_open Unexecuted instantiation: server_timing.c:quicly_sendstate_is_open Unexecuted instantiation: status.c:quicly_sendstate_is_open Unexecuted instantiation: events.c:quicly_sendstate_is_open Unexecuted instantiation: memory.c:quicly_sendstate_is_open Unexecuted instantiation: requests.c:quicly_sendstate_is_open Unexecuted instantiation: ssl.c:quicly_sendstate_is_open Unexecuted instantiation: durations.c:quicly_sendstate_is_open Unexecuted instantiation: brotli.c:quicly_sendstate_is_open |
79 | | |
80 | | #ifdef __cplusplus |
81 | | } |
82 | | #endif |
83 | | |
84 | | #endif |