Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
libnice
Commits
f92750a9
Commit
f92750a9
authored
Jan 20, 2007
by
Dafydd Harries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fake UDP: simplify Packet struct
darcs-hash:20070120033445-c9803-09408144ece3f71be9f9631501de29bc4fd5aa39.gz
parent
9b2d4301
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
udp/udp-fake.c
udp/udp-fake.c
+5
-6
No files found.
udp/udp-fake.c
View file @
f92750a9
...
...
@@ -11,8 +11,7 @@ typedef struct _Packet Packet;
struct
_Packet
{
struct
sockaddr_in
from
;
struct
sockaddr_in
to
;
struct
sockaddr_in
sin
;
guint
len
;
gchar
buf
[
1024
];
};
...
...
@@ -54,7 +53,7 @@ fake_send (
packet
=
g_slice_new0
(
Packet
);
packet
->
len
=
len
;
packet
->
to
=
*
to
;
packet
->
sin
=
*
to
;
strncpy
(
packet
->
buf
,
buf
,
len
);
man
=
(
UDPSocketManager
*
)
sock
->
priv
;
...
...
@@ -87,7 +86,7 @@ fake_recv (
len
=
packet
->
len
;
memcpy
(
buf
,
packet
->
buf
,
len
);
memcpy
(
from
,
&
(
packet
->
from
),
sizeof
(
*
from
));
memcpy
(
from
,
&
(
packet
->
sin
),
sizeof
(
*
from
));
g_slice_free
(
Packet
,
packet
);
return
len
;
...
...
@@ -117,7 +116,7 @@ udp_fake_socket_manager_push_recv (
packet
=
g_slice_new0
(
Packet
);
packet
->
len
=
len
;
packet
->
from
=
*
from
;
packet
->
sin
=
*
from
;
strncpy
(
packet
->
buf
,
buf
,
len
);
priv
=
(
UDPFakeSocketManagerPriv
*
)
man
->
priv
;
...
...
@@ -140,7 +139,7 @@ udp_fake_socket_manager_pop_send (
if
(
!
packet
)
return
0
;
*
to
=
packet
->
to
;
*
to
=
packet
->
sin
;
return
packet
->
len
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment