Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mtxclient
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
mtxclient
Commits
4d518dbb
Commit
4d518dbb
authored
5 years ago
by
Nicolas Werner
Browse files
Options
Downloads
Patches
Plain Diff
Try to fix ssl double free by synchronising via a strand
parent
5cc8bced
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/http/session.cpp
+8
-2
8 additions, 2 deletions
lib/http/session.cpp
with
8 additions
and
2 deletions
lib/http/session.cpp
+
8
−
2
View file @
4d518dbb
#include
"mtxclient/http/session.hpp"
#include
<boost/asio/strand.hpp>
#include
<iostream>
using
namespace
mtx
::
http
;
...
...
@@ -11,8 +13,12 @@ Session::Session(boost::asio::io_service &ios,
RequestID
id
,
SuccessCallback
on_success
,
FailureCallback
on_failure
)
:
resolver_
(
ios
)
,
socket
(
ios
,
ssl_ctx
)
// Use a strand for synchronisation.
// I don't know, if we need to use the same strand for both the socket and the resolver or if one
// for each works as well. Taken from this example:
// https://www.boost.org/doc/libs/1_71_0/libs/beast/example/http/client/async-ssl/http_client_async_ssl.cpp
:
resolver_
(
boost
::
asio
::
make_strand
(
ios
))
,
socket
(
boost
::
asio
::
make_strand
(
ios
),
ssl_ctx
)
,
host
(
std
::
move
(
host
))
,
port
{
port
}
,
id
(
std
::
move
(
id
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment