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
e7d05210
Commit
e7d05210
authored
Mar 04, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asio: Utilize aggregate or value-initialization for header_value
parent
fc2170e4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
13 deletions
+12
-13
examples/asio-sv2.cc
examples/asio-sv2.cc
+2
-2
src/asio_client_session_impl.cc
src/asio_client_session_impl.cc
+8
-6
src/asio_http2_handler.cc
src/asio_http2_handler.cc
+2
-2
src/includes/nghttp2/asio_http2.h
src/includes/nghttp2/asio_http2.h
+0
-3
No files found.
examples/asio-sv2.cc
View file @
e7d05210
...
...
@@ -92,9 +92,9 @@ int main(int argc, char *argv[]) {
struct
stat
stbuf
;
if
(
stat
(
path
.
c_str
(),
&
stbuf
)
==
0
)
{
header
.
emplace
(
"content-length"
,
header_value
(
std
::
to_string
(
stbuf
.
st_size
))
);
header_value
{
std
::
to_string
(
stbuf
.
st_size
)}
);
header
.
emplace
(
"last-modified"
,
header_value
(
http_date
(
stbuf
.
st_mtime
))
);
header_value
{
http_date
(
stbuf
.
st_mtime
)}
);
}
res
.
write_head
(
200
,
std
::
move
(
header
));
res
.
end
(
file_reader_from_fd
(
fd
));
...
...
src/asio_client_session_impl.cc
View file @
e7d05210
...
...
@@ -149,9 +149,10 @@ int on_header_callback(nghttp2_session *session, const nghttp2_frame *frame,
res
.
content_length
(
util
::
parse_uint
(
value
,
valuelen
));
}
res
.
header
().
emplace
(
std
::
string
(
name
,
name
+
namelen
),
header_value
(
std
::
string
(
value
,
value
+
valuelen
),
flags
&
NGHTTP2_NV_FLAG_NO_INDEX
));
res
.
header
().
emplace
(
std
::
string
(
name
,
name
+
namelen
),
header_value
{
std
::
string
(
value
,
value
+
valuelen
),
(
flags
&
NGHTTP2_NV_FLAG_NO_INDEX
)
!=
0
});
}
break
;
}
...
...
@@ -183,9 +184,10 @@ int on_header_callback(nghttp2_session *session, const nghttp2_frame *frame,
}
// fall through
default:
req
.
header
().
emplace
(
std
::
string
(
name
,
name
+
namelen
),
header_value
(
std
::
string
(
value
,
value
+
valuelen
),
flags
&
NGHTTP2_NV_FLAG_NO_INDEX
));
req
.
header
().
emplace
(
std
::
string
(
name
,
name
+
namelen
),
header_value
{
std
::
string
(
value
,
value
+
valuelen
),
(
flags
&
NGHTTP2_NV_FLAG_NO_INDEX
)
!=
0
});
}
break
;
...
...
src/asio_http2_handler.cc
View file @
e7d05210
...
...
@@ -265,8 +265,8 @@ int on_header_callback(nghttp2_session *session, const nghttp2_frame *frame,
// fall through
default:
req
.
header
().
emplace
(
std
::
string
(
name
,
name
+
namelen
),
header_value
(
std
::
string
(
value
,
value
+
valuelen
),
flags
&
NGHTTP2_NV_FLAG_NO_INDEX
)
);
header_value
{
std
::
string
(
value
,
value
+
valuelen
),
(
flags
&
NGHTTP2_NV_FLAG_NO_INDEX
)
!=
0
}
);
}
return
0
;
...
...
src/includes/nghttp2/asio_http2.h
View file @
e7d05210
...
...
@@ -63,9 +63,6 @@ struct header {
};
struct
header_value
{
header_value
(
std
::
string
value
,
bool
sensitive
=
false
)
:
value
(
std
::
move
(
value
)),
sensitive
(
sensitive
)
{}
std
::
string
value
;
bool
sensitive
;
};
...
...
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