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
ae0bac56
Commit
ae0bac56
authored
Feb 26, 2012
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added -3, --spdy3 option to spdycat.
parent
036efc10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
8 deletions
+24
-8
examples/spdycat.cc
examples/spdycat.cc
+13
-2
examples/spdylay_ssl.cc
examples/spdylay_ssl.cc
+11
-6
No files found.
examples/spdycat.cc
View file @
ae0bac56
...
...
@@ -61,7 +61,9 @@ struct Config {
bool
null_out
;
bool
remote_name
;
bool
verbose
;
Config
()
:
null_out
(
false
),
remote_name
(
false
),
verbose
(
false
)
{}
bool
spdy3_only
;
Config
()
:
null_out
(
false
),
remote_name
(
false
),
verbose
(
false
),
spdy3_only
(
false
)
{}
};
struct
Request
{
...
...
@@ -145,6 +147,9 @@ int communicate(const std::string& host, uint16_t port,
return
-
1
;
}
std
::
string
next_proto
;
if
(
config
.
spdy3_only
)
{
next_proto
=
"spdy/3"
;
}
setup_ssl_ctx
(
ssl_ctx
,
&
next_proto
);
SSL
*
ssl
=
SSL_new
(
ssl_ctx
);
if
(
!
ssl
)
{
...
...
@@ -275,6 +280,8 @@ void print_help(std::ostream& out)
<<
" The filename is dereived from URI. If URI
\n
"
<<
" ends with '/', 'index.html' is used as a
\n
"
<<
" filename. Not implemented yet.
\n
"
<<
" -3, --spdy3 Only use SPDY/3.
\n
"
<<
"
\n
"
<<
std
::
endl
;
}
...
...
@@ -285,11 +292,12 @@ int main(int argc, char **argv)
{
"verbose"
,
no_argument
,
0
,
'v'
},
{
"null-out"
,
no_argument
,
0
,
'n'
},
{
"remote-name"
,
no_argument
,
0
,
'O'
},
{
"spdy3"
,
no_argument
,
0
,
'3'
},
{
"help"
,
no_argument
,
0
,
'h'
},
{
0
,
0
,
0
,
0
}
};
int
option_index
=
0
;
int
c
=
getopt_long
(
argc
,
argv
,
"Onhv"
,
long_options
,
&
option_index
);
int
c
=
getopt_long
(
argc
,
argv
,
"Onhv
3
"
,
long_options
,
&
option_index
);
if
(
c
==
-
1
)
{
break
;
}
...
...
@@ -306,6 +314,9 @@ int main(int argc, char **argv)
case
'v'
:
config
.
verbose
=
true
;
break
;
case
'3'
:
config
.
spdy3_only
=
true
;
break
;
case
'?'
:
exit
(
EXIT_FAILURE
);
default:
...
...
examples/spdylay_ssl.cc
View file @
ae0bac56
...
...
@@ -470,13 +470,18 @@ int select_next_proto_cb(SSL* ssl,
std
::
cout
<<
std
::
endl
;
}
}
if
(
spdylay_select_next_protocol
(
out
,
outlen
,
in
,
inlen
)
!=
1
)
{
std
::
cerr
<<
"Server did not advertise spdy/2 or spdy/3 protocol."
<<
std
::
endl
;
abort
();
std
::
string
&
next_proto
=
*
(
std
::
string
*
)
arg
;
if
(
next_proto
.
empty
())
{
if
(
spdylay_select_next_protocol
(
out
,
outlen
,
in
,
inlen
)
!=
1
)
{
std
::
cerr
<<
"Server did not advertise spdy/2 or spdy/3 protocol."
<<
std
::
endl
;
abort
();
}
else
{
next_proto
.
assign
(
&
(
*
out
)[
0
],
&
(
*
out
)[
*
outlen
]);
}
}
else
{
std
::
string
&
next_proto
=
*
(
std
::
string
*
)
arg
;
next_proto
.
assign
(
&
(
*
out
)[
0
],
&
(
*
out
)[
*
outlen
]
);
*
out
=
(
unsigned
char
*
)(
next_proto
.
c_str
())
;
*
outlen
=
next_proto
.
size
(
);
}
if
(
ssl_debug
)
{
std
::
cout
<<
" NPN selected the protocol: "
...
...
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