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
c6d8c401
Commit
c6d8c401
authored
Jul 23, 2018
by
Alexandros Konstantinakis-Karmis
Committed by
Tatsuhiro Tsujikawa
Aug 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support definition of local endpoint for cleartext client session
parent
e5b3f9ad
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
12 deletions
+52
-12
src/asio_client_session.cc
src/asio_client_session.cc
+18
-0
src/asio_client_session_tcp_impl.cc
src/asio_client_session_tcp_impl.cc
+19
-12
src/asio_client_session_tcp_impl.h
src/asio_client_session_tcp_impl.h
+4
-0
src/includes/nghttp2/asio_http2_client.h
src/includes/nghttp2/asio_http2_client.h
+11
-0
No files found.
src/asio_client_session.cc
View file @
c6d8c401
...
...
@@ -44,6 +44,15 @@ session::session(boost::asio::io_service &io_service, const std::string &host,
impl_
->
start_resolve
(
host
,
service
);
}
session
::
session
(
boost
::
asio
::
io_service
&
io_service
,
const
boost
::
asio
::
ip
::
tcp
::
endpoint
&
local_endpoint
,
const
std
::
string
&
host
,
const
std
::
string
&
service
)
:
impl_
(
std
::
make_shared
<
session_tcp_impl
>
(
io_service
,
local_endpoint
,
host
,
service
,
boost
::
posix_time
::
seconds
(
60
)))
{
impl_
->
start_resolve
(
host
,
service
);
}
session
::
session
(
boost
::
asio
::
io_service
&
io_service
,
const
std
::
string
&
host
,
const
std
::
string
&
service
,
const
boost
::
posix_time
::
time_duration
&
connect_timeout
)
...
...
@@ -52,6 +61,15 @@ session::session(boost::asio::io_service &io_service, const std::string &host,
impl_
->
start_resolve
(
host
,
service
);
}
session
::
session
(
boost
::
asio
::
io_service
&
io_service
,
const
boost
::
asio
::
ip
::
tcp
::
endpoint
&
local_endpoint
,
const
std
::
string
&
host
,
const
std
::
string
&
service
,
const
boost
::
posix_time
::
time_duration
&
connect_timeout
)
:
impl_
(
std
::
make_shared
<
session_tcp_impl
>
(
io_service
,
local_endpoint
,
host
,
service
,
connect_timeout
))
{
impl_
->
start_resolve
(
host
,
service
);
}
session
::
session
(
boost
::
asio
::
io_service
&
io_service
,
boost
::
asio
::
ssl
::
context
&
tls_ctx
,
const
std
::
string
&
host
,
const
std
::
string
&
service
)
...
...
src/asio_client_session_tcp_impl.cc
View file @
c6d8c401
...
...
@@ -34,24 +34,31 @@ session_tcp_impl::session_tcp_impl(
const
boost
::
posix_time
::
time_duration
&
connect_timeout
)
:
session_impl
(
io_service
,
connect_timeout
),
socket_
(
io_service
)
{}
session_tcp_impl
::
session_tcp_impl
(
boost
::
asio
::
io_service
&
io_service
,
const
boost
::
asio
::
ip
::
tcp
::
endpoint
&
local_endpoint
,
const
std
::
string
&
host
,
const
std
::
string
&
service
,
const
boost
::
posix_time
::
time_duration
&
connect_timeout
)
:
session_impl
(
io_service
,
connect_timeout
),
socket_
(
io_service
,
local_endpoint
)
{}
session_tcp_impl
::~
session_tcp_impl
()
{}
void
session_tcp_impl
::
start_connect
(
tcp
::
resolver
::
iterator
endpoint_it
)
{
auto
self
=
shared_from_this
();
boost
::
asio
::
async_connect
(
socket_
,
endpoint_it
,
[
self
](
const
boost
::
system
::
error_code
&
ec
,
tcp
::
resolver
::
iterator
endpoint_it
)
{
if
(
self
->
stopped
())
{
return
;
}
socket_
.
async_connect
(
*
endpoint_it
,
[
self
,
endpoint_it
](
const
boost
::
system
::
error_code
&
ec
)
{
if
(
self
->
stopped
())
{
return
;
}
if
(
ec
)
{
self
->
not_connected
(
ec
);
return
;
}
if
(
ec
)
{
self
->
not_connected
(
ec
);
return
;
}
self
->
connected
(
endpoint_it
);
});
self
->
connected
(
endpoint_it
);
});
}
tcp
::
socket
&
session_tcp_impl
::
socket
()
{
return
socket_
;
}
...
...
src/asio_client_session_tcp_impl.h
View file @
c6d8c401
...
...
@@ -40,6 +40,10 @@ public:
session_tcp_impl
(
boost
::
asio
::
io_service
&
io_service
,
const
std
::
string
&
host
,
const
std
::
string
&
service
,
const
boost
::
posix_time
::
time_duration
&
connect_timeout
);
session_tcp_impl
(
boost
::
asio
::
io_service
&
io_service
,
const
boost
::
asio
::
ip
::
tcp
::
endpoint
&
local_endpoint
,
const
std
::
string
&
host
,
const
std
::
string
&
service
,
const
boost
::
posix_time
::
time_duration
&
connect_timeout
);
virtual
~
session_tcp_impl
();
virtual
void
start_connect
(
tcp
::
resolver
::
iterator
endpoint_it
);
...
...
src/includes/nghttp2/asio_http2_client.h
View file @
c6d8c401
...
...
@@ -150,6 +150,11 @@ public:
session
(
boost
::
asio
::
io_service
&
io_service
,
const
std
::
string
&
host
,
const
std
::
string
&
service
);
// Same as previous but with pegged local endpoint
session
(
boost
::
asio
::
io_service
&
io_service
,
const
boost
::
asio
::
ip
::
tcp
::
endpoint
&
local_endpoint
,
const
std
::
string
&
host
,
const
std
::
string
&
service
);
// Starts HTTP/2 session by connecting to |host| and |service|
// (e.g., "80") using clear text TCP connection with given connect
// timeout.
...
...
@@ -157,6 +162,12 @@ public:
const
std
::
string
&
service
,
const
boost
::
posix_time
::
time_duration
&
connect_timeout
);
// Same as previous but with pegged local endpoint
session
(
boost
::
asio
::
io_service
&
io_service
,
const
boost
::
asio
::
ip
::
tcp
::
endpoint
&
local_endpoint
,
const
std
::
string
&
host
,
const
std
::
string
&
service
,
const
boost
::
posix_time
::
time_duration
&
connect_timeout
);
// Starts HTTP/2 session by connecting to |host| and |service|
// (e.g., "443") using encrypted SSL/TLS connection with connect
// timeout 60 seconds.
...
...
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