forked from microsoft/msquic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsend_buffer.h
89 lines (75 loc) · 1.89 KB
/
send_buffer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*++
Copyright (c) Microsoft Corporation.
Licensed under the MIT License.
--*/
typedef struct QUIC_SEND_BUFFER {
//
// Sum of bytes over all send requests (both buffered
// and unbuffered requests). This is a useful diagnostic
// counter for cases when throughput is starved by an
// app that is sending too slowly.
//
uint64_t PostedBytes;
//
// Sum of bytes in buffered requests. This is tracked so that
// IdealBytes can be used as a soft limit on buffering.
//
uint64_t BufferedBytes;
//
// The number of bytes that need to be available in the send
// buffer to avoid limiting throughput.
//
uint64_t IdealBytes;
} QUIC_SEND_BUFFER;
_IRQL_requires_max_(DISPATCH_LEVEL)
void
QuicSendBufferInitialize(
_Inout_ QUIC_SEND_BUFFER* SendBuffer
);
_IRQL_requires_max_(DISPATCH_LEVEL)
void
QuicSendBufferUninitialize(
_In_ QUIC_SEND_BUFFER* SendBuffer
);
_IRQL_requires_max_(DISPATCH_LEVEL)
_Success_(return != NULL)
uint8_t*
QuicSendBufferAlloc(
_Inout_ QUIC_SEND_BUFFER* SendBuffer,
_In_ uint32_t Size
);
//
// Caller must pass the same size that was passed to QuicSendBufferAlloc.
//
_IRQL_requires_max_(DISPATCH_LEVEL)
void
QuicSendBufferFree(
_Inout_ QUIC_SEND_BUFFER* SendBuffer,
_In_ uint8_t* Buf,
_In_ uint32_t Size
);
//
// Buffers pending send requests until the send buffer is full.
// Should be called when the send buffer is adjusted or bytes are ACKed.
//
_IRQL_requires_max_(PASSIVE_LEVEL)
void
QuicSendBufferFill(
_In_ QUIC_CONNECTION* Connection
);
//
// Indicates an ISB update to the stream.
//
_IRQL_requires_max_(PASSIVE_LEVEL)
void
QuicSendBufferStreamAdjust(
_In_ QUIC_STREAM* Stream
);
//
// Updates IdealBytes upon change of BytesInFlightMax.
//
_IRQL_requires_max_(PASSIVE_LEVEL)
void
QuicSendBufferConnectionAdjust(
_In_ QUIC_CONNECTION* Connection
);