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
9dc52595
Commit
9dc52595
authored
Apr 29, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Take into account request URI in header size in https frontend
parent
ea8a566d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
0 deletions
+16
-0
src/shrpx_downstream.cc
src/shrpx_downstream.cc
+4
-0
src/shrpx_downstream.h
src/shrpx_downstream.h
+1
-0
src/shrpx_https_upstream.cc
src/shrpx_https_upstream.cc
+11
-0
No files found.
src/shrpx_downstream.cc
View file @
9dc52595
...
...
@@ -1211,4 +1211,8 @@ void Downstream::detach_blocked_link(BlockedLink *l) {
blocked_link_
=
nullptr
;
}
void
Downstream
::
add_request_headers_sum
(
size_t
amount
)
{
request_headers_sum_
+=
amount
;
}
}
// namespace shrpx
src/shrpx_downstream.h
View file @
9dc52595
...
...
@@ -143,6 +143,7 @@ public:
void
set_request_method
(
std
::
string
method
);
const
std
::
string
&
get_request_method
()
const
;
void
set_request_path
(
std
::
string
path
);
void
add_request_headers_sum
(
size_t
amount
);
void
set_request_start_time
(
std
::
chrono
::
high_resolution_clock
::
time_point
time
);
const
std
::
chrono
::
high_resolution_clock
::
time_point
&
...
...
src/shrpx_https_upstream.cc
View file @
9dc52595
...
...
@@ -78,6 +78,17 @@ namespace {
int
htp_uricb
(
http_parser
*
htp
,
const
char
*
data
,
size_t
len
)
{
auto
upstream
=
static_cast
<
HttpsUpstream
*>
(
htp
->
data
);
auto
downstream
=
upstream
->
get_downstream
();
if
(
downstream
->
get_request_headers_sum
()
+
len
>
get_config
()
->
header_field_buffer
)
{
if
(
LOG_ENABLED
(
INFO
))
{
ULOG
(
INFO
,
upstream
)
<<
"Too large URI size="
<<
downstream
->
get_request_headers_sum
()
+
len
;
}
assert
(
downstream
->
get_request_state
()
==
Downstream
::
INITIAL
);
downstream
->
set_request_state
(
Downstream
::
HTTP1_REQUEST_HEADER_TOO_LARGE
);
return
-
1
;
}
downstream
->
add_request_headers_sum
(
len
);
downstream
->
append_request_path
(
data
,
len
);
return
0
;
}
...
...
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