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
a7a7b1df
Commit
a7a7b1df
authored
Jan 31, 2014
by
Olivier Crête
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pseudotcp: Remove one duplicated call to g_get_monotonic_time()
parent
faa90dda
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
agent/pseudotcp.c
agent/pseudotcp.c
+7
-8
No files found.
agent/pseudotcp.c
View file @
a7a7b1df
...
@@ -498,7 +498,7 @@ static void queue_connect_message (PseudoTcpSocket *self);
...
@@ -498,7 +498,7 @@ static void queue_connect_message (PseudoTcpSocket *self);
static
guint32
queue
(
PseudoTcpSocket
*
self
,
const
gchar
*
data
,
static
guint32
queue
(
PseudoTcpSocket
*
self
,
const
gchar
*
data
,
guint32
len
,
gboolean
bCtrl
);
guint32
len
,
gboolean
bCtrl
);
static
PseudoTcpWriteResult
packet
(
PseudoTcpSocket
*
self
,
guint32
seq
,
static
PseudoTcpWriteResult
packet
(
PseudoTcpSocket
*
self
,
guint32
seq
,
guint8
flags
,
guint32
offset
,
guint32
len
);
guint8
flags
,
guint32
offset
,
guint32
len
,
guint32
now
);
static
gboolean
parse
(
PseudoTcpSocket
*
self
,
static
gboolean
parse
(
PseudoTcpSocket
*
self
,
const
guint8
*
_header_buf
,
gsize
header_buf_len
,
const
guint8
*
_header_buf
,
gsize
header_buf_len
,
const
guint8
*
data_buf
,
gsize
data_buf_len
);
const
guint8
*
data_buf
,
gsize
data_buf_len
);
...
@@ -862,7 +862,7 @@ pseudo_tcp_socket_notify_clock(PseudoTcpSocket *self)
...
@@ -862,7 +862,7 @@ pseudo_tcp_socket_notify_clock(PseudoTcpSocket *self)
}
}
// probe the window
// probe the window
packet
(
self
,
priv
->
snd_nxt
-
1
,
0
,
0
,
0
);
packet
(
self
,
priv
->
snd_nxt
-
1
,
0
,
0
,
0
,
now
);
priv
->
lastsend
=
now
;
priv
->
lastsend
=
now
;
// back off retransmit timer
// back off retransmit timer
...
@@ -871,7 +871,7 @@ pseudo_tcp_socket_notify_clock(PseudoTcpSocket *self)
...
@@ -871,7 +871,7 @@ pseudo_tcp_socket_notify_clock(PseudoTcpSocket *self)
// Check if it's time to send delayed acks
// Check if it's time to send delayed acks
if
(
priv
->
t_ack
&&
(
time_diff
(
priv
->
t_ack
+
priv
->
ack_delay
,
now
)
<=
0
))
{
if
(
priv
->
t_ack
&&
(
time_diff
(
priv
->
t_ack
+
priv
->
ack_delay
,
now
)
<=
0
))
{
packet
(
self
,
priv
->
snd_nxt
,
0
,
0
,
0
);
packet
(
self
,
priv
->
snd_nxt
,
0
,
0
,
0
,
now
);
}
}
}
}
...
@@ -1105,10 +1105,9 @@ queue(PseudoTcpSocket *self, const gchar * data, guint32 len, gboolean bCtrl)
...
@@ -1105,10 +1105,9 @@ queue(PseudoTcpSocket *self, const gchar * data, guint32 len, gboolean bCtrl)
static
PseudoTcpWriteResult
static
PseudoTcpWriteResult
packet
(
PseudoTcpSocket
*
self
,
guint32
seq
,
guint8
flags
,
packet
(
PseudoTcpSocket
*
self
,
guint32
seq
,
guint8
flags
,
guint32
offset
,
guint32
len
)
guint32
offset
,
guint32
len
,
guint32
now
)
{
{
PseudoTcpSocketPrivate
*
priv
=
self
->
priv
;
PseudoTcpSocketPrivate
*
priv
=
self
->
priv
;
guint32
now
=
get_current_time
();
union
{
union
{
guint8
u8
[
MAX_PACKET
];
guint8
u8
[
MAX_PACKET
];
guint16
u16
[
MAX_PACKET
/
2
];
guint16
u16
[
MAX_PACKET
/
2
];
...
@@ -1542,7 +1541,7 @@ transmit(PseudoTcpSocket *self, SSegment *segment, guint32 now)
...
@@ -1542,7 +1541,7 @@ transmit(PseudoTcpSocket *self, SSegment *segment, guint32 now)
guint32
seq
=
segment
->
seq
;
guint32
seq
=
segment
->
seq
;
guint8
flags
=
(
segment
->
bCtrl
?
FLAG_CTL
:
0
);
guint8
flags
=
(
segment
->
bCtrl
?
FLAG_CTL
:
0
);
PseudoTcpWriteResult
wres
=
packet
(
self
,
seq
,
flags
,
PseudoTcpWriteResult
wres
=
packet
(
self
,
seq
,
flags
,
segment
->
seq
-
priv
->
snd_una
,
nTransmit
);
segment
->
seq
-
priv
->
snd_una
,
nTransmit
,
now
);
if
(
wres
==
WR_SUCCESS
)
if
(
wres
==
WR_SUCCESS
)
break
;
break
;
...
@@ -1662,9 +1661,9 @@ attempt_send(PseudoTcpSocket *self, SendFlags sflags)
...
@@ -1662,9 +1661,9 @@ attempt_send(PseudoTcpSocket *self, SendFlags sflags)
// If this is an immediate ack, or the second delayed ack
// If this is an immediate ack, or the second delayed ack
if
((
sflags
==
sfImmediateAck
)
||
priv
->
t_ack
)
{
if
((
sflags
==
sfImmediateAck
)
||
priv
->
t_ack
)
{
packet
(
self
,
priv
->
snd_nxt
,
0
,
0
,
0
);
packet
(
self
,
priv
->
snd_nxt
,
0
,
0
,
0
,
now
);
}
else
{
}
else
{
priv
->
t_ack
=
get_current_time
()
;
priv
->
t_ack
=
now
;
}
}
return
;
return
;
}
}
...
...
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