Skip to content

Commit 0f764fb

Browse files
committed
Fix missed autoformatting
1 parent 4d58a37 commit 0f764fb

4 files changed

Lines changed: 39 additions & 56 deletions

File tree

src/quic/application.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,8 @@ struct ApplicationFactory {
199199
// exists. Returns the parsed data for the ApplySessionTicketData()
200200
// call at install time, or nullptr to reject the ticket (0-RTT is
201201
// abandoned and the handshake falls back to a full 1-RTT exchange).
202-
PendingTicketAppData (*parse_ticket)(const uv_buf_t& data,
203-
const Session::Options& options) =
204-
nullptr;
202+
PendingTicketAppData (*parse_ticket)(
203+
const uv_buf_t& data, const Session::Options& options) = nullptr;
205204
};
206205
void RegisterApplicationFactory(std::string_view name,
207206
const ApplicationFactory& factory);

src/quic/bindingdata.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
#include <nghttp3/nghttp3.h>
88
#include <ngtcp2/ngtcp2.h>
99
#include <node.h>
10-
#include "http3.h"
1110
#include <node_errors.h>
1211
#include <node_external_reference.h>
1312
#include <node_mem-inl.h>
1413
#include <node_realm-inl.h>
1514
#include <node_sockaddr-inl.h>
1615
#include <v8.h>
1716
#include "bindingdata.h"
17+
#include "http3.h"
1818
#include "session.h"
1919
#include "session_manager.h"
2020

@@ -394,14 +394,12 @@ Local<DictionaryTemplate> BindingData::transport_params_template() const {
394394
transport_params_template_);
395395
}
396396

