Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
f5285d1f
Commit
f5285d1f
authored
Oct 02, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Add BlockAllocator to SharedDownstreamAddr
parent
ede61049
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
8 deletions
+27
-8
src/shrpx_worker.cc
src/shrpx_worker.cc
+6
-3
src/shrpx_worker.h
src/shrpx_worker.h
+21
-5
No files found.
src/shrpx_worker.cc
View file @
f5285d1f
...
@@ -198,13 +198,16 @@ void Worker::replace_downstream_config(
...
@@ -198,13 +198,16 @@ void Worker::replace_downstream_config(
auto
&
dst_addr
=
shared_addr
->
addrs
[
j
];
auto
&
dst_addr
=
shared_addr
->
addrs
[
j
];
dst_addr
.
addr
=
src_addr
.
addr
;
dst_addr
.
addr
=
src_addr
.
addr
;
dst_addr
.
host
=
src_addr
.
host
;
dst_addr
.
host
=
dst_addr
.
hostport
=
src_addr
.
hostport
;
make_string_ref
(
shared_addr
->
balloc
,
StringRef
{
src_addr
.
host
});
dst_addr
.
hostport
=
make_string_ref
(
shared_addr
->
balloc
,
StringRef
{
src_addr
.
hostport
});
dst_addr
.
port
=
src_addr
.
port
;
dst_addr
.
port
=
src_addr
.
port
;
dst_addr
.
host_unix
=
src_addr
.
host_unix
;
dst_addr
.
host_unix
=
src_addr
.
host_unix
;
dst_addr
.
proto
=
src_addr
.
proto
;
dst_addr
.
proto
=
src_addr
.
proto
;
dst_addr
.
tls
=
src_addr
.
tls
;
dst_addr
.
tls
=
src_addr
.
tls
;
dst_addr
.
sni
=
src_addr
.
sni
;
dst_addr
.
sni
=
make_string_ref
(
shared_addr
->
balloc
,
StringRef
{
src_addr
.
sni
});
dst_addr
.
fall
=
src_addr
.
fall
;
dst_addr
.
fall
=
src_addr
.
fall
;
dst_addr
.
rise
=
src_addr
.
rise
;
dst_addr
.
rise
=
src_addr
.
rise
;
...
...
src/shrpx_worker.h
View file @
f5285d1f
...
@@ -48,6 +48,7 @@
...
@@ -48,6 +48,7 @@
#include "shrpx_ssl.h"
#include "shrpx_ssl.h"
#include "shrpx_live_check.h"
#include "shrpx_live_check.h"
#include "shrpx_connect_blocker.h"
#include "shrpx_connect_blocker.h"
#include "allocator.h"
using
namespace
nghttp2
;
using
namespace
nghttp2
;
...
@@ -75,15 +76,15 @@ struct DownstreamAddr {
...
@@ -75,15 +76,15 @@ struct DownstreamAddr {
Address
addr
;
Address
addr
;
// backend address. If |host_unix| is true, this is UNIX domain
// backend address. If |host_unix| is true, this is UNIX domain
// socket path.
// socket path.
ImmutableString
host
;
StringRef
host
;
ImmutableString
hostport
;
StringRef
hostport
;
// backend port. 0 if |host_unix| is true.
// backend port. 0 if |host_unix| is true.
uint16_t
port
;
uint16_t
port
;
// true if |host| contains UNIX domain socket path.
// true if |host| contains UNIX domain socket path.
bool
host_unix
;
bool
host_unix
;
// sni field to send remote server if TLS is enabled.
// sni field to send remote server if TLS is enabled.
ImmutableString
sni
;
StringRef
sni
;
std
::
unique_ptr
<
ConnectBlocker
>
connect_blocker
;
std
::
unique_ptr
<
ConnectBlocker
>
connect_blocker
;
std
::
unique_ptr
<
LiveCheck
>
live_check
;
std
::
unique_ptr
<
LiveCheck
>
live_check
;
...
@@ -128,8 +129,18 @@ struct WeightedPri {
...
@@ -128,8 +129,18 @@ struct WeightedPri {
struct
SharedDownstreamAddr
{
struct
SharedDownstreamAddr
{
SharedDownstreamAddr
()
SharedDownstreamAddr
()
:
next
{
0
},
http1_pri
{},
http2_pri
{},
affinity
{
AFFINITY_NONE
}
{}
:
balloc
(
1024
,
1024
),
next
{
0
},
http1_pri
{},
http2_pri
{},
affinity
{
AFFINITY_NONE
}
{}
SharedDownstreamAddr
(
const
SharedDownstreamAddr
&
)
=
delete
;
SharedDownstreamAddr
(
SharedDownstreamAddr
&&
)
=
delete
;
SharedDownstreamAddr
&
operator
=
(
const
SharedDownstreamAddr
&
)
=
delete
;
SharedDownstreamAddr
&
operator
=
(
SharedDownstreamAddr
&&
)
=
delete
;
BlockAllocator
balloc
;
std
::
vector
<
DownstreamAddr
>
addrs
;
std
::
vector
<
DownstreamAddr
>
addrs
;
// Bunch of session affinity hash. Only used if affinity ==
// Bunch of session affinity hash. Only used if affinity ==
// AFFINITY_IP.
// AFFINITY_IP.
...
@@ -162,6 +173,11 @@ struct SharedDownstreamAddr {
...
@@ -162,6 +173,11 @@ struct SharedDownstreamAddr {
struct
DownstreamAddrGroup
{
struct
DownstreamAddrGroup
{
DownstreamAddrGroup
()
:
retired
{
false
}
{};
DownstreamAddrGroup
()
:
retired
{
false
}
{};
DownstreamAddrGroup
(
const
DownstreamAddrGroup
&
)
=
delete
;
DownstreamAddrGroup
(
DownstreamAddrGroup
&&
)
=
delete
;
DownstreamAddrGroup
&
operator
=
(
const
DownstreamAddrGroup
&
)
=
delete
;
DownstreamAddrGroup
&
operator
=
(
DownstreamAddrGroup
&&
)
=
delete
;
ImmutableString
pattern
;
ImmutableString
pattern
;
std
::
shared_ptr
<
SharedDownstreamAddr
>
shared_addr
;
std
::
shared_ptr
<
SharedDownstreamAddr
>
shared_addr
;
// true if this group is no longer used for new request. If this is
// true if this group is no longer used for new request. If this is
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment