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
Hide 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(
auto
&
dst_addr
=
shared_addr
->
addrs
[
j
];
dst_addr
.
addr
=
src_addr
.
addr
;
dst_addr
.
host
=
src_addr
.
host
;
dst_addr
.
hostport
=
src_addr
.
hostport
;
dst_addr
.
host
=
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
.
host_unix
=
src_addr
.
host_unix
;
dst_addr
.
proto
=
src_addr
.
proto
;
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
.
rise
=
src_addr
.
rise
;
...
...
src/shrpx_worker.h
View file @
f5285d1f
...
...
@@ -48,6 +48,7 @@
#include "shrpx_ssl.h"
#include "shrpx_live_check.h"
#include "shrpx_connect_blocker.h"
#include "allocator.h"
using
namespace
nghttp2
;
...
...
@@ -75,15 +76,15 @@ struct DownstreamAddr {
Address
addr
;
// backend address. If |host_unix| is true, this is UNIX domain
// socket path.
ImmutableString
host
;
ImmutableString
hostport
;
StringRef
host
;
StringRef
hostport
;
// backend port. 0 if |host_unix| is true.
uint16_t
port
;
// true if |host| contains UNIX domain socket path.
bool
host_unix
;
// sni field to send remote server if TLS is enabled.
ImmutableString
sni
;
StringRef
sni
;
std
::
unique_ptr
<
ConnectBlocker
>
connect_blocker
;
std
::
unique_ptr
<
LiveCheck
>
live_check
;
...
...
@@ -128,8 +129,18 @@ struct WeightedPri {
struct
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
;
// Bunch of session affinity hash. Only used if affinity ==
// AFFINITY_IP.
...
...
@@ -162,6 +173,11 @@ struct SharedDownstreamAddr {
struct
DownstreamAddrGroup
{
DownstreamAddrGroup
()
:
retired
{
false
}
{};
DownstreamAddrGroup
(
const
DownstreamAddrGroup
&
)
=
delete
;
DownstreamAddrGroup
(
DownstreamAddrGroup
&&
)
=
delete
;
DownstreamAddrGroup
&
operator
=
(
const
DownstreamAddrGroup
&
)
=
delete
;
DownstreamAddrGroup
&
operator
=
(
DownstreamAddrGroup
&&
)
=
delete
;
ImmutableString
pattern
;
std
::
shared_ptr
<
SharedDownstreamAddr
>
shared_addr
;
// 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