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
68b5ffc1
Commit
68b5ffc1
authored
Feb 09, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename padding related names
parent
ce53d7bd
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
47 additions
and
46 deletions
+47
-46
lib/includes/nghttp2/nghttp2.h
lib/includes/nghttp2/nghttp2.h
+5
-5
lib/nghttp2_frame.c
lib/nghttp2_frame.c
+8
-7
lib/nghttp2_frame.h
lib/nghttp2_frame.h
+6
-6
lib/nghttp2_session.c
lib/nghttp2_session.c
+7
-7
lib/nghttp2_session.h
lib/nghttp2_session.h
+2
-2
src/HttpServer.cc
src/HttpServer.cc
+3
-3
src/HttpServer.h
src/HttpServer.h
+1
-1
src/nghttp.cc
src/nghttp.cc
+8
-8
src/nghttpd.cc
src/nghttpd.cc
+4
-4
tests/nghttp2_session_test.c
tests/nghttp2_session_test.c
+3
-3
No files found.
lib/includes/nghttp2/nghttp2.h
View file @
68b5ffc1
...
@@ -151,9 +151,9 @@ typedef struct {
...
@@ -151,9 +151,9 @@ typedef struct {
* @macro
* @macro
*
*
* The default value of DATA padding alignment. See
* The default value of DATA padding alignment. See
* :member:`NGHTTP2_OPT_PAD
_ALIGNMENT
`.
* :member:`NGHTTP2_OPT_PAD
DING_BOUNDARY
`.
*/
*/
#define NGHTTP2_PAD
_ALIGNMENT 16
#define NGHTTP2_PAD
DING_BOUNDARY 64
/**
/**
* @enum
* @enum
...
@@ -1341,7 +1341,7 @@ typedef enum {
...
@@ -1341,7 +1341,7 @@ typedef enum {
* to this alignment. The option value must be greater than or equal
* to this alignment. The option value must be greater than or equal
* to 8.
* to 8.
*/
*/
NGHTTP2_OPT_PAD
_ALIGNMENT
=
1
<<
3
NGHTTP2_OPT_PAD
DING_BOUNDARY
=
1
<<
3
}
nghttp2_opt
;
}
nghttp2_opt
;
/**
/**
...
@@ -1363,9 +1363,9 @@ typedef struct {
...
@@ -1363,9 +1363,9 @@ typedef struct {
*/
*/
uint8_t
no_auto_connection_window_update
;
uint8_t
no_auto_connection_window_update
;
/**
/**
* :enum:`NGHTTP2_OPT_PAD
_ALIGNMENT
`
* :enum:`NGHTTP2_OPT_PAD
DING_BOUNDARY
`
*/
*/
uint16_t
pad
_alignment
;
uint16_t
pad
ding_boundary
;
}
nghttp2_opt_set
;
}
nghttp2_opt_set
;
/**
/**
...
...
lib/nghttp2_frame.c
View file @
68b5ffc1
...
@@ -228,7 +228,7 @@ ssize_t nghttp2_frame_pack_headers(uint8_t **buf_ptr,
...
@@ -228,7 +228,7 @@ ssize_t nghttp2_frame_pack_headers(uint8_t **buf_ptr,
size_t
*
bufoff_ptr
,
size_t
*
bufoff_ptr
,
nghttp2_headers
*
frame
,
nghttp2_headers
*
frame
,
nghttp2_hd_deflater
*
deflater
,
nghttp2_hd_deflater
*
deflater
,
size_t
align
)
size_t
boundary
)
{
{
size_t
payloadoff
=
NGHTTP2_FRAME_HEAD_LENGTH
+
2
;
size_t
payloadoff
=
NGHTTP2_FRAME_HEAD_LENGTH
+
2
;
size_t
nv_offset
=
size_t
nv_offset
=
...
@@ -244,13 +244,13 @@ ssize_t nghttp2_frame_pack_headers(uint8_t **buf_ptr,
...
@@ -244,13 +244,13 @@ ssize_t nghttp2_frame_pack_headers(uint8_t **buf_ptr,
payloadlen
=
nghttp2_frame_headers_payload_nv_offset
(
frame
)
+
rv
;
payloadlen
=
nghttp2_frame_headers_payload_nv_offset
(
frame
)
+
rv
;
if
(
align
>
0
)
{
if
(
boundary
>
0
)
{
ssize_t
padlen
;
ssize_t
padlen
;
padlen
=
nghttp2_frame_add_pad
(
buf_ptr
,
buflen_ptr
,
bufoff_ptr
,
padlen
=
nghttp2_frame_add_pad
(
buf_ptr
,
buflen_ptr
,
bufoff_ptr
,
&
frame
->
hd
.
flags
,
&
frame
->
hd
.
flags
,
payloadlen
,
payloadlen
,
payloadlen
+
align
,
payloadlen
+
boundary
,
align
);
boundary
);
if
(
padlen
<
0
)
{
if
(
padlen
<
0
)
{
return
padlen
;
return
padlen
;
}
}
...
@@ -665,11 +665,12 @@ ssize_t nghttp2_frame_add_pad(uint8_t **buf_ptr, size_t *buflen_ptr,
...
@@ -665,11 +665,12 @@ ssize_t nghttp2_frame_add_pad(uint8_t **buf_ptr, size_t *buflen_ptr,
uint8_t
*
flags_ptr
,
uint8_t
*
flags_ptr
,
size_t
payloadlen
,
size_t
payloadlen
,
size_t
payloadmax
,
size_t
payloadmax
,
size_t
align
)
size_t
boundary
)
{
{
int
rv
;
int
rv
;
size_t
nextlen
=
nghttp2_min
((
payloadlen
+
align
-
1
)
/
align
*
align
,
size_t
nextlen
=
payloadmax
);
nghttp2_min
((
payloadlen
+
boundary
-
1
)
/
boundary
*
boundary
,
payloadmax
);
size_t
padlen
=
nextlen
-
payloadlen
;
size_t
padlen
=
nextlen
-
payloadlen
;
size_t
trail_padlen
=
0
;
size_t
trail_padlen
=
0
;
/* extra 2 bytes for PAD_HIGH and PAD_LOW. */
/* extra 2 bytes for PAD_HIGH and PAD_LOW. */
...
...
lib/nghttp2_frame.h
View file @
68b5ffc1
...
@@ -107,8 +107,8 @@ size_t nghttp2_frame_headers_payload_nv_offset(nghttp2_headers *frame);
...
@@ -107,8 +107,8 @@ size_t nghttp2_frame_headers_payload_nv_offset(nghttp2_headers *frame);
* The first byte the frame is serialized is returned in the
* The first byte the frame is serialized is returned in the
* |*bufoff_ptr|.
* |*bufoff_ptr|.
*
*
* The |
align| is used as padding alignment. If the |align| is zero,
* The |
boundary| is used as padding boundary. If the |boundary| is
* no padding is added.
*
zero,
no padding is added.
*
*
* frame->hd.length is assigned after length is determined during
* frame->hd.length is assigned after length is determined during
* packing process. If payload length is strictly larger than
* packing process. If payload length is strictly larger than
...
@@ -132,7 +132,7 @@ ssize_t nghttp2_frame_pack_headers(uint8_t **buf_ptr,
...
@@ -132,7 +132,7 @@ ssize_t nghttp2_frame_pack_headers(uint8_t **buf_ptr,
size_t
*
bufoff_ptr
,
size_t
*
bufoff_ptr
,
nghttp2_headers
*
frame
,
nghttp2_headers
*
frame
,
nghttp2_hd_deflater
*
deflater
,
nghttp2_hd_deflater
*
deflater
,
size_t
align
);
size_t
boundary
);
/*
/*
* Unpacks HEADERS frame byte sequence into |frame|. This function
* Unpacks HEADERS frame byte sequence into |frame|. This function
...
@@ -508,8 +508,8 @@ int nghttp2_iv_check(const nghttp2_settings_entry *iv, size_t niv);
...
@@ -508,8 +508,8 @@ int nghttp2_iv_check(const nghttp2_settings_entry *iv, size_t niv);
* payload must start at offset NGHTTP2_FRAME_HEAD_LENGTH + 2 from
* payload must start at offset NGHTTP2_FRAME_HEAD_LENGTH + 2 from
* |*buf_ptr| to account for PAD_HIGH and PAD_LOW. The maximum payload
* |*buf_ptr| to account for PAD_HIGH and PAD_LOW. The maximum payload
* allowed is given in the |payloadmax|. The padding will not be made
* allowed is given in the |payloadmax|. The padding will not be made
* more than |payloadmax|. The padding
alignment
is given in the
* more than |payloadmax|. The padding
boundary
is given in the
* |
align
|.
* |
boundary
|.
*
*
* The |*flags_ptr| is updated to include NGHTTP2_FLAG_PAD_LOW and
* The |*flags_ptr| is updated to include NGHTTP2_FLAG_PAD_LOW and
* NGHTTP2_FLAG_PAD_HIGH based on the padding length. The
* NGHTTP2_FLAG_PAD_HIGH based on the padding length. The
...
@@ -582,6 +582,6 @@ ssize_t nghttp2_frame_add_pad(uint8_t **buf_ptr, size_t *buflen_ptr,
...
@@ -582,6 +582,6 @@ ssize_t nghttp2_frame_add_pad(uint8_t **buf_ptr, size_t *buflen_ptr,
uint8_t
*
flags_ptr
,
uint8_t
*
flags_ptr
,
size_t
payloadlen
,
size_t
payloadlen
,
size_t
payloadmax
,
size_t
payloadmax
,
size_t
align
);
size_t
boundary
);
#endif
/* NGHTTP2_FRAME_H */
#endif
/* NGHTTP2_FRAME_H */
lib/nghttp2_session.c
View file @
68b5ffc1
...
@@ -224,11 +224,11 @@ static int nghttp2_session_new(nghttp2_session **session_ptr,
...
@@ -224,11 +224,11 @@ static int nghttp2_session_new(nghttp2_session **session_ptr,
(
*
session_ptr
)
->
opt_flags
|=
(
*
session_ptr
)
->
opt_flags
|=
NGHTTP2_OPTMASK_NO_AUTO_CONNECTION_WINDOW_UPDATE
;
NGHTTP2_OPTMASK_NO_AUTO_CONNECTION_WINDOW_UPDATE
;
}
}
if
((
opt_set_mask
&
NGHTTP2_OPT_PAD
_ALIGNMENT
)
&&
if
((
opt_set_mask
&
NGHTTP2_OPT_PAD
DING_BOUNDARY
)
&&
opt_set
->
pad
_alignment
>=
8
)
{
opt_set
->
pad
ding_boundary
>=
8
)
{
(
*
session_ptr
)
->
pad
_alignment
=
opt_set
->
pad_alignment
;
(
*
session_ptr
)
->
pad
ding_boundary
=
opt_set
->
padding_boundary
;
}
else
{
}
else
{
(
*
session_ptr
)
->
pad
_alignment
=
NGHTTP2_PAD_ALIGNMENT
;
(
*
session_ptr
)
->
pad
ding_boundary
=
NGHTTP2_PADDING_BOUNDARY
;
}
}
(
*
session_ptr
)
->
remote_window_size
=
NGHTTP2_INITIAL_CONNECTION_WINDOW_SIZE
;
(
*
session_ptr
)
->
remote_window_size
=
NGHTTP2_INITIAL_CONNECTION_WINDOW_SIZE
;
...
@@ -1123,7 +1123,7 @@ static ssize_t nghttp2_session_prep_frame(nghttp2_session *session,
...
@@ -1123,7 +1123,7 @@ static ssize_t nghttp2_session_prep_frame(nghttp2_session *session,
&
session
->
aob
.
framebufoff
,
&
session
->
aob
.
framebufoff
,
&
frame
->
headers
,
&
frame
->
headers
,
&
session
->
hd_deflater
,
&
session
->
hd_deflater
,
session
->
pad
_alignment
);
session
->
pad
ding_boundary
);
if
(
framebuflen
<
0
)
{
if
(
framebuflen
<
0
)
{
return
framebuflen
;
return
framebuflen
;
}
}
...
@@ -4227,11 +4227,11 @@ ssize_t nghttp2_session_pack_data(nghttp2_session *session,
...
@@ -4227,11 +4227,11 @@ ssize_t nghttp2_session_pack_data(nghttp2_session *session,
frame
->
hd
.
flags
&=
~
(
NGHTTP2_FLAG_PAD_HIGH
|
NGHTTP2_FLAG_PAD_LOW
);
frame
->
hd
.
flags
&=
~
(
NGHTTP2_FLAG_PAD_HIGH
|
NGHTTP2_FLAG_PAD_LOW
);
flags
=
0
;
flags
=
0
;
if
(
session
->
pad
_alignment
&&
if
(
session
->
pad
ding_boundary
&&
payloadlen
>
0
&&
(
size_t
)
payloadlen
<
datamax
)
{
payloadlen
>
0
&&
(
size_t
)
payloadlen
<
datamax
)
{
rv
=
nghttp2_frame_add_pad
(
buf_ptr
,
buflen_ptr
,
bufoff_ptr
,
rv
=
nghttp2_frame_add_pad
(
buf_ptr
,
buflen_ptr
,
bufoff_ptr
,
&
flags
,
payloadlen
,
datamax
,
&
flags
,
payloadlen
,
datamax
,
session
->
pad
_alignment
);
session
->
pad
ding_boundary
);
if
(
rv
<
0
)
{
if
(
rv
<
0
)
{
return
rv
;
return
rv
;
}
}
...
...
lib/nghttp2_session.h
View file @
68b5ffc1
...
@@ -153,8 +153,8 @@ struct nghttp2_session {
...
@@ -153,8 +153,8 @@ struct nghttp2_session {
size_t
num_incoming_streams
;
size_t
num_incoming_streams
;
/* The number of bytes allocated for nvbuf */
/* The number of bytes allocated for nvbuf */
size_t
nvbuflen
;
size_t
nvbuflen
;
/* padding alignemnt. See NGHTTP2_OPT_PAD
_ALIGNMENT
. */
/* padding alignemnt. See NGHTTP2_OPT_PAD
DING_BOUNDARY
. */
size_t
pad
_alignment
;
size_t
pad
ding_boundary
;
/* Next Stream ID. Made unsigned int to detect >= (1 << 31). */
/* Next Stream ID. Made unsigned int to detect >= (1 << 31). */
uint32_t
next_stream_id
;
uint32_t
next_stream_id
;
/* The largest stream ID received so far */
/* The largest stream ID received so far */
...
...
src/HttpServer.cc
View file @
68b5ffc1
...
@@ -66,7 +66,7 @@ const std::string NGHTTPD_SERVER = "nghttpd nghttp2/" NGHTTP2_VERSION;
...
@@ -66,7 +66,7 @@ const std::string NGHTTPD_SERVER = "nghttpd nghttp2/" NGHTTP2_VERSION;
Config
::
Config
()
Config
::
Config
()
:
data_ptr
(
nullptr
),
:
data_ptr
(
nullptr
),
output_upper_thres
(
1024
*
1024
),
output_upper_thres
(
1024
*
1024
),
pad
_alignment
(
NGHTTP2_PAD_ALIGNMENT
),
pad
ding_boundary
(
NGHTTP2_PADDING_BOUNDARY
),
header_table_size
(
-
1
),
header_table_size
(
-
1
),
port
(
0
),
port
(
0
),
verbose
(
false
),
verbose
(
false
),
...
@@ -365,11 +365,11 @@ int Http2Handler::on_connect()
...
@@ -365,11 +365,11 @@ int Http2Handler::on_connect()
nghttp2_opt_set
opt_set
;
nghttp2_opt_set
opt_set
;
memset
(
&
opt_set
,
0
,
sizeof
(
opt_set
));
memset
(
&
opt_set
,
0
,
sizeof
(
opt_set
));
opt_set
.
pad
_alignment
=
sessions_
->
get_config
()
->
pad_alignment
;
opt_set
.
pad
ding_boundary
=
sessions_
->
get_config
()
->
padding_boundary
;
fill_callback
(
callbacks
,
sessions_
->
get_config
());
fill_callback
(
callbacks
,
sessions_
->
get_config
());
r
=
nghttp2_session_server_new2
(
&
session_
,
&
callbacks
,
this
,
r
=
nghttp2_session_server_new2
(
&
session_
,
&
callbacks
,
this
,
NGHTTP2_OPT_PAD
_ALIGNMENT
,
&
opt_set
);
NGHTTP2_OPT_PAD
DING_BOUNDARY
,
&
opt_set
);
if
(
r
!=
0
)
{
if
(
r
!=
0
)
{
return
r
;
return
r
;
}
}
...
...
src/HttpServer.h
View file @
68b5ffc1
...
@@ -56,7 +56,7 @@ struct Config {
...
@@ -56,7 +56,7 @@ struct Config {
std
::
string
cert_file
;
std
::
string
cert_file
;
void
*
data_ptr
;
void
*
data_ptr
;
size_t
output_upper_thres
;
size_t
output_upper_thres
;
size_t
pad
_alignment
;
size_t
pad
ding_boundary
;
ssize_t
header_table_size
;
ssize_t
header_table_size
;
uint16_t
port
;
uint16_t
port
;
bool
verbose
;
bool
verbose
;
...
...
src/nghttp.cc
View file @
68b5ffc1
...
@@ -82,7 +82,7 @@ struct Config {
...
@@ -82,7 +82,7 @@ struct Config {
std
::
string
keyfile
;
std
::
string
keyfile
;
std
::
string
datafile
;
std
::
string
datafile
;
size_t
output_upper_thres
;
size_t
output_upper_thres
;
size_t
pad
_alignment
;
size_t
pad
ding_boundary
;
ssize_t
peer_max_concurrent_streams
;
ssize_t
peer_max_concurrent_streams
;
ssize_t
header_table_size
;
ssize_t
header_table_size
;
int32_t
pri
;
int32_t
pri
;
...
@@ -100,7 +100,7 @@ struct Config {
...
@@ -100,7 +100,7 @@ struct Config {
bool
continuation
;
bool
continuation
;
Config
()
Config
()
:
output_upper_thres
(
1024
*
1024
),
:
output_upper_thres
(
1024
*
1024
),
pad
_alignment
(
NGHTTP2_PAD_ALIGNMENT
),
pad
ding_boundary
(
NGHTTP2_PADDING_BOUNDARY
),
peer_max_concurrent_streams
(
NGHTTP2_INITIAL_MAX_CONCURRENT_STREAMS
),
peer_max_concurrent_streams
(
NGHTTP2_INITIAL_MAX_CONCURRENT_STREAMS
),
header_table_size
(
-
1
),
header_table_size
(
-
1
),
pri
(
NGHTTP2_PRI_DEFAULT
),
pri
(
NGHTTP2_PRI_DEFAULT
),
...
@@ -716,10 +716,10 @@ struct HttpClient {
...
@@ -716,10 +716,10 @@ struct HttpClient {
}
}
nghttp2_opt_set
opt_set
;
nghttp2_opt_set
opt_set
;
opt_set
.
peer_max_concurrent_streams
=
config
.
peer_max_concurrent_streams
;
opt_set
.
peer_max_concurrent_streams
=
config
.
peer_max_concurrent_streams
;
opt_set
.
pad
_alignment
=
config
.
pad_alignment
;
opt_set
.
pad
ding_boundary
=
config
.
padding_boundary
;
rv
=
nghttp2_session_client_new2
(
&
session
,
callbacks
,
this
,
rv
=
nghttp2_session_client_new2
(
&
session
,
callbacks
,
this
,
NGHTTP2_OPT_PEER_MAX_CONCURRENT_STREAMS
|
NGHTTP2_OPT_PEER_MAX_CONCURRENT_STREAMS
|
NGHTTP2_OPT_PAD
_ALIGNMENT
,
NGHTTP2_OPT_PAD
DING_BOUNDARY
,
&
opt_set
);
&
opt_set
);
if
(
rv
!=
0
)
{
if
(
rv
!=
0
)
{
return
-
1
;
return
-
1
;
...
@@ -1710,8 +1710,8 @@ void print_help(std::ostream& out)
...
@@ -1710,8 +1710,8 @@ void print_help(std::ostream& out)
<<
" is large enough as it is seen as unlimited.
\n
"
<<
" is large enough as it is seen as unlimited.
\n
"
<<
" -c, --header-table-size=<N>
\n
"
<<
" -c, --header-table-size=<N>
\n
"
<<
" Specify decoder header table size.
\n
"
<<
" Specify decoder header table size.
\n
"
<<
" -b, --pad
=<ALIGNMENT
>
\n
"
<<
" -b, --pad
ding=<BOUNDARY
>
\n
"
<<
"
Alignment of frame payload padding
.
\n
"
<<
"
Padding boundary for frame payload
.
\n
"
<<
" --color Force colored log output.
\n
"
<<
" --color Force colored log output.
\n
"
<<
" --continuation Send large header to test CONTINUATION.
\n
"
<<
" --continuation Send large header to test CONTINUATION.
\n
"
<<
std
::
endl
;
<<
std
::
endl
;
...
@@ -1740,7 +1740,7 @@ int main(int argc, char **argv)
...
@@ -1740,7 +1740,7 @@ int main(int argc, char **argv)
{
"pri"
,
required_argument
,
nullptr
,
'p'
},
{
"pri"
,
required_argument
,
nullptr
,
'p'
},
{
"peer-max-concurrent-streams"
,
required_argument
,
nullptr
,
'M'
},
{
"peer-max-concurrent-streams"
,
required_argument
,
nullptr
,
'M'
},
{
"header-table-size"
,
required_argument
,
nullptr
,
'c'
},
{
"header-table-size"
,
required_argument
,
nullptr
,
'c'
},
{
"
data-pad
"
,
required_argument
,
nullptr
,
'b'
},
{
"
padding
"
,
required_argument
,
nullptr
,
'b'
},
{
"cert"
,
required_argument
,
&
flag
,
1
},
{
"cert"
,
required_argument
,
&
flag
,
1
},
{
"key"
,
required_argument
,
&
flag
,
2
},
{
"key"
,
required_argument
,
&
flag
,
2
},
{
"color"
,
no_argument
,
&
flag
,
3
},
{
"color"
,
no_argument
,
&
flag
,
3
},
...
@@ -1766,7 +1766,7 @@ int main(int argc, char **argv)
...
@@ -1766,7 +1766,7 @@ int main(int argc, char **argv)
print_help
(
std
::
cout
);
print_help
(
std
::
cout
);
exit
(
EXIT_SUCCESS
);
exit
(
EXIT_SUCCESS
);
case
'b'
:
case
'b'
:
config
.
pad
_alignment
=
strtol
(
optarg
,
nullptr
,
10
);
config
.
pad
ding_boundary
=
strtol
(
optarg
,
nullptr
,
10
);
break
;
break
;
case
'n'
:
case
'n'
:
config
.
null_out
=
true
;
config
.
null_out
=
true
;
...
...
src/nghttpd.cc
View file @
68b5ffc1
...
@@ -115,8 +115,8 @@ void print_help(std::ostream& out)
...
@@ -115,8 +115,8 @@ void print_help(std::ostream& out)
<<
" -p/=/foo.png -p/doc=/bar.css
\n
"
<<
" -p/=/foo.png -p/doc=/bar.css
\n
"
<<
" PATH and PUSH_PATHs are relative to document
\n
"
<<
" PATH and PUSH_PATHs are relative to document
\n
"
<<
" root. See --htdocs option.
\n
"
<<
" root. See --htdocs option.
\n
"
<<
" -b, --pad
=<ALIGNMENT
>
\n
"
<<
" -b, --pad
ding=<BOUNDARY
>
\n
"
<<
"
Alignment of frame payload padding
.
\n
"
<<
"
Padding boundary for frame payload
.
\n
"
<<
" -h, --help Print this help.
\n
"
<<
" -h, --help Print this help.
\n
"
<<
std
::
endl
;
<<
std
::
endl
;
}
}
...
@@ -136,7 +136,7 @@ int main(int argc, char **argv)
...
@@ -136,7 +136,7 @@ int main(int argc, char **argv)
{
"verify-client"
,
no_argument
,
nullptr
,
'V'
},
{
"verify-client"
,
no_argument
,
nullptr
,
'V'
},
{
"header-table-size"
,
required_argument
,
nullptr
,
'c'
},
{
"header-table-size"
,
required_argument
,
nullptr
,
'c'
},
{
"push"
,
required_argument
,
nullptr
,
'p'
},
{
"push"
,
required_argument
,
nullptr
,
'p'
},
{
"
data-pad
"
,
required_argument
,
nullptr
,
'b'
},
{
"
padding
"
,
required_argument
,
nullptr
,
'b'
},
{
"no-tls"
,
no_argument
,
&
flag
,
1
},
{
"no-tls"
,
no_argument
,
&
flag
,
1
},
{
"color"
,
no_argument
,
&
flag
,
2
},
{
"color"
,
no_argument
,
&
flag
,
2
},
{
nullptr
,
0
,
nullptr
,
0
}
{
nullptr
,
0
,
nullptr
,
0
}
...
@@ -155,7 +155,7 @@ int main(int argc, char **argv)
...
@@ -155,7 +155,7 @@ int main(int argc, char **argv)
config
.
verify_client
=
true
;
config
.
verify_client
=
true
;
break
;
break
;
case
'b'
:
case
'b'
:
config
.
pad
_alignment
=
strtol
(
optarg
,
nullptr
,
10
);
config
.
pad
ding_boundary
=
strtol
(
optarg
,
nullptr
,
10
);
break
;
break
;
case
'd'
:
case
'd'
:
config
.
htdocs
=
optarg
;
config
.
htdocs
=
optarg
;
...
...
tests/nghttp2_session_test.c
View file @
68b5ffc1
...
@@ -3870,7 +3870,7 @@ void test_nghttp2_session_pack_data_with_padding(void)
...
@@ -3870,7 +3870,7 @@ void test_nghttp2_session_pack_data_with_padding(void)
data_prd
.
read_callback
=
fixed_length_data_source_read_callback
;
data_prd
.
read_callback
=
fixed_length_data_source_read_callback
;
nghttp2_session_client_new
(
&
session
,
&
callbacks
,
&
ud
);
nghttp2_session_client_new
(
&
session
,
&
callbacks
,
&
ud
);
session
->
pad
_alignment
=
512
;
session
->
pad
ding_boundary
=
512
;
nghttp2_submit_request
(
session
,
NGHTTP2_PRI_DEFAULT
,
NULL
,
0
,
&
data_prd
,
nghttp2_submit_request
(
session
,
NGHTTP2_PRI_DEFAULT
,
NULL
,
0
,
&
data_prd
,
NULL
);
NULL
);
...
@@ -3881,7 +3881,7 @@ void test_nghttp2_session_pack_data_with_padding(void)
...
@@ -3881,7 +3881,7 @@ void test_nghttp2_session_pack_data_with_padding(void)
CU_ASSERT
(
NGHTTP2_HEADERS
==
ud
.
sent_frame_type
);
CU_ASSERT
(
NGHTTP2_HEADERS
==
ud
.
sent_frame_type
);
frame
=
OB_DATA
(
session
->
aob
.
item
);
frame
=
OB_DATA
(
session
->
aob
.
item
);
CU_ASSERT
(
session
->
pad
_alignment
-
datalen
==
frame
->
padlen
);
CU_ASSERT
(
session
->
pad
ding_boundary
-
datalen
==
frame
->
padlen
);
CU_ASSERT
(
frame
->
hd
.
flags
&
NGHTTP2_FLAG_PAD_LOW
);
CU_ASSERT
(
frame
->
hd
.
flags
&
NGHTTP2_FLAG_PAD_LOW
);
CU_ASSERT
(
frame
->
hd
.
flags
&
NGHTTP2_FLAG_PAD_HIGH
);
CU_ASSERT
(
frame
->
hd
.
flags
&
NGHTTP2_FLAG_PAD_HIGH
);
...
@@ -3905,7 +3905,7 @@ void test_nghttp2_session_pack_data_with_padding(void)
...
@@ -3905,7 +3905,7 @@ void test_nghttp2_session_pack_data_with_padding(void)
CU_ASSERT
(
NGHTTP2_HEADERS
==
ud
.
sent_frame_type
);
CU_ASSERT
(
NGHTTP2_HEADERS
==
ud
.
sent_frame_type
);
frame
=
OB_DATA
(
session
->
aob
.
item
);
frame
=
OB_DATA
(
session
->
aob
.
item
);
CU_ASSERT
((
frame
->
padlen
+
datalen
)
%
session
->
pad
_alignment
==
0
);
CU_ASSERT
((
frame
->
padlen
+
datalen
)
%
session
->
pad
ding_boundary
==
0
);
CU_ASSERT
(
frame
->
hd
.
flags
&
NGHTTP2_FLAG_PAD_LOW
);
CU_ASSERT
(
frame
->
hd
.
flags
&
NGHTTP2_FLAG_PAD_LOW
);
CU_ASSERT
(
0
==
(
frame
->
hd
.
flags
&
NGHTTP2_FLAG_PAD_HIGH
));
CU_ASSERT
(
0
==
(
frame
->
hd
.
flags
&
NGHTTP2_FLAG_PAD_HIGH
));
...
...
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