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
c17b3b85
Commit
c17b3b85
authored
Mar 31, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clang-format
parent
b26503f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
29 deletions
+23
-29
src/nghttp.cc
src/nghttp.cc
+12
-19
src/ssl.cc
src/ssl.cc
+11
-10
No files found.
src/nghttp.cc
View file @
c17b3b85
...
...
@@ -324,23 +324,16 @@ void continue_timeout_cb(struct ev_loop *loop, ev_timer *w, int revents) {
}
}
// namespace
ContinueTimer
::
ContinueTimer
(
struct
ev_loop
*
loop
,
Request
*
req
)
:
loop
(
loop
)
{
ContinueTimer
::
ContinueTimer
(
struct
ev_loop
*
loop
,
Request
*
req
)
:
loop
(
loop
)
{
ev_timer_init
(
&
timer
,
continue_timeout_cb
,
1.
,
0.
);
timer
.
data
=
req
;
}
ContinueTimer
::~
ContinueTimer
()
{
stop
();
}
ContinueTimer
::~
ContinueTimer
()
{
stop
();
}
void
ContinueTimer
::
start
()
{
ev_timer_start
(
loop
,
&
timer
);
}
void
ContinueTimer
::
start
()
{
ev_timer_start
(
loop
,
&
timer
);
}
void
ContinueTimer
::
stop
()
{
ev_timer_stop
(
loop
,
&
timer
);
}
void
ContinueTimer
::
stop
()
{
ev_timer_stop
(
loop
,
&
timer
);
}
void
ContinueTimer
::
dispatch_continue
()
{
// Only dispatch the timeout callback if it hasn't already been called.
...
...
@@ -412,7 +405,8 @@ int submit_request(HttpClient *client, const Headers &headers, Request *req) {
if
(
req
->
data_prd
)
{
if
(
!
config
.
no_content_length
)
{
build_headers
.
emplace_back
(
"content-length"
,
util
::
utos
(
req
->
data_length
));
build_headers
.
emplace_back
(
"content-length"
,
util
::
utos
(
req
->
data_length
));
}
if
(
config
.
expect_continue
)
{
expect_continue
=
true
;
...
...
@@ -461,7 +455,7 @@ int submit_request(HttpClient *client, const Headers &headers, Request *req) {
if
(
expect_continue
)
{
stream_id
=
nghttp2_submit_headers
(
client
->
session
,
0
,
-
1
,
&
req
->
pri_spec
,
nva
.
data
(),
nva
.
size
(),
req
);
nva
.
data
(),
nva
.
size
(),
req
);
}
else
{
stream_id
=
nghttp2_submit_request
(
client
->
session
,
&
req
->
pri_spec
,
nva
.
data
(),
...
...
@@ -471,8 +465,8 @@ int submit_request(HttpClient *client, const Headers &headers, Request *req) {
if
(
stream_id
<
0
)
{
std
::
cerr
<<
"[ERROR] nghttp2_submit_"
<<
(
expect_continue
?
"headers"
:
"request"
)
<<
"() returned error: "
<<
nghttp2_strerror
(
stream_id
)
<<
std
::
endl
;
<<
"() returned error: "
<<
nghttp2_strerror
(
stream_id
)
<<
std
::
endl
;
return
-
1
;
}
...
...
@@ -1982,8 +1976,7 @@ int before_frame_send_callback(nghttp2_session *session,
}
// namespace
namespace
{
int
on_frame_send_callback
(
nghttp2_session
*
session
,
const
nghttp2_frame
*
frame
,
int
on_frame_send_callback
(
nghttp2_session
*
session
,
const
nghttp2_frame
*
frame
,
void
*
user_data
)
{
if
(
config
.
verbose
)
{
verbose_on_frame_send_callback
(
session
,
frame
,
user_data
);
...
...
@@ -2392,8 +2385,8 @@ int run(char **uris, int n) {
nghttp2_session_callbacks_set_before_frame_send_callback
(
callbacks
,
before_frame_send_callback
);
nghttp2_session_callbacks_set_on_frame_send_callback
(
callbacks
,
on_frame_send_callback
);
nghttp2_session_callbacks_set_on_frame_send_callback
(
callbacks
,
on_frame_send_callback
);
nghttp2_session_callbacks_set_on_frame_not_send_callback
(
callbacks
,
on_frame_not_send_callback
);
...
...
src/ssl.cc
View file @
c17b3b85
...
...
@@ -123,16 +123,17 @@ TLSSessionInfo *get_tls_session_info(TLSSessionInfo *tls_info, SSL *ssl) {
the black listed cipher suites for HTTP/2 described in RFC 7540.
https://github.com/jay/http2_blacklisted_ciphers
*/
#define IS_CIPHER_BANNED_METHOD2(id) ( \
(0x0000 <= id && id <= 0x00FF && \
"\xFF\xFF\xFF\xCF\xFF\xFF\xFF\xFF\x7F\x00\x00\x00\x80\x3F\x00\x00" \
"\xF0\xFF\xFF\x3F\xF3\xF3\xFF\xFF\x3F\x00\x00\x00\x00\x00\x00\x80" \
[(id & 0xFF) / 8] & (1 << (id % 8))) || \
(0xC000 <= id && id <= 0xC0FF && \
"\xFE\xFF\xFF\xFF\xFF\x67\xFE\xFF\xFF\xFF\x33\xCF\xFC\xCF\xFF\xCF" \
"\x3C\xF3\xFC\x3F\x33\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" \
[(id & 0xFF) / 8] & (1 << (id % 8))) \
)
#define IS_CIPHER_BANNED_METHOD2(id) \
((0x0000 <= id && id <= 0x00FF && \
"\xFF\xFF\xFF\xCF\xFF\xFF\xFF\xFF\x7F\x00\x00\x00\x80\x3F\x00\x00" \
"\xF0\xFF\xFF\x3F\xF3\xF3\xFF\xFF\x3F\x00\x00\x00\x00\x00\x00\x80" \
[(id & 0xFF) / 8] & \
(1 << (id % 8))) || \
(0xC000 <= id && id <= 0xC0FF && \
"\xFE\xFF\xFF\xFF\xFF\x67\xFE\xFF\xFF\xFF\x33\xCF\xFC\xCF\xFF\xCF" \
"\x3C\xF3\xFC\x3F\x33\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" \
[(id & 0xFF) / 8] & \
(1 << (id % 8))))
bool
check_http2_cipher_black_list
(
SSL
*
ssl
)
{
int
id
=
SSL_CIPHER_get_id
(
SSL_get_current_cipher
(
ssl
))
&
0xFFFFFF
;
...
...
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