Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
code
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
ReadMailReallyFast
code
Commits
32dbd80d
Commit
32dbd80d
authored
2 years ago
by
Leon Dietrich
Browse files
Options
Downloads
Patches
Plain Diff
fix: compiling on FreeBSD and typename info
parent
e20c2202
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#7691
failed
2 years ago
Stage: prebuild
Stage: build
Stage: testing
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/net/sock_address_factory.cpp
+5
-0
5 additions, 0 deletions
src/net/sock_address_factory.cpp
src/net/udp_client.hpp
+5
-0
5 additions, 0 deletions
src/net/udp_client.hpp
src/net/udp_packet.hpp
+4
-4
4 additions, 4 deletions
src/net/udp_packet.hpp
with
14 additions
and
4 deletions
src/net/sock_address_factory.cpp
+
5
−
0
View file @
32dbd80d
...
...
@@ -19,8 +19,10 @@ namespace rmrf::net {
std
::
string
format_network_error
(
int
error
)
{
switch
(
error
)
{
#ifdef __linux__
case
EAI_ADDRFAMILY
:
return
"There was no compatible address for the requested families. (EAI_ADDRFAMILY)"
;
#endif
case
EAI_AGAIN
:
return
"The consulted DNS server reported a temporary lookup failure. Try again later. (EAI_AGAIN)"
;
case
EAI_BADFLAGS
:
...
...
@@ -31,8 +33,10 @@ namespace rmrf::net {
return
"The required protocol family is not supported by this host. (EAI_FAMILY)"
;
case
EAI_MEMORY
:
return
"Out of Memory while performing DNS lookup. (EAI_MEMORY)"
;
#ifdef __linux__
case
EAI_NODATA
:
return
"The requested DNS entry does not contain an A or AAAA entry. (EAI_NODATA)"
;
#endif
case
EAI_NONAME
:
return
"There was no matching nodename, service tuple. (EAI_NONAME)"
;
case
EAI_SERVICE
:
...
...
@@ -42,6 +46,7 @@ namespace rmrf::net {
default:
return
std
::
to_string
(
error
);
}
// TODO implement EAI_OVERFLOW, EAI_PROTOCOL, EAI_BADHINTS, EAI_SYSTEM (*BSD specific)
}
bool
decode_address
(
std
::
list
<
socketaddr
>
&
l
,
addrinfo
*
looked_up_addrs
,
const
int
port
)
{
...
...
This diff is collapsed.
Click to expand it.
src/net/udp_client.hpp
+
5
−
0
View file @
32dbd80d
...
...
@@ -77,14 +77,19 @@ public:
* device handling the send packet shall report if the path was viable or not. This
* is useful for debugging but may negatively impact performance.
* @brief Enable or disable UDP confirm mode
* @note This is only enabled if MSG_CONFIRM is enabled on your platform.
* @param enabled If set to true the UDP confirm mode will be activated.
*/
void
enable_confirm_mode
(
bool
enabled
)
{
#ifdef MSG_CONFIRM
if
(
enabled
)
{
this
->
send_flags
|=
MSG_CONFIRM
;
}
else
{
this
->
send_flags
&=
~
MSG_CONFIRM
;
}
#else
MARK_UNUSED
(
enabled
);
#endif
};
protected
:
...
...
This diff is collapsed.
Click to expand it.
src/net/udp_packet.hpp
+
4
−
4
View file @
32dbd80d
...
...
@@ -71,19 +71,19 @@ public:
return
this
->
arr
.
data
();
}
constexpr
std
::
array
<
uint8_t
,
pkg_size
>::
iterator
begin
()
noexcept
{
constexpr
typename
std
::
array
<
uint8_t
,
pkg_size
>::
iterator
begin
()
noexcept
{
return
this
->
arr
.
begin
();
}
constexpr
std
::
array
<
uint8_t
,
pkg_size
>::
iterator
end
()
noexcept
{
constexpr
typename
std
::
array
<
uint8_t
,
pkg_size
>::
iterator
end
()
noexcept
{
return
this
->
arr
.
end
();
}
constexpr
std
::
array
<
uint8_t
,
pkg_size
>::
const_iterator
cbegin
()
const
noexcept
{
constexpr
typename
std
::
array
<
uint8_t
,
pkg_size
>::
const_iterator
cbegin
()
const
noexcept
{
return
this
->
arr
.
cbegin
();
}
constexpr
std
::
array
<
uint8_t
,
pkg_size
>::
const_iterator
cend
()
const
noexcept
{
constexpr
typename
std
::
array
<
uint8_t
,
pkg_size
>::
const_iterator
cend
()
const
noexcept
{
return
this
->
arr
.
cend
();
}
...
...
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