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
af5b3546
Commit
af5b3546
authored
Jul 29, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttp: next_weight_idx is enough to be an local variable
parent
3c1c2c4a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
src/nghttp.cc
src/nghttp.cc
+6
-5
src/nghttp.h
src/nghttp.h
+0
-2
No files found.
src/nghttp.cc
View file @
af5b3546
...
...
@@ -96,7 +96,6 @@ Config::Config()
:
header_table_size
(
-
1
),
min_header_table_size
(
std
::
numeric_limits
<
uint32_t
>::
max
()),
padding
(
0
),
next_weight_idx
(
0
),
max_concurrent_streams
(
100
),
peer_max_concurrent_streams
(
100
),
multiply
(
1
),
...
...
@@ -2484,16 +2483,19 @@ int run(char **uris, int n) {
}
std
::
vector
<
std
::
tuple
<
std
::
string
,
nghttp2_data_provider
*
,
int64_t
,
int32_t
>>
requests
;
size_t
next_weight_idx
=
0
;
for
(
int
i
=
0
;
i
<
n
;
++
i
)
{
http_parser_url
u
{};
auto
uri
=
strip_fragment
(
uris
[
i
]);
if
(
http_parser_parse_url
(
uri
.
c_str
(),
uri
.
size
(),
0
,
&
u
)
!=
0
)
{
++
config
.
next_weight_idx
;
++
next_weight_idx
;
std
::
cerr
<<
"[ERROR] Could not parse URI "
<<
uri
<<
std
::
endl
;
continue
;
}
if
(
!
util
::
has_uri_field
(
u
,
UF_SCHEMA
))
{
++
config
.
next_weight_idx
;
++
next_weight_idx
;
std
::
cerr
<<
"[ERROR] URI "
<<
uri
<<
" does not have scheme part"
<<
std
::
endl
;
continue
;
...
...
@@ -2516,8 +2518,7 @@ int run(char **uris, int n) {
prev_port
=
port
;
}
requests
.
emplace_back
(
uri
,
data_fd
==
-
1
?
nullptr
:
&
data_prd
,
data_stat
.
st_size
,
config
.
weight
[
config
.
next_weight_idx
++
]);
data_stat
.
st_size
,
config
.
weight
[
next_weight_idx
++
]);
}
if
(
!
requests
.
empty
())
{
if
(
communicate
(
prev_scheme
,
prev_host
,
prev_port
,
std
::
move
(
requests
),
...
...
src/nghttp.h
View file @
af5b3546
...
...
@@ -73,8 +73,6 @@ struct Config {
int64_t
header_table_size
;
int64_t
min_header_table_size
;
size_t
padding
;
// the next index into weight.
size_t
next_weight_idx
;
size_t
max_concurrent_streams
;
ssize_t
peer_max_concurrent_streams
;
int
multiply
;
...
...
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