forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnode_quic_default_application.h
61 lines (45 loc) · 1.67 KB
/
node_quic_default_application.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
#ifndef SRC_QUIC_NODE_QUIC_DEFAULT_APPLICATION_H_
#define SRC_QUIC_NODE_QUIC_DEFAULT_APPLICATION_H_
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#include "node_quic_stream.h"
#include "node_quic_session.h"
#include "node_quic_util.h"
#include "util.h"
#include "v8.h"
namespace node {
namespace quic {
// The DefaultApplication is used whenever an unknown/unrecognized
// alpn identifier is used. It switches the QUIC implementation into
// a minimal/generic mode that defers all application level processing
// to the user-code level. Headers are not supported by QuicStream
// instances created under the default application.
class DefaultApplication final : public QuicApplication {
public:
explicit DefaultApplication(QuicSession* session);
bool Initialize() override;
void StopTrackingMemory(void* ptr) override {
// Do nothing. Not used.
}
bool ReceiveStreamData(
uint32_t flags,
int64_t stream_id,
const uint8_t* data,
size_t datalen,
uint64_t offset) override;
int GetStreamData(StreamData* stream_data) override;
void ResumeStream(int64_t stream_id) override;
void StreamClose(int64_t stream_id, uint64_t app_error_code) override;
bool ShouldSetFin(const StreamData& stream_data) override;
bool StreamCommit(StreamData* stream_data, size_t datalen) override;
SET_SELF_SIZE(DefaultApplication)
SET_MEMORY_INFO_NAME(DefaultApplication)
SET_NO_MEMORY_INFO()
private:
void ScheduleStream(int64_t stream_id);
void UnscheduleStream(int64_t stream_id);
QuicStream::Queue stream_queue_;
};
} // namespace quic
} // namespace node
#endif // NODE_WANT_INTERNALS
#endif // SRC_QUIC_NODE_QUIC_DEFAULT_APPLICATION_H_