src: Remove extra braces if possible
This commit is contained in:
parent
ec5729b1fa
commit
d105619bc3
|
@ -224,10 +224,10 @@ void test_peek_memchunks_append(void) {
|
||||||
MemchunkPool16 pool;
|
MemchunkPool16 pool;
|
||||||
PeekMemchunks16 pchunks(&pool);
|
PeekMemchunks16 pchunks(&pool);
|
||||||
|
|
||||||
std::array<uint8_t, 32> b{{
|
std::array<uint8_t, 32> b{
|
||||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
|
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
|
||||||
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1',
|
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1',
|
||||||
}},
|
},
|
||||||
d;
|
d;
|
||||||
|
|
||||||
pchunks.append(b.data(), b.size());
|
pchunks.append(b.data(), b.size());
|
||||||
|
@ -259,10 +259,10 @@ void test_peek_memchunks_disable_peek_drain(void) {
|
||||||
MemchunkPool16 pool;
|
MemchunkPool16 pool;
|
||||||
PeekMemchunks16 pchunks(&pool);
|
PeekMemchunks16 pchunks(&pool);
|
||||||
|
|
||||||
std::array<uint8_t, 32> b{{
|
std::array<uint8_t, 32> b{
|
||||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
|
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
|
||||||
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1',
|
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1',
|
||||||
}},
|
},
|
||||||
d;
|
d;
|
||||||
|
|
||||||
pchunks.append(b.data(), b.size());
|
pchunks.append(b.data(), b.size());
|
||||||
|
@ -287,10 +287,10 @@ void test_peek_memchunks_disable_peek_no_drain(void) {
|
||||||
MemchunkPool16 pool;
|
MemchunkPool16 pool;
|
||||||
PeekMemchunks16 pchunks(&pool);
|
PeekMemchunks16 pchunks(&pool);
|
||||||
|
|
||||||
std::array<uint8_t, 32> b{{
|
std::array<uint8_t, 32> b{
|
||||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
|
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
|
||||||
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1',
|
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1',
|
||||||
}},
|
},
|
||||||
d;
|
d;
|
||||||
|
|
||||||
pchunks.append(b.data(), b.size());
|
pchunks.append(b.data(), b.size());
|
||||||
|
@ -315,10 +315,10 @@ void test_peek_memchunks_reset(void) {
|
||||||
MemchunkPool16 pool;
|
MemchunkPool16 pool;
|
||||||
PeekMemchunks16 pchunks(&pool);
|
PeekMemchunks16 pchunks(&pool);
|
||||||
|
|
||||||
std::array<uint8_t, 32> b{{
|
std::array<uint8_t, 32> b{
|
||||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
|
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
|
||||||
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1',
|
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1',
|
||||||
}},
|
},
|
||||||
d;
|
d;
|
||||||
|
|
||||||
pchunks.append(b.data(), b.size());
|
pchunks.append(b.data(), b.size());
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace shrpx {
|
||||||
namespace {
|
namespace {
|
||||||
// List of API endpoints
|
// List of API endpoints
|
||||||
const std::array<APIEndpoint, 2> &apis() {
|
const std::array<APIEndpoint, 2> &apis() {
|
||||||
static const auto apis = new std::array<APIEndpoint, 2>{{
|
static const auto apis = new std::array<APIEndpoint, 2>{
|
||||||
APIEndpoint{
|
APIEndpoint{
|
||||||
StringRef::from_lit("/api/v1beta1/backendconfig"),
|
StringRef::from_lit("/api/v1beta1/backendconfig"),
|
||||||
true,
|
true,
|
||||||
|
@ -54,7 +54,7 @@ const std::array<APIEndpoint, 2> &apis() {
|
||||||
(1 << API_METHOD_GET),
|
(1 << API_METHOD_GET),
|
||||||
&APIDownstreamConnection::handle_configrevision,
|
&APIDownstreamConnection::handle_configrevision,
|
||||||
},
|
},
|
||||||
}};
|
};
|
||||||
|
|
||||||
return *apis;
|
return *apis;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1319,7 +1319,7 @@ int ClientHandler::proxy_protocol_read() {
|
||||||
// NULL character really destroys functions which expects NULL
|
// NULL character really destroys functions which expects NULL
|
||||||
// terminated string. We won't expect it in PROXY protocol line, so
|
// terminated string. We won't expect it in PROXY protocol line, so
|
||||||
// find it here.
|
// find it here.
|
||||||
auto chrs = std::array<char, 2>{{'\n', '\0'}};
|
auto chrs = std::array<char, 2>{'\n', '\0'};
|
||||||
|
|
||||||
constexpr size_t MAX_PROXY_LINELEN = 107;
|
constexpr size_t MAX_PROXY_LINELEN = 107;
|
||||||
|
|
||||||
|
|
|
@ -110,13 +110,13 @@ int signal_set_handler(void (*handler)(int), Signals &&sigs) {
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
constexpr auto master_proc_ign_signals = std::array<int, 1>{{SIGPIPE}};
|
constexpr auto master_proc_ign_signals = std::array<int, 1>{SIGPIPE};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
constexpr auto worker_proc_ign_signals =
|
constexpr auto worker_proc_ign_signals =
|
||||||
std::array<int, 5>{{REOPEN_LOG_SIGNAL, EXEC_BINARY_SIGNAL,
|
std::array<int, 5>{REOPEN_LOG_SIGNAL, EXEC_BINARY_SIGNAL,
|
||||||
GRACEFUL_SHUTDOWN_SIGNAL, RELOAD_SIGNAL, SIGPIPE}};
|
GRACEFUL_SHUTDOWN_SIGNAL, RELOAD_SIGNAL, SIGPIPE};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
int shrpx_signal_set_master_proc_ign_handler() {
|
int shrpx_signal_set_master_proc_ign_handler() {
|
||||||
|
|
Loading…
Reference in New Issue