@fails-components/webtransport-transport-http3-quiche 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CMakeLists.txt +978 -0
- package/LICENSE +39 -0
- package/LICENSE.chromium +27 -0
- package/LICENSE.envoy +207 -0
- package/build.js +315 -0
- package/lib/clientsocket.js +80 -0
- package/lib/index.js +47 -0
- package/lib/serversocket.js +80 -0
- package/lib/socket.js +118 -0
- package/lib/types.ts +15 -0
- package/lib/utils.js +12 -0
- package/package.json +68 -0
- package/platform/icufix/fakedata.cpp +8 -0
- package/platform/quiche/quic/core/io/socket_win.inc +3 -0
- package/platform/quiche_platform_impl/quiche_bug_tracker_impl.h +7 -0
- package/platform/quiche_platform_impl/quiche_client_stats_impl.h +7 -0
- package/platform/quiche_platform_impl/quiche_command_line_flags_impl.h +7 -0
- package/platform/quiche_platform_impl/quiche_containers_impl.h +7 -0
- package/platform/quiche_platform_impl/quiche_event_loop_impl.h +7 -0
- package/platform/quiche_platform_impl/quiche_export_impl.h +6 -0
- package/platform/quiche_platform_impl/quiche_flag_utils_impl.h +11 -0
- package/platform/quiche_platform_impl/quiche_flags_impl.h +8 -0
- package/platform/quiche_platform_impl/quiche_googleurl_impl.h +8 -0
- package/platform/quiche_platform_impl/quiche_iovec_impl.h +10 -0
- package/platform/quiche_platform_impl/quiche_logging_impl.h +21 -0
- package/platform/quiche_platform_impl/quiche_mem_slice_impl.h +2 -0
- package/platform/quiche_platform_impl/quiche_mutex_impl.h +8 -0
- package/platform/quiche_platform_impl/quiche_prefetch_impl.h +11 -0
- package/platform/quiche_platform_impl/quiche_reference_counted_impl.h +16 -0
- package/platform/quiche_platform_impl/quiche_server_stats_impl.h +7 -0
- package/platform/quiche_platform_impl/quiche_stack_trace_impl.h +12 -0
- package/platform/quiche_platform_impl/quiche_stream_buffer_allocator_impl.h +8 -0
- package/platform/quiche_platform_impl/quiche_testvalue_impl.h +1 -0
- package/platform/quiche_platform_impl/quiche_thread_local_impl.h +6 -0
- package/platform/quiche_platform_impl/quiche_time_utils_impl.h +13 -0
- package/platform/quiche_platform_impl/quiche_udp_socket_platform_impl.h +39 -0
- package/readme.md +20 -0
- package/src/http3backendresponse.cc +36 -0
- package/src/http3backendresponse.h +109 -0
- package/src/http3client.cc +1402 -0
- package/src/http3client.h +531 -0
- package/src/http3clientsession.cc +65 -0
- package/src/http3clientsession.h +58 -0
- package/src/http3clientstream.cc +52 -0
- package/src/http3clientstream.h +42 -0
- package/src/http3dispatcher.cc +62 -0
- package/src/http3dispatcher.h +57 -0
- package/src/http3server.cc +529 -0
- package/src/http3server.h +149 -0
- package/src/http3serverbackend.cc +104 -0
- package/src/http3serverbackend.h +96 -0
- package/src/http3serversession.cc +123 -0
- package/src/http3serversession.h +95 -0
- package/src/http3serverstream.cc +463 -0
- package/src/http3serverstream.h +114 -0
- package/src/http3sessioncache.cc +85 -0
- package/src/http3sessioncache.h +59 -0
- package/src/http3wtsessionvisitor.cc +312 -0
- package/src/http3wtsessionvisitor.h +257 -0
- package/src/http3wtstreamvisitor.cc +286 -0
- package/src/http3wtstreamvisitor.h +323 -0
- package/src/librarymain.cc +86 -0
- package/src/librarymain.h +42 -0
- package/src/napialarmfactory.cc +51 -0
- package/src/napialarmfactory.h +165 -0
- package/src/socketjswriter.cc +46 -0
- package/src/socketjswriter.h +100 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// modifications
|
|
2
|
+
// Copyright (c) 2022 Marten Richter or other contributers (see commit). All rights reserved.
|
|
3
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
4
|
+
// found in the LICENSE file.
|
|
5
|
+
|
|
6
|
+
// original copyright, see LICENSE.chromium
|
|
7
|
+
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
|
8
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
9
|
+
// found in the LICENSE file.
|
|
10
|
+
|
|
11
|
+
#include "src/http3backendresponse.h"
|
|
12
|
+
|
|
13
|
+
namespace quic
|
|
14
|
+
{
|
|
15
|
+
|
|
16
|
+
Http3BackendResponse::ServerPushInfo::ServerPushInfo(
|
|
17
|
+
std::string request_url,
|
|
18
|
+
spdy::Http2HeaderBlock headers,
|
|
19
|
+
spdy::SpdyPriority priority,
|
|
20
|
+
std::string body)
|
|
21
|
+
: request_url(request_url),
|
|
22
|
+
headers(std::move(headers)),
|
|
23
|
+
priority(priority),
|
|
24
|
+
body(body) {}
|
|
25
|
+
|
|
26
|
+
Http3BackendResponse::ServerPushInfo::ServerPushInfo(const ServerPushInfo &other)
|
|
27
|
+
: request_url(other.request_url),
|
|
28
|
+
headers(other.headers.Clone()),
|
|
29
|
+
priority(other.priority),
|
|
30
|
+
body(other.body) {}
|
|
31
|
+
|
|
32
|
+
Http3BackendResponse::Http3BackendResponse() : response_type_(REGULAR_RESPONSE) {}
|
|
33
|
+
|
|
34
|
+
Http3BackendResponse::~Http3BackendResponse() = default;
|
|
35
|
+
|
|
36
|
+
} // namespace quic
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// modifications
|
|
2
|
+
// Copyright (c) 2022 Marten Richter or other contributers (see commit). All rights reserved.
|
|
3
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
4
|
+
// found in the LICENSE file.
|
|
5
|
+
|
|
6
|
+
// original copyright, see LICENSE.chromium
|
|
7
|
+
// Copyright 2017 The Chromium Authors. All rights reserved.
|
|
8
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
9
|
+
// found in the LICENSE file.
|
|
10
|
+
|
|
11
|
+
#ifndef HTTPS_BACKEND_RESPONSE_H_
|
|
12
|
+
#define HTTPS_BACKEND_RESPONSE_H_
|
|
13
|
+
|
|
14
|
+
#include <memory>
|
|
15
|
+
|
|
16
|
+
#include "absl/strings/string_view.h"
|
|
17
|
+
#include "quiche/spdy/core/spdy_protocol.h"
|
|
18
|
+
|
|
19
|
+
namespace quic
|
|
20
|
+
{
|
|
21
|
+
|
|
22
|
+
// Container for HTTP response header/body pairs
|
|
23
|
+
// fetched by the QuicSimpleServerBackend
|
|
24
|
+
class Http3BackendResponse
|
|
25
|
+
{
|
|
26
|
+
public:
|
|
27
|
+
// A ServerPushInfo contains path of the push request and everything needed in
|
|
28
|
+
// comprising a response for the push request.
|
|
29
|
+
// TODO(b/171463363): Remove.
|
|
30
|
+
struct ServerPushInfo
|
|
31
|
+
{
|
|
32
|
+
ServerPushInfo(std::string request_url,
|
|
33
|
+
spdy::Http2HeaderBlock headers,
|
|
34
|
+
spdy::SpdyPriority priority,
|
|
35
|
+
std::string body);
|
|
36
|
+
ServerPushInfo(const ServerPushInfo &other);
|
|
37
|
+
|
|
38
|
+
std::string request_url;
|
|
39
|
+
spdy::Http2HeaderBlock headers;
|
|
40
|
+
spdy::SpdyPriority priority;
|
|
41
|
+
std::string body;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
enum SpecialResponseType
|
|
45
|
+
{
|
|
46
|
+
REGULAR_RESPONSE, // Send the headers and body like a server should.
|
|
47
|
+
CLOSE_CONNECTION, // Close the connection (sending the close packet).
|
|
48
|
+
IGNORE_REQUEST, // Do nothing, expect the client to time out.
|
|
49
|
+
BACKEND_ERR_RESPONSE, // There was an error fetching the response from
|
|
50
|
+
// the backend, for example as a TCP connection
|
|
51
|
+
// error.
|
|
52
|
+
INCOMPLETE_RESPONSE, // The server will act as if there is a non-empty
|
|
53
|
+
// trailer but it will not be sent, as a result, FIN
|
|
54
|
+
// will not be sent too.
|
|
55
|
+
GENERATE_BYTES // Sends a response with a length equal to the number
|
|
56
|
+
// of bytes in the URL path.
|
|
57
|
+
};
|
|
58
|
+
Http3BackendResponse();
|
|
59
|
+
|
|
60
|
+
Http3BackendResponse(const Http3BackendResponse &other) = delete;
|
|
61
|
+
Http3BackendResponse &operator=(const Http3BackendResponse &other) = delete;
|
|
62
|
+
|
|
63
|
+
~Http3BackendResponse();
|
|
64
|
+
|
|
65
|
+
const std::vector<spdy::Http2HeaderBlock> &early_hints() const
|
|
66
|
+
{
|
|
67
|
+
return early_hints_;
|
|
68
|
+
}
|
|
69
|
+
SpecialResponseType response_type() const { return response_type_; }
|
|
70
|
+
const spdy::Http2HeaderBlock &headers() const { return headers_; }
|
|
71
|
+
const spdy::Http2HeaderBlock &trailers() const { return trailers_; }
|
|
72
|
+
const absl::string_view body() const { return absl::string_view(body_); }
|
|
73
|
+
|
|
74
|
+
void AddEarlyHints(const spdy::Http2HeaderBlock &headers)
|
|
75
|
+
{
|
|
76
|
+
spdy::Http2HeaderBlock hints = headers.Clone();
|
|
77
|
+
hints[":status"] = "103";
|
|
78
|
+
early_hints_.push_back(std::move(hints));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
void set_response_type(SpecialResponseType response_type)
|
|
82
|
+
{
|
|
83
|
+
response_type_ = response_type;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
void set_headers(spdy::Http2HeaderBlock headers)
|
|
87
|
+
{
|
|
88
|
+
headers_ = std::move(headers);
|
|
89
|
+
}
|
|
90
|
+
void set_trailers(spdy::Http2HeaderBlock trailers)
|
|
91
|
+
{
|
|
92
|
+
trailers_ = std::move(trailers);
|
|
93
|
+
}
|
|
94
|
+
void set_body(absl::string_view body)
|
|
95
|
+
{
|
|
96
|
+
body_.assign(body.data(), body.size());
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
private:
|
|
100
|
+
std::vector<spdy::Http2HeaderBlock> early_hints_;
|
|
101
|
+
SpecialResponseType response_type_;
|
|
102
|
+
spdy::Http2HeaderBlock headers_;
|
|
103
|
+
spdy::Http2HeaderBlock trailers_;
|
|
104
|
+
std::string body_;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
} // namespace quic
|
|
108
|
+
|
|
109
|
+
#endif // QUICHE_QUIC_TOOLS_QUIC_BACKEND_RESPONSE_H_
|