Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository 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
savoirfairelinux
jami-daemon
Commits
f2efc4b3
Commit
f2efc4b3
authored
7 years ago
by
Guillaume Roguez
Browse files
Options
Downloads
Patches
Plain Diff
data tx: fix socket close when peer has been joigned
Change-Id: Ida39c9b3a30496061f37a4c1a13758dccf06d134
parent
da922199
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/data_transfer.cpp
+7
-1
7 additions, 1 deletion
src/data_transfer.cpp
with
7 additions
and
1 deletion
src/data_transfer.cpp
+
7
−
1
View file @
f2efc4b3
...
@@ -64,10 +64,15 @@ public:
...
@@ -64,10 +64,15 @@ public:
virtual
void
accept
(
const
std
::
string
&
,
std
::
size_t
)
{};
virtual
void
accept
(
const
std
::
string
&
,
std
::
size_t
)
{};
virtual
bool
start
()
{
virtual
bool
start
()
{
wasStarted_
=
true
;
bool
expected
=
false
;
bool
expected
=
false
;
return
started_
.
compare_exchange_strong
(
expected
,
true
);
return
started_
.
compare_exchange_strong
(
expected
,
true
);
}
}
bool
hasBeenStarted
()
const
{
return
wasStarted_
;
}
void
close
()
noexcept
override
{
void
close
()
noexcept
override
{
started_
=
false
;
started_
=
false
;
}
}
...
@@ -91,6 +96,7 @@ protected:
...
@@ -91,6 +96,7 @@ protected:
mutable
std
::
mutex
infoMutex_
;
mutable
std
::
mutex
infoMutex_
;
mutable
DRing
::
DataTransferInfo
info_
;
mutable
DRing
::
DataTransferInfo
info_
;
std
::
atomic_bool
started_
{
false
};
std
::
atomic_bool
started_
{
false
};
std
::
atomic_bool
wasStarted_
{
false
};
};
};
void
void
...
@@ -394,7 +400,7 @@ DataTransferFacade::Impl::onConnectionRequestReply(const DRing::DataTransferId&
...
@@ -394,7 +400,7 @@ DataTransferFacade::Impl::onConnectionRequestReply(const DRing::DataTransferId&
if
(
transfer
->
start
())
{
if
(
transfer
->
start
())
{
connection
->
attachInputStream
(
transfer
);
connection
->
attachInputStream
(
transfer
);
}
}
}
else
{
}
else
if
(
not
transfer
->
hasBeenStarted
())
{
transfer
->
emit
(
DRing
::
DataTransferEventCode
::
unjoinable_peer
);
transfer
->
emit
(
DRing
::
DataTransferEventCode
::
unjoinable_peer
);
cancel
(
*
transfer
);
cancel
(
*
transfer
);
}
}
...
...
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