Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opendht
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
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
opendht
Commits
c3ad3368
Commit
c3ad3368
authored
2 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
misc: fix various warnings
parent
9c5e5cd7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/http.cpp
+4
-0
4 additions, 0 deletions
src/http.cpp
src/network_utils.cpp
+2
-0
2 additions, 0 deletions
src/network_utils.cpp
tests/dhtproxytester.cpp
+2
-2
2 additions, 2 deletions
tests/dhtproxytester.cpp
tests/dhtrunnertester.cpp
+0
-1
0 additions, 1 deletion
tests/dhtrunnertester.cpp
with
8 additions
and
3 deletions
src/http.cpp
+
4
−
0
View file @
c3ad3368
...
@@ -567,6 +567,8 @@ Connection::async_connect(std::vector<asio::ip::tcp::endpoint>&& endpoints, Conn
...
@@ -567,6 +567,8 @@ Connection::async_connect(std::vector<asio::ip::tcp::endpoint>&& endpoints, Conn
}
}
auto
&
base
=
ssl_socket_
?
ssl_socket_
->
lowest_layer
()
:
*
socket_
;
auto
&
base
=
ssl_socket_
?
ssl_socket_
->
lowest_layer
()
:
*
socket_
;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
ConnectHandlerCb
wcb
=
[
&
base
,
cb
=
std
::
move
(
cb
)](
const
asio
::
error_code
&
ec
,
const
asio
::
ip
::
tcp
::
endpoint
&
endpoint
)
{
ConnectHandlerCb
wcb
=
[
&
base
,
cb
=
std
::
move
(
cb
)](
const
asio
::
error_code
&
ec
,
const
asio
::
ip
::
tcp
::
endpoint
&
endpoint
)
{
if
(
!
ec
)
{
if
(
!
ec
)
{
auto
socket
=
base
.
native_handle
();
auto
socket
=
base
.
native_handle
();
...
@@ -614,6 +616,8 @@ Connection::async_connect(std::vector<asio::ip::tcp::endpoint>&& endpoints, Conn
...
@@ -614,6 +616,8 @@ Connection::async_connect(std::vector<asio::ip::tcp::endpoint>&& endpoints, Conn
if
(
cb
)
if
(
cb
)
cb
(
ec
,
endpoint
);
cb
(
ec
,
endpoint
);
};
};
#pragma GCC diagnostic pop
if
(
ssl_socket_
)
if
(
ssl_socket_
)
asio
::
async_connect
(
ssl_socket_
->
lowest_layer
(),
std
::
move
(
endpoints
),
wrapCallabck
(
std
::
move
(
wcb
)));
asio
::
async_connect
(
ssl_socket_
->
lowest_layer
(),
std
::
move
(
endpoints
),
wrapCallabck
(
std
::
move
(
wcb
)));
else
else
...
...
This diff is collapsed.
Click to expand it.
src/network_utils.cpp
+
2
−
0
View file @
c3ad3368
...
@@ -148,6 +148,8 @@ UdpSocket::sendTo(const SockAddr& dest, const uint8_t* data, size_t size, bool r
...
@@ -148,6 +148,8 @@ UdpSocket::sendTo(const SockAddr& dest, const uint8_t* data, size_t size, bool r
#ifdef MSG_CONFIRM
#ifdef MSG_CONFIRM
if
(
replied
)
if
(
replied
)
flags
|=
MSG_CONFIRM
;
flags
|=
MSG_CONFIRM
;
#else
(
void
)
replied
;
#endif
#endif
#ifdef MSG_NOSIGNAL
#ifdef MSG_NOSIGNAL
flags
|=
MSG_NOSIGNAL
;
flags
|=
MSG_NOSIGNAL
;
...
...
This diff is collapsed.
Click to expand it.
tests/dhtproxytester.cpp
+
2
−
2
View file @
c3ad3368
...
@@ -309,13 +309,13 @@ DhtProxyTester::testShutdownStop()
...
@@ -309,13 +309,13 @@ DhtProxyTester::testShutdownStop()
for
(
size_t
i
=
0
;
i
<
C
;
i
++
)
{
for
(
size_t
i
=
0
;
i
<
C
;
i
++
)
{
auto
nodeTest
=
std
::
make_shared
<
dht
::
DhtRunner
>
();
auto
nodeTest
=
std
::
make_shared
<
dht
::
DhtRunner
>
();
nodeTest
->
run
(
0
,
clientConfig
);
nodeTest
->
run
(
0
,
clientConfig
);
nodeTest
->
put
(
key
,
dht
::
Value
(
mtu
),
[
&
](
bool
ok
)
{
nodeTest
->
put
(
key
,
dht
::
Value
(
mtu
),
[
&
](
bool
/*ok*/
)
{
callback_count
++
;
callback_count
++
;
});
});
nodeTest
->
get
(
key
,
[
&
](
const
std
::
vector
<
std
::
shared_ptr
<
dht
::
Value
>>&
vals
){
nodeTest
->
get
(
key
,
[
&
](
const
std
::
vector
<
std
::
shared_ptr
<
dht
::
Value
>>&
vals
){
values
.
insert
(
values
.
end
(),
vals
.
begin
(),
vals
.
end
());
values
.
insert
(
values
.
end
(),
vals
.
begin
(),
vals
.
end
());
return
true
;
return
true
;
},[
&
](
bool
ok
){
},[
&
](
bool
/*ok*/
){
callback_count
++
;
callback_count
++
;
});
});
bool
done
=
false
;
bool
done
=
false
;
...
...
This diff is collapsed.
Click to expand it.
tests/dhtrunnertester.cpp
+
0
−
1
View file @
c3ad3368
...
@@ -94,7 +94,6 @@ void
...
@@ -94,7 +94,6 @@ void
DhtRunnerTester
::
testListen
()
{
DhtRunnerTester
::
testListen
()
{
std
::
mutex
mutex
;
std
::
mutex
mutex
;
std
::
condition_variable
cv
;
std
::
condition_variable
cv
;
std
::
atomic_uint
valueCount
(
0
);
std
::
atomic_uint
valueCounta
(
0
);
std
::
atomic_uint
valueCounta
(
0
);
std
::
atomic_uint
valueCountb
(
0
);
std
::
atomic_uint
valueCountb
(
0
);
std
::
atomic_uint
valueCountc
(
0
);
std
::
atomic_uint
valueCountc
(
0
);
...
...
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