Commit b244a4c4 authored by Youness Alaoui's avatar Youness Alaoui

Correctly set the inbound address of the socket to the server address for tcp relay

parent fa5fb7ae
...@@ -62,6 +62,7 @@ typedef struct { ...@@ -62,6 +62,7 @@ typedef struct {
gchar recv_buf[65536]; gchar recv_buf[65536];
guint recv_buf_len; guint recv_buf_len;
guint expecting_len; guint expecting_len;
NiceAddress server_addr;
} TurnTcpPriv; } TurnTcpPriv;
struct to_be_sent { struct to_be_sent {
...@@ -146,6 +147,8 @@ socket_recv ( ...@@ -146,6 +147,8 @@ socket_recv (
memcpy (buf, priv->recv_buf, copy_len); memcpy (buf, priv->recv_buf, copy_len);
priv->expecting_len = 0; priv->expecting_len = 0;
priv->recv_buf_len = 0; priv->recv_buf_len = 0;
if (from)
*from = priv->server_addr;
return copy_len; return copy_len;
} }
...@@ -353,6 +356,7 @@ nice_tcp_turn_socket_new ( ...@@ -353,6 +356,7 @@ nice_tcp_turn_socket_new (
sock->priv = priv = g_slice_new0 (TurnTcpPriv); sock->priv = priv = g_slice_new0 (TurnTcpPriv);
priv->compatibility = compatibility; priv->compatibility = compatibility;
priv->server_addr = *addr;
sock->fileno = sockfd; sock->fileno = sockfd;
sock->send = socket_send; sock->send = socket_send;
......
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