397-
void BindingData::set_http3_settings_template(
398-
Local<DictionaryTemplate> tmpl) {
397+
void BindingData::set_http3_settings_template(Local<DictionaryTemplate> tmpl) {
399398
http3_settings_template_.Reset(env()->isolate(), tmpl);
400399
}
401400

402401
Local<DictionaryTemplate> BindingData::http3_settings_template() const {
403-
return PersistentToLocal::Default(env()->isolate(),
404-
http3_settings_template_);
402+
return PersistentToLocal::Default(env()->isolate(), http3_settings_template_);
405403
}
406404

407405
#define V(name, _) \

src/quic/http3.cc

Lines changed: 26 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,7 @@ std::string Http3Settings::ToString() const {
210210
return res;
211211
}
212212

213-
Maybe<Http3Settings> Http3Settings::From(Environment* env,
214-
Local<Value> value) {
213+
Maybe<Http3Settings> Http3Settings::From(Environment* env, Local<Value> value) {
215214
if (value.IsEmpty() || !value->IsObject()) [[unlikely]] {
216215
THROW_ERR_INVALID_ARG_TYPE(env, "settings must be an object");
217216
return Nothing<Http3Settings>();
@@ -249,15 +248,13 @@ Maybe<Http3Settings> Http3Settings::From(Environment* env,
249248
MaybeLocal<Object> Http3Settings::ToObject(Environment* env) const {
250249
auto& binding_data = BindingData::Get(env);
251250
auto tmpl = binding_data.http3_settings_template();
252-
static constexpr std::string_view names[] = {
253-
"maxHeaderPairs",
254-
"maxHeaderLength",
255-
"maxFieldSectionSize",
256-
"qpackMaxDtableCapacity",
257-
"qpackEncoderMaxDtableCapacity",
258-
"qpackBlockedStreams",
259-
"enableConnectProtocol"
260-
};
251+
static constexpr std::string_view names[] = {"maxHeaderPairs",
252+
"maxHeaderLength",
253+
"maxFieldSectionSize",
254+
"qpackMaxDtableCapacity",
255+
"qpackEncoderMaxDtableCapacity",
256+
"qpackBlockedStreams",
257+
"enableConnectProtocol"};
261258
if (tmpl.IsEmpty()) {
262259
tmpl = DictionaryTemplate::New(env->isolate(), names);
263260
binding_data.set_http3_settings_template(tmpl);
@@ -414,9 +411,8 @@ class Http3Application final : public Session::Application {
414411
Session& s = session();
415412
if (s.is_destroyed() || !s.env()->can_call_into_js()) return;
416413
CallbackScope<Session> cb_scope(&s);
417-
s.MakeCallback(BindingData::Get(s.env()).session_application_callback(),
418-
0,
419-
nullptr);
414+
s.MakeCallback(
415+
BindingData::Get(s.env()).session_application_callback(), 0, nullptr);
420416
});
421417
}
422418

@@ -874,12 +870,12 @@ class Http3Application final : public Session::Application {
874870
ssize_t ret = 0;
875871
Debug(&session(), "HTTP/3 application getting stream data");
876872
if (conn_ && session().max_data_left()) {
877-
ret = nghttp3_conn_writev_stream(
878-
*this,
879-
&data->id,
880-
&data->fin,
881-
reinterpret_cast<nghttp3_vec*>(data->data),
882-
data->count);
873+
ret =
874+
nghttp3_conn_writev_stream(*this,
875+
&data->id,
876+
&data->fin,
877+
reinterpret_cast<nghttp3_vec*>(data->data),
878+
data->count);
883879
// A negative return value indicates an error.
884880
if (ret < 0) {
885881
return static_cast<int>(ret);
@@ -1151,10 +1147,9 @@ class Http3Application final : public Session::Application {
11511147
hs.headers.clear();
11521148
hs.headers_length = 0;
11531149

1154-
Local<Value> argv[] = {
1155-
Array::New(env()->isolate(), values.data(), count),
1156-
Integer::NewFromUnsigned(env()->isolate(),
1157-
static_cast<uint32_t>(kind))};
1150+
Local<Value> argv[] = {Array::New(env()->isolate(), values.data(), count),
1151+
Integer::NewFromUnsigned(
1152+
env()->isolate(), static_cast<uint32_t>(kind))};
11581153

11591154
stream->MakeCallback(
11601155
binding.stream_headers_callback(), arraysize(argv), argv);
@@ -1722,8 +1717,8 @@ JS_METHOD_IMPL(Http3Binding::SendHeaders) {
17221717
// A pending stream has no id yet; defer the submission until the transport
17231718
// opens it (the priority header, if any, rides along in this header block).
17241719
if (stream->is_pending()) {
1725-
auto held = std::make_shared<Global<Array>>(binding->env()->isolate(),
1726-
headers);
1720+
auto held =
1721+
std::make_shared<Global<Array>>(binding->env()->isolate(), headers);
17271722
stream->RunWhenOpen([stream, flags, held]() {
17281723
Session& session = stream->session();
17291724
if (!session.has_application()) return;
@@ -1807,9 +1802,8 @@ JS_METHOD_IMPL(Http3Binding::GetPriority) {
18071802
if (!session.has_application() || stream->is_pending()) return;
18081803

18091804
auto result = Http3App(session).GetStreamPriority(*stream);
1810-
uint32_t packed =
1811-
(static_cast<uint32_t>(result.priority) << 1) |
1812-
(result.flags == StreamPriorityFlags::INCREMENTAL ? 1 : 0);
1805+
uint32_t packed = (static_cast<uint32_t>(result.priority) << 1) |
1806+
(result.flags == StreamPriorityFlags::INCREMENTAL ? 1 : 0);
18131807
args.GetReturnValue().Set(packed);
18141808
}
18151809

@@ -1836,9 +1830,8 @@ void CreateHttp3Handle(const FunctionCallbackInfo<Value>& args) {
18361830
if (session->is_server() && !session->application().Start()) {
18371831
// Start() failed (e.g. the peer's initial_max_streams_uni is < 3), so
18381832
// the application cannot run HTTP/3.
1839-
THROW_ERR_INVALID_STATE(
1840-
session->env(),
1841-
"The HTTP/3 application could not be started");
1833+
THROW_ERR_INVALID_STATE(session->env(),
1834+
"The HTTP/3 application could not be started");
18421835
return;
18431836
}
18441837
}
@@ -1888,8 +1881,7 @@ Http3Settings ResolveHttp3Settings(const Session::Options& options) {
18881881
std::unique_ptr<Session::Application> CreateHttp3Application(Session* session) {
18891882
Debug(session, "Installing HTTP/3 application");
18901883
return std::make_unique<Http3Application>(
1891-
session,
1892-
ResolveHttp3Settings(std::as_const(*session).config().options));
1884+
session, ResolveHttp3Settings(std::as_const(*session).config().options));
18931885
}
18941886

18951887
Maybe<std::shared_ptr<void>> ParseHttp3Settings(Environment* env,

src/quic/session.cc

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -612,8 +612,7 @@ Maybe<Session::Options> Session::Options::From(Environment* env,
612612

613613
if (!SET(version) || !SET(min_version) || !SET(preferred_address_strategy) ||
614614
!SET(transport_params) || !SET(tls_options) || !SET(qlog) ||
615-
!SET(application) ||
616-
!SET(handshake_timeout) || !SET(initial_rtt) ||
615+
!SET(application) || !SET(handshake_timeout) || !SET(initial_rtt) ||
617616
!SET(keep_alive_timeout) || !SET(max_stream_window) || !SET(max_window) ||
618617
!SET(max_payload_size) || !SET(unacknowledged_packet_threshold) ||
619618
!SET(cc_algorithm) || !SET(draining_period_multiplier) ||
@@ -1612,10 +1611,9 @@ struct Session::Impl final : public MemoryRetainer {
16121611
NGTCP2_CALLBACK_SCOPE(session)
16131612
auto* stream = Stream::From(stream_user_data);
16141613
if (stream == nullptr) return NGTCP2_SUCCESS;
1615-
QuicError error =
1616-
(flags & NGTCP2_STREAM_CLOSE_FLAG_APP_ERROR_CODE_SET)
1617-
? QuicError::ForApplication(app_error_code)
1618-
: QuicError();
1614+
QuicError error = (flags & NGTCP2_STREAM_CLOSE_FLAG_APP_ERROR_CODE_SET)
1615+
? QuicError::ForApplication(app_error_code)
1616+
: QuicError();
16191617
if (session->impl_->application_) {
16201618
session->application().ReceiveStreamClose(stream, std::move(error));
16211619
} else {
@@ -2842,8 +2840,7 @@ bool Session::can_send_pending_data() const {
28422840
// before the application is installed: the application owns stream
28432841
// scheduling from its first flight. With no application requested the
28442842
// native path is always ready.
2845-
return impl_->application_ != nullptr ||
2846-
config().options.application.empty();
2843+
return impl_->application_ != nullptr || config().options.application.empty();
28472844
}
28482845

28492846
bool Session::stream_fin_managed_by_application() const {
@@ -2867,8 +2864,7 @@ std::unique_ptr<Session::Application> Session::SelectApplication() {
28672864
bool Session::AttachApplication(std::unique_ptr<Application> app) {
28682865
if (config().options.app_ticket_data.has_value()) {
28692866
THROW_ERR_INVALID_STATE(
2870-
env(),
2871-
"A QUIC application cannot be combined with appTicketData");
2867+
env(), "A QUIC application cannot be combined with appTicketData");
28722868
return false;
28732869
}
28742870
SetApplication(std::move(app));
@@ -4348,9 +4344,8 @@ void Session::EmitDatagram(Store&& datagram, DatagramReceivedFlags flag) {
43484344

43494345
if (must_defer_emits()) {
43504346
auto held = std::make_shared<Store>(std::move(datagram));
4351-
impl_->deferred_emits_.emplace_back([this, held, flag]() {
4352-
EmitDatagram(std::move(*held), flag);
4353-
});
4347+
impl_->deferred_emits_.emplace_back(
4348+
[this, held, flag]() { EmitDatagram(std::move(*held), flag); });
43544349
return;
43554350
}
43564351

@@ -4526,7 +4521,6 @@ void Session::EmitSessionTicket(Store&& ticket) {
45264521
}
45274522
}
45284523

4529-
45304524
void Session::DestroyAllStreams(const QuicError& error) {
45314525
DCHECK(!is_destroyed());
45324526
// Copy the streams map since streams remove themselves during

0 commit comments

Comments
 (0)