diff options
author | Youness Alaoui <youness.alaoui@collabora.co.uk> | 2012-02-13 15:12:36 -0500 |
---|---|---|
committer | Youness Alaoui <youness.alaoui@collabora.co.uk> | 2012-02-13 15:12:38 -0500 |
commit | 7b9965d180eb7cfffe503e66d3fb8856c7c163bb (patch) | |
tree | 53cb303f3671a26349d2900c6f02a7deb2a9f938 /socket/http.c | |
parent | c03ac48b9a1c27d20ee7a393c0e16a77801be2df (diff) | |
download | libnice-7b9965d180eb7cfffe503e66d3fb8856c7c163bb.tar.gz |
Return real origin when using a proxy (fixes detecting TURN sockets)
If using a proxy, the 'from' of all packets were of the proxy server
instead of the turn server, causing the check for turn to fail.
Thanks to Madaro Livio.
Diffstat (limited to 'socket/http.c')
-rw-r--r-- | socket/http.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/socket/http.c b/socket/http.c index 81e18fb..90b11b2 100644 --- a/socket/http.c +++ b/socket/http.c @@ -190,8 +190,11 @@ socket_recv (NiceSocket *sock, NiceAddress *from, guint len, gchar *buf) HttpPriv *priv = sock->priv; gint read = -1; + if (from) + *from = priv->addr; + if (priv->base_socket) - read = nice_socket_recv (priv->base_socket, from, len, buf); + read = nice_socket_recv (priv->base_socket, NULL, len, buf); if (read <= 0 || priv->state == HTTP_STATE_CONNECTED) { return read; |