Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
librist
Manage
Activity
Members
Labels
Plan
Issues
30
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
rist
librist
Commits
61c87ba1
Commit
61c87ba1
authored
3 months ago
by
Sergio Ammirata
Browse files
Options
Downloads
Patches
Plain Diff
cleanup all compile warnings
parent
41b504c1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!270
Add udp2udp application to the project
Pipeline
#548172
passed with stages
in 1 minute and 34 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/udp2udp.c
+8
-4
8 additions, 4 deletions
tools/udp2udp.c
with
8 additions
and
4 deletions
tools/udp2udp.c
+
8
−
4
View file @
61c87ba1
...
...
@@ -134,6 +134,7 @@ static void input_udp_recv(struct evsocket_ctx *evctx, int fd, short revents, vo
struct
udpheader
udphdr
;
size_t
ipheader_bytes
=
sizeof
(
ipv4hdr
)
+
sizeof
(
udphdr
);
socklen_t
addrlen
=
0
;
RIST_MARK_UNUSED
(
addr
);
uint16_t
address_family
=
(
uint16_t
)
callback_object
->
udp_config
->
address_family
;
if
(
address_family
==
AF_INET6
)
{
...
...
@@ -152,6 +153,7 @@ static void input_udp_recv(struct evsocket_ctx *evctx, int fd, short revents, vo
if
(
!
callback_object
->
output_udp_config
[
i
])
continue
;
struct
rist_udp_config
*
udp_config
=
callback_object
->
output_udp_config
[
i
];
RIST_MARK_UNUSED
(
udp_config
);
if
(
callback_object
->
out_sd
[
i
]
>
0
)
{
int
ret
=
udpsocket_send
(
callback_object
->
out_sd
[
i
],
recv_buf
,
recv_bufsize
);
if
(
ret
<=
0
&&
errno
!=
ECONNREFUSED
)
...
...
@@ -207,6 +209,7 @@ int main(int argc, char *argv[])
pthread_t
thread_main_loop
=
{
0
};
rist_tools_config_object
*
yaml_config
=
NULL
;
char
*
yamlfile
=
NULL
;
unsigned
i
=
0
;
event
=
NULL
;
...
...
@@ -348,7 +351,7 @@ int main(int argc, char *argv[])
}
#endif
for
(
size_t
i
=
0
;
i
<
MAX_OUTPUT_COUNT
;
i
++
)
for
(
i
=
0
;
i
<
MAX_OUTPUT_COUNT
;
i
++
)
{
callback_object
.
out_sd
[
i
]
=
0
;
callback_object
.
output_udp_config
[
i
]
=
NULL
;
...
...
@@ -405,7 +408,7 @@ int main(int argc, char *argv[])
atleast_one_socket_opened
=
false
;
char
*
saveptr2
;
char
*
outputtoken
=
strtok_r
(
outputurl
,
","
,
&
saveptr2
);
for
(
size_t
i
=
0
;
i
<
MAX_OUTPUT_COUNT
;
i
++
)
{
for
(
i
=
0
;
i
<
MAX_OUTPUT_COUNT
;
i
++
)
{
if
(
!
outputtoken
)
break
;
...
...
@@ -416,7 +419,8 @@ int main(int argc, char *argv[])
goto
next
;
}
// Now parse the host and port
char
hostname
[
200
]
=
{
0
};
memset
(
&
hostname
,
0
,
sizeof
(
hostname
));
int
outputlisten
;
uint16_t
outputport
;
if
(
udpsocket_parse_url
((
void
*
)
output_udp_config
->
address
,
hostname
,
200
,
&
outputport
,
&
outputlisten
)
||
!
outputport
||
strlen
(
hostname
)
==
0
)
{
...
...
@@ -472,7 +476,7 @@ shutdown:
rist_udp_config_free2
(
&
callback_object
.
udp_config
);
// Cleanup for output
for
(
size_t
i
=
0
;
i
<
MAX_OUTPUT_COUNT
;
i
++
)
{
for
(
i
=
0
;
i
<
MAX_OUTPUT_COUNT
;
i
++
)
{
// Free output_udp_config object
if
((
void
*
)
callback_object
.
output_udp_config
[
i
])
rist_udp_config_free2
(
&
callback_object
.
output_udp_config
[
i
]);
...
...
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