comparison libpurple/protocols/jabber/si.c @ 27108:38c4973b5222

Add a function to remove a port mapping (UPnP or NAT-PMP) given a file descriptor. Adapt the XMPP PRPL to use this to remove port mappings when a file transfer is done. There is still no support for removing left-over mappings at exit, since I've found no good way of calling purple_upnp_remove_port_mapping (which relies on callbacks) from purple_network_uninit (since the main thread terminates after the _uninit functions have finished)...
author Marcus Lundblad <ml@update.uu.se>
date Mon, 15 Jun 2009 21:43:25 +0000
parents a8537bbcfb79
children 73c8e1964eef afe5c224f3e9
comparison
equal deleted inserted replaced
27107:55811a205c71 27108:38c4973b5222
1319 purple_network_listen_cancel(jsx->listen_data); 1319 purple_network_listen_cancel(jsx->listen_data);
1320 if (jsx->iq_id != NULL) 1320 if (jsx->iq_id != NULL)
1321 jabber_iq_remove_callback_by_id(js, jsx->iq_id); 1321 jabber_iq_remove_callback_by_id(js, jsx->iq_id);
1322 if (jsx->local_streamhost_fd >= 0) 1322 if (jsx->local_streamhost_fd >= 0)
1323 close(jsx->local_streamhost_fd); 1323 close(jsx->local_streamhost_fd);
1324 if (purple_xfer_get_type(xfer) == PURPLE_XFER_SEND &&
1325 xfer->fd >= 0) {
1326 purple_debug_info("jabber", "remove port mapping\n");
1327 purple_network_remove_port_mapping(xfer->fd);
1328 }
1324 if (jsx->connect_timeout > 0) 1329 if (jsx->connect_timeout > 0)
1325 purple_timeout_remove(jsx->connect_timeout); 1330 purple_timeout_remove(jsx->connect_timeout);
1326 if (jsx->ibb_timeout_handle > 0) 1331 if (jsx->ibb_timeout_handle > 0)
1327 purple_timeout_remove(jsx->ibb_timeout_handle); 1332 purple_timeout_remove(jsx->ibb_timeout_handle);
1328 1333