Commit f55c780e authored by Olivier Crête's avatar Olivier Crête
Browse files

pseudotcp: Don't mix "long" and guint, one is signed, the other is unsigned

So use guint64 everywhere, this is never supposed to be negative.
parent b1fa963d
......@@ -1454,7 +1454,7 @@ static void
adjust_tcp_clock (NiceAgent *agent, Stream *stream, Component *component)
{
if (component->tcp) {
long timeout = component->last_clock_timeout;
guint64 timeout = component->last_clock_timeout;
if (pseudo_tcp_socket_get_next_clock (component->tcp, &timeout)) {
if (timeout != component->last_clock_timeout) {
......
......@@ -190,7 +190,7 @@ struct _Component
PseudoTcpSocket *tcp;
GSource* tcp_clock;
long last_clock_timeout;
guint64 last_clock_timeout;
gboolean tcp_readable;
GCancellable *tcp_writable_cancellable;
......
......@@ -936,7 +936,7 @@ pseudo_tcp_socket_notify_message (PseudoTcpSocket *self,
}
gboolean
pseudo_tcp_socket_get_next_clock(PseudoTcpSocket *self, long *timeout)
pseudo_tcp_socket_get_next_clock(PseudoTcpSocket *self, guint64 *timeout)
{
PseudoTcpSocketPrivate *priv = self->priv;
guint32 now = get_current_time ();
......
......@@ -357,7 +357,8 @@ int pseudo_tcp_socket_get_error(PseudoTcpSocket *self);
*
* Since: 0.0.11
*/
gboolean pseudo_tcp_socket_get_next_clock(PseudoTcpSocket *self, long *timeout);
gboolean pseudo_tcp_socket_get_next_clock(PseudoTcpSocket *self,
guint64 *timeout);
/**
......
......@@ -220,7 +220,8 @@ static gboolean notify_clock (gpointer data)
static void adjust_clock (PseudoTcpSocket *sock)
{
long timeout = 0;
guint64 timeout = 0;
if (pseudo_tcp_socket_get_next_clock (sock, &timeout)) {
timeout -= g_get_monotonic_time () / 1000;
g_debug ("Socket %p: Adjuting clock to %ld ms", sock, timeout);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment