Commit b5562b3c authored by Youness Alaoui's avatar Youness Alaoui

remove useless agent in socks5 proxy, fix copyright and return FALSE in send, if we're in an error

parent 6efd9ab5
...@@ -920,7 +920,7 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent, ...@@ -920,7 +920,7 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
if (socket && if (socket &&
agent->proxy_type == NICE_PROXY_TYPE_SOCKS5) { agent->proxy_type == NICE_PROXY_TYPE_SOCKS5) {
socket = nice_socks5_socket_new (agent, socket, &turn->server, socket = nice_socks5_socket_new (socket, &turn->server,
agent->proxy_username, agent->proxy_password); agent->proxy_username, agent->proxy_password);
} else { } else {
/* TODO add HTTP support */ /* TODO add HTTP support */
......
/* /*
* This file is part of the Nice GLib ICE library. * This file is part of the Nice GLib ICE library.
* *
* (C) 2006-2008 Collabora Ltd. * (C) 2008 Collabora Ltd.
* Contact: Dafydd Harries * Contact: Youness Alaoui
* Contact: Olivier Crete * (C) 2008 Nokia Corporation. All rights reserved.
* (C) 2006, 2007 Nokia Corporation. All rights reserved.
* Contact: Kai Vehmanen
* *
* The contents of this file are subject to the Mozilla Public License Version * The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with * 1.1 (the "License"); you may not use this file except in compliance with
...@@ -23,10 +21,7 @@ ...@@ -23,10 +21,7 @@
* Corporation. All Rights Reserved. * Corporation. All Rights Reserved.
* *
* Contributors: * Contributors:
* Dafydd Harries, Collabora Ltd. * Youness Alaoui, Collabora Ltd.
* Olivier Crete, Collabora Ltd.
* Rémi Denis-Courmont, Nokia
* Kai Vehmanen
* *
* Alternatively, the contents of this file may be used under the terms of the * Alternatively, the contents of this file may be used under the terms of the
* the GNU Lesser General Public License Version 2.1 (the "LGPL"), in which * the GNU Lesser General Public License Version 2.1 (the "LGPL"), in which
...@@ -93,7 +88,7 @@ static void free_to_be_sent (struct to_be_sent *tbs); ...@@ -93,7 +88,7 @@ static void free_to_be_sent (struct to_be_sent *tbs);
NiceSocket * NiceSocket *
nice_socks5_socket_new (NiceAgent *agent, NiceSocket *base_socket, nice_socks5_socket_new (NiceSocket *base_socket,
NiceAddress *addr, gchar *username, gchar *password) NiceAddress *addr, gchar *username, gchar *password)
{ {
Socks5Priv *priv; Socks5Priv *priv;
...@@ -385,6 +380,8 @@ socket_send (NiceSocket *sock, const NiceAddress *to, ...@@ -385,6 +380,8 @@ socket_send (NiceSocket *sock, const NiceAddress *to,
return nice_socket_send (priv->base_socket, to, len, buf); return nice_socket_send (priv->base_socket, to, len, buf);
else else
return FALSE; return FALSE;
} else if (priv->state == SOCKS_STATE_ERROR) {
return FALSE;
} else { } else {
add_to_be_sent (sock, to, buf, len); add_to_be_sent (sock, to, buf, len);
} }
......
/* /*
* This file is part of the Nice GLib ICE library. * This file is part of the Nice GLib ICE library.
* *
* (C) 2006, 2007 Collabora Ltd. * (C) 2008 Collabora Ltd.
* Contact: Dafydd Harries * Contact: Youness Alaoui
* (C) 2006, 2007 Nokia Corporation. All rights reserved. * (C) 2008 Nokia Corporation. All rights reserved.
* Contact: Kai Vehmanen
* *
* The contents of this file are subject to the Mozilla Public License Version * The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with * 1.1 (the "License"); you may not use this file except in compliance with
...@@ -22,7 +21,7 @@ ...@@ -22,7 +21,7 @@
* Corporation. All Rights Reserved. * Corporation. All Rights Reserved.
* *
* Contributors: * Contributors:
* Dafydd Harries, Collabora Ltd. * Youness Alaoui, Collabora Ltd.
* *
* Alternatively, the contents of this file may be used under the terms of the * Alternatively, the contents of this file may be used under the terms of the
* the GNU Lesser General Public License Version 2.1 (the "LGPL"), in which * the GNU Lesser General Public License Version 2.1 (the "LGPL"), in which
...@@ -45,7 +44,7 @@ G_BEGIN_DECLS ...@@ -45,7 +44,7 @@ G_BEGIN_DECLS
NiceSocket * NiceSocket *
nice_socks5_socket_new (NiceAgent *agent, NiceSocket *base_socket, nice_socks5_socket_new (NiceSocket *base_socket,
NiceAddress *addr, gchar *username, gchar *password); NiceAddress *addr, gchar *username, gchar *password);
......
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