comparison libpurple/network.c @ 20096:2a9f3a499b0d

merge of '34d642b12b7215d55fd032cd513a7e225715f19a' and '7868c3b2b7d17c52916e4bb76305b7e3b68d3904'
author Richard Laager <rlaager@wiktel.com>
date Mon, 17 Sep 2007 03:47:45 +0000
parents 6bf32c9e15a7
children 04fe5601fedb
comparison
equal deleted inserted replaced
19936:191fa8a8c0bc 20096:2a9f3a499b0d
1 /** 1 /**
2 * @file network.c Network Implementation 2 * @file network.c Network Implementation
3 * @ingroup core 3 * @ingroup core
4 * 4 */
5 * purple 5
6 /* purple
6 * 7 *
7 * Purple is the legal property of its developers, whose names are too numerous 8 * Purple is the legal property of its developers, whose names are too numerous
8 * to list here. Please refer to the COPYRIGHT file distributed with this 9 * to list here. Please refer to the COPYRIGHT file distributed with this
9 * source distribution. 10 * source distribution.
10 * 11 *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details. 20 * GNU General Public License for more details.
20 * 21 *
21 * You should have received a copy of the GNU General Public License 22 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software 23 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
24 */ 25 */
25 26
26 #include "internal.h" 27 #include "internal.h"
27 28
28 #ifndef _WIN32 29 #ifndef _WIN32
349 listen_data->listenfd = listenfd; 350 listen_data->listenfd = listenfd;
350 listen_data->adding = TRUE; 351 listen_data->adding = TRUE;
351 listen_data->retry = TRUE; 352 listen_data->retry = TRUE;
352 listen_data->cb = cb; 353 listen_data->cb = cb;
353 listen_data->cb_data = cb_data; 354 listen_data->cb_data = cb_data;
355 listen_data->socket_type = socket_type;
354 356
355 /* Attempt a NAT-PMP Mapping, which will return immediately */ 357 /* Attempt a NAT-PMP Mapping, which will return immediately */
356 if (purple_pmp_create_map(((socket_type == SOCK_STREAM) ? PURPLE_PMP_TYPE_TCP : PURPLE_PMP_TYPE_UDP), 358 if (purple_pmp_create_map(((socket_type == SOCK_STREAM) ? PURPLE_PMP_TYPE_TCP : PURPLE_PMP_TYPE_UDP),
357 actual_port, actual_port, PURPLE_PMP_LIFETIME)) 359 actual_port, actual_port, PURPLE_PMP_LIFETIME))
358 { 360 {
359 purple_debug_info("network", "Created NAT-PMP mapping on port %i",actual_port); 361 purple_debug_info("network", "Created NAT-PMP mapping on port %i\n",actual_port);
360 /* We want to return listen_data now, and on the next run loop trigger the cb and destroy listen_data */ 362 /* We want to return listen_data now, and on the next run loop trigger the cb and destroy listen_data */
361 purple_timeout_add(0, purple_network_finish_pmp_map_cb, listen_data); 363 purple_timeout_add(0, purple_network_finish_pmp_map_cb, listen_data);
362 } 364 }
363 else 365 else
364 { 366 